|
|
/**
|
|
|
* @license
|
|
|
* Cesium - https://github.com/CesiumGS/cesium
|
|
|
* Version 1.128
|
|
|
*
|
|
|
* Copyright 2011-2022 Cesium Contributors
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
* You may obtain a copy of the License at
|
|
|
*
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
*
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
* See the License for the specific language governing permissions and
|
|
|
* limitations under the License.
|
|
|
*
|
|
|
* Columbus View (Pat. Pend.)
|
|
|
*
|
|
|
* Portions licensed separately.
|
|
|
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
|
*/
|
|
|
|
|
|
var Cesium=(()=>{var o1e=Object.create;var $M=Object.defineProperty;var r1e=Object.getOwnPropertyDescriptor;var s1e=Object.getOwnPropertyNames;var a1e=Object.getPrototypeOf,c1e=Object.prototype.hasOwnProperty;var eN=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ad=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l1e=(e,t)=>{for(var n in t)$M(e,n,{get:t[n],enumerable:!0})},_q=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of s1e(t))!c1e.call(e,o)&&o!==n&&$M(e,o,{get:()=>t[o],enumerable:!(i=r1e(t,o))||i.enumerable});return e};var _=(e,t,n)=>(n=e!=null?o1e(a1e(e)):{},_q(t||!e||!e.__esModule?$M(n,"default",{value:e,enumerable:!0}):n,e)),d1e=e=>_q($M({},"__esModule",{value:!0}),e);var T=ad(()=>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CgibGVmdCIsdCkseS50eXBlT2Yub2JqZWN0KCJyaWdodCIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pLG4ueD10LngqZS54LG4ueT10LnkqZS55LG4uej10LnoqZS56LG4udz10LncqZS53LG59O3Z0LmRpdmlkZUNvbXBvbmVudHM9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImxlZnQiLHQpLHkudHlwZU9mLm9iamVjdCgicmlnaHQiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54L2UueCxuLnk9dC55L2UueSxuLno9dC56L2UueixuLnc9dC53L2UudyxufTt2dC5hZGQ9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImxlZnQiLHQpLHkudHlwZU9mLm9iamVjdCgicmlnaHQiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54K2UueCxuLnk9dC55K2UueSxuLno9dC56K2UueixuLnc9dC53K2UudyxufTt2dC5zdWJ0cmFjdD1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibGVmdCIsdCkseS50eXBlT2Yub2JqZWN0KCJyaWdodCIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pLG4ueD10LngtZS54LG4ueT10LnktZS55LG4uej10LnotZS56LG4udz10LnctZS53LG59O3Z0Lm11bHRpcGx5QnlTY2FsYXI9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImNhcnRlc2lhbiIsdCkseS50eXBlT2YubnVtYmVyKCJzY2FsYXIiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54KmUsbi55PXQueSplLG4uej10LnoqZSxuLnc9dC53KmUsbn07dnQuZGl2aWRlQnlTY2FsYXI9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3Q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3QuY29tcHV0ZUF4aXMoRHIsQ3ApO2xldCBmPU90LmNvbXB1dGVBbmdsZShEcik7aChvKXx8KG89W10pLG9bc109Q3AueCpmLG9bcysxXT1DcC55KmYsb1tzKzJdPUNwLnoqZn19O090LnVucGFja0ludGVycG9sYXRpb25SZXN1bHQ9ZnVuY3Rpb24odCxlLG4sbyxyKXtoKHIpfHwocj1uZXcgT3QpLGEuZnJvbUFycmF5KHQsMCxhaCk7bGV0IGk9YS5tYWduaXR1ZGUoYWgpO3JldHVybiBPdC51bnBhY2soZSxvKjQsSkEpLGk9PT0wP090LmNsb25lKE90LklERU5USVRZLERyKTpPdC5mcm9tQXhpc0FuZ2xlKGFoLGksRHIpLE90Lm11bHRpcGx5KERyLEpBLHIpfTtPdC5jbG9uZT1mdW5jdGlvbih0LGUpe2lmKGgodCkpcmV0dXJuIGgoZSk/KGUueD10LngsZS55PXQueSxlLno9dC56LGUudz10LncsZSk6bmV3IE90KHQueCx0LnksdC56LHQudyl9O090LmNvbmp1Z2F0ZT1mdW5jdGlvbih0LGUpe3JldHVybiB5LnR5cGVPZi5vYmplY3QoInF1YXRlcm5pb24iLHQpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixlKSxlLng9LXQueCxlLnk9LXQueSxlLno9LXQueixlLnc9dC53LGV9O090Lm1hZ25pdHVkZVNxdWFyZWQ9ZnVuY3Rpb24odCl7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgicXVhdGVybmlvbiIsdCksdC54KnQueCt0LnkqdC55K3Queip0LnordC53KnQud307T3QubWFnbml0dWRlPWZ1bmN0aW9uKHQpe3JldHVybiBNYXRoLnNxcnQoT3QubWFnbml0dWRlU3F1YXJlZCh0KSl9O090Lm5vcm1hbGl6ZT1mdW5jdGlvbih0LGUpe3kudHlwZU9mLm9iamVjdCgicmVzdWx0IixlKTtsZXQgbj0xL090Lm1hZ25pdHVkZSh0KSxvPXQueCpuLHI9dC55Km4saT10LnoqbixzPXQudypuO3JldHVybiBlLng9by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NhKE1hdGguUEktVCxpLF8sbSx1LGwsYyxwLGQsTSksZSl7Zm9yKEVbdysrXT1DLngsRVt3KytdPUMueSxFW3crK109Qy56LFM9MipCKzIsQT0xO0E8Uy0xOysrQSl4PUEvKFMtMSksTD1hLmxlcnAoQyxNLHgsZDApLEVbdysrXT1MLngsRVt3KytdPUwueSxFW3crK109TC56O0VbdysrXT1NLngsRVt3KytdPU0ueSxFW3crK109TS56fW4mJih2W0YtLV09Qy56LHZbRi0tXT1DLnksdltGLS1dPUMueCx2W0krK109TS54LHZbSSsrXT1NLnksdltJKytdPU0ueiksVD1QLlBJX09WRVJfVFdPLShCKzEpKmJ9Zm9yKEI9ZztCPjE7LS1CKXtpZihUPVAuUElfT1ZFUl9UV08tKEItMSkqYixDPWNhKC1ULGksXyxtLHUsbCxjLHAsZCxDKSxNPWNhKFQrTWF0aC5QSSxpLF8sbSx1LGwsYyxwLGQsTSksZSl7Zm9yKEVbdysrXT1DLngsRVt3KytdPUMueSxFW3crK109Qy56LFM9MiooQi0xKSsyLEE9MTtBPFMtMTsrK0EpeD1BLyhTLTEpLEw9YS5sZXJwKEMsTSx4LGQwKSxFW3crK109TC54LEVbdysrXT1MLnksRVt3KytdPUwuejtFW3crK109TS54LEVbdysrXT1NLnksRVt3KytdPU0uen1uJiYodltGLS1dPUMueix2W0YtLV09Qy55LHZbRi0tXT1DLngsdltJKytdPU0ueCx2W0krK109TS55LHZbSSsrXT1NLnopfVQ9UC5QSV9PVkVSX1RXTyxDPWNhKC1ULGksXyxtLHUsbCxjLHAsZCxDKTtsZXQgej17fTtyZXR1cm4gZSYmKEVbdysrXT1DLngsRVt3KytdPUMueSxFW3crK109Qy56LHoucG9zaXRpb25zPUUsei5udW1QdHM9ZyksbiYmKHZbRi0tXT1DLnosdltGLS1dPUMueSx2W0YtLV09Qy54LHoub3V0ZXJQb3NpdGlvbnM9diksen07R3I9bTB9KTtmdW5jdGlvbiBVTSh0KXtpZih0PXQ/P0l0LkVNUFRZX09CSk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yYXBoaWMobnQsJHApLHkwKTthLnN1YnRyYWN0KGF0LE4sYXQpLCRuLng9KGF0LngrcikvKDIqciksJG4ueT0oYXQueStpKS8oMippKSxCLng9TWF0aC5taW4oJG4ueCxCLngpLEIueT1NYXRoLm1pbigkbi55LEIueSksQS54PU1hdGgubWF4KCRuLngsQS54KSxBLnk9TWF0aC5tYXgoJG4ueSxBLnkpLGRbTyt4XT0kbi54LGRbTysxK3hdPSRuLnksZFtPKytdPSRuLngsZFtPKytdPSRuLnl9cT1zLnNjYWxlVG9HZW9kZXRpY1N1cmZhY2UocSxxKSxXPWEuY2xvbmUocSxfMCksRT1zLmdlb2RldGljU3VyZmFjZU5vcm1hbChxLEUpLGImJihUW3orU109LUUueCxUW2orU109LUUueSxUW2srU109LUUueik7bGV0IFI9YS5tdWx0aXBseUJ5U2NhbGFyKEUsZixBVCk7aWYocT1hLmFkZChxLFIscSksUj1hLm11bHRpcGx5QnlTY2FsYXIoRSx1LFIpLFc9YS5hZGQoVyxSLFcpLG4ucG9zaXRpb24mJihwW3orU109Vy54LHBbaitTXT1XLnkscFtrK1NdPVcueixwW3pdPXEueCxwW2pdPXEueSxwW2tdPXEueiksbi5ub3JtYWx8fG4udGFuZ2VudHx8bi5iaXRhbmdlbnQpe0M9YS5jbG9uZShFLEMpO2xldCBudD1hLmZyb21BcnJheSh0LCh6KzMpJVMsQVQpO2Euc3VidHJhY3QobnQscSxudCk7bGV0IGF0PWEuc3VidHJhY3QoVyxxLHkwKTtFPWEubm9ybWFsaXplKGEuY3Jvc3MoYXQsbnQsRSksRSksbi5ub3JtYWwmJihtW3pdPUUueCxtW2pdPUUueSxtW2tdPUUueixtW3orU109RS54LG1baitTXT1FLnksbVtrK1NdPUUueiksbi50YW5nZW50JiYodz1hLm5vcm1hbGl6ZShhLmNyb3NzKEMsRSx3KSx3KSxfW3pdPXcueCxfW2pdPXcueSxfW2tdPXcueixfW3orU109dy54LF9beisxK1NdPXcueSxfW3orMitTXT13LnopLG4uYml0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ksci5iaXRhbmdlbnQmJihMPWEubm9ybWFsaXplKGEuY3Jvc3MoQSx4LEwpLEwpLG1bdisrXT1MLngsbVt2KytdPUwueSxtW3YrK109TC56LG1bdisrXT1MLngsbVt2KytdPUwueSxtW3YrK109TC56KSl9Zm9yKF89MDtfPGk7XysrKXIubm9ybWFsJiYocFtGKytdPTAscFtGKytdPTAscFtGKytdPS0xKSxyLnRhbmdlbnQmJihkW0krK109MSxkW0krK109MCxkW0krK109MCksci5iaXRhbmdlbnQmJihtW3YrK109MCxtW3YrK109LTEsbVt2KytdPTApO2ZvcihfPTA7XzxpO18rKylyLm5vcm1hbCYmKHBbRisrXT0wLHBbRisrXT0wLHBbRisrXT0xKSxyLnRhbmdlbnQmJihkW0krK109MSxkW0krK109MCxkW0krK109MCksci5iaXRhbmdlbnQmJihtW3YrK109MCxtW3YrK109MSxtW3YrK109MCl9bGV0IGI9MTIqaS0xMixUPUZ0LmNyZWF0ZVR5cGVkQXJyYXkodSxiKSxPPTAsRT0wO2ZvcihfPTA7XzxpLTE7XysrKVRbTysrXT1FLFRbTysrXT1FKzIsVFtPKytdPUUrMyxUW08rK109RSxUW08rK109RSszLFRbTysrXT1FKzEsRSs9Mjtmb3IoVFtPKytdPXMtMixUW08rK109MCxUW08rK109MSxUW08rK109cy0yLFRbTysrXT0xLFRbTysrXT1zLTEsXz0xO188aS0xO18rKylUW08rK109cytfKzEsVFtPKytdPXMrXyxUW08rK109cztmb3IoXz0xO188aS0xO18rKylUW08rK109ZixUW08rK109ZitfLFRbTysrXT1mK18rMTtsZXQgdz0wO2lmKHIuc3Qpe2xldCBOPU1hdGgubWF4KG4sbyk7Zm9yKF89MDtfPHU7XysrKXtsZXQgRj1hLmZyb21BcnJheShjLF8qMyx1Rik7bFt3KytdPShGLngrTikvKDIqTiksbFt3KytdPShGLnkrTikvKDIqTil9fWxldCBDPW5ldyBpZTtyLnBvc2l0aW9uJiYoQy5wb3NpdGlvbj1uZXcgaXQoe2NvbXBvbmVudERhd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sSWs9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT4kZygpKX0sdms9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5lMSgpKX0sRms9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5uMSgpKX0sTGs9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5yMSgpKX07cmV0dXJuIFFTKERrKTt9KSgpOwo=")});var tN=ad((zVt,Tq)=>{var HVt=_(T()),pp=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)};pp.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}};pp.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};pp.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};pp.prototype.random_int31=function(){return this.random_int()>>>1};pp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};pp.prototype.random=function(){return this.random_int()*(1/4294967296)};pp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};pp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Tq.exports=pp});var zq=ad((HS,KS)=>{var SZt=_(T());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof HS=="object"&&HS&&!HS.nodeType&&HS,n=typeof KS=="object"&&KS&&!KS.nodeType&&KS,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,d=38,u=700,h=72,p=128,g="-",f=/^xn--/,y=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=s-a,V=Math.floor,L=String.fromCharCode,Z;function E(k){throw new RangeError(S[k])}function P(k,B){for(var N=k.length,z=[];N--;)z[N]=B(k[N]);return z}function W(k,B){var N=k.split("@"),z="";N.length>1&&(z=N[0]+"@",k=N[1]),k=k.replace(x,".");var K=k.split("."),te=P(K,B).join(".");return z+te}function v(k){for(var B=[],N=0,z=k.length,K,te;N<z;)K=k.charCodeAt(N++),K>=55296&&K<=56319&&N<z?(te=k.charCodeAt(N++),(te&64512)==56320?B.push(((K&1023)<<10)+(te&1023)+65536):(B.push(K),N--)):B.push(K);return B}function A(k){return P(k,function(B){var N="";return B>65535&&(B-=65536,N+=L(B>>>10&1023|55296),B=56320|B&1023),N+=L(B),N}).join("")}function b(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:s}function R(k,B){return k+22+75*(k<26)-((B!=0)<<5)}function G(k,B,N){var z=0;for(k=N?V(k/u):k>>1,k+=V(k/B);k>C*c>>1;z+=s)k=V(k/C);return V(z+(C+1)*k/(k+d))}function I(k){var B=[],N=k.length,z,K=0,te=p,H=h,j,ee,pe,_e,ae,ye,Se,Ee,Ie;for(j=k.lastIndexOf(g),j<0&&(j=0),ee=0;ee<j;++ee)k.charCodeAt(ee)>=128&&E("not-basic"),B.push(k.charCodeAt(ee));for(pe=j>0?j+1:0;pe<N;){for(_e=K,ae=1,ye=s;pe>=N&&E("invalid-input"),Se=b(k.charCodeAt(pe++)),(Se>=s||Se>V((r-K)/ae))&&E("overflow"),K+=Se*ae,Ee=ye<=H?a:ye>=H+c?c:ye-H,!(Se<Ee);ye+=s)Ie=s-Ee,ae>V(r/Ie)&&E("overflow"),ae*=Ie;z=B.length+1,H=G(K-_e,z,_e==0),V(K/z)>r-te&&E("overflow"),te+=V(K/z),K%=z,B.splice(K++,0,te)}return A(B)}function w(k){var B,N,z,K,te,H,j,ee,pe,_e,ae,ye=[],Se,Ee,Ie,Fe;for(k=v(k),Se=k.length,B=p,N=0,te=h,H=0;H<Se;++H)ae=k[H],ae<128&&ye.push(L(ae));for(z=K=ye.length,K&&ye.push(g);z<Se;){for(j=r,H=0;H<Se;++H)ae=k[H],ae>=B&&ae<j&&(j=ae);for(Ee=z+1,j-B>V((r-N)/Ee)&&E("overflow"),N+=(j-B)*Ee,B=j,H=0;H<Se;++H)if(ae=k[H],ae<B&&++N>r&&E("overflow"),ae==B){for(ee=N,pe=s;_e=pe<=te?a:pe>=te+c?c:pe-te,!(ee<_e);pe+=s)Fe=ee-_e,Ie=s-_e,ye.push(L(R(_e+Fe%Ie,0))),ee=V(Fe/Ie);ye.push(L(R(ee,0))),te=G(N,Ee,z==K),N=0,++z}++N,++B}return ye.join("")}function M(k){return W(k,function(B){return f.test(B)?I(B.slice(4).toLowerCase()):B})}function O(k){return W(k,function(B){return y.test(B)?"xn--"+w(B):B})}if(o={version:"1.3.2",ucs2:{decode:v,encode:A},decode:I,encode:w,toASCII:O,toUnicode:M},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(KS.exports==t)n.exports=o;else for(Z in o)o.hasOwnProperty(Z)&&(t[Z]=o[Z]);else e.punycode=o})(HS)});var Kq=ad((Hq,TN)=>{var CZt=_(T());/*!
|
|
|
* URI.js - Mutating URLs
|
|
|
* IPv6 Support
|
|
|
*
|
|
|
* Version: 1.19.11
|
|
|
*
|
|
|
* Author: Rodney Rehm
|
|
|
* Web: http://medialize.github.io/URI.js/
|
|
|
*
|
|
|
* Licensed under
|
|
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
|
*
|
|
|
*/(function(e,t){"use strict";typeof TN=="object"&&TN.exports?TN.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Hq,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var d;for(d=0;d<a&&s[d]!=="";d++);if(d<c)for(s.splice(d,1,"0000");s.length<c;)s.splice(d,0,"0000");for(var u,h=0;h<c;h++){u=s[h].split("");for(var p=0;p<3&&(u[0]==="0"&&u.length>1);p++)u.splice(0,1);s[h]=u.join("")}var g=-1,f=0,y=0,x=-1,S=!1;for(h=0;h<c;h++)S?s[h]==="0"?y+=1:(S=!1,y>f&&(g=x,f=y)):s[h]==="0"&&(S=!0,x=h,y=1);y>f&&(g=x,f=y),f>1&&s.splice(g,f,""),a=s.length;var C="";for(s[0]===""&&(C=":"),h=0;h<a&&(C+=s[h],h!==a-1);h++)C+=":";return s[a-1]===""&&(C+=":"),C}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var Qq=ad((Jq,SN)=>{var VZt=_(T());/*!
|
|
|
* URI.js - Mutating URLs
|
|
|
* Second Level Domain (SLD) Support
|
|
|
*
|
|
|
* Version: 1.19.11
|
|
|
*
|
|
|
* Author: Rodney Rehm
|
|
|
* Web: http://medialize.github.io/URI.js/
|
|
|
*
|
|
|
* Licensed under
|
|
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
|
*
|
|
|
*/(function(e,t){"use strict";typeof SN=="object"&&SN.exports?SN.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Jq,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var cd=ad((jq,CN)=>{var LZt=_(T());/*!
|
|
|
* URI.js - Mutating URLs
|
|
|
*
|
|
|
* Version: 1.19.11
|
|
|
*
|
|
|
* Author: Rodney Rehm
|
|
|
* Web: http://medialize.github.io/URI.js/
|
|
|
*
|
|
|
* Licensed under
|
|
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
|
*
|
|
|
*/(function(e,t){"use strict";typeof CN=="object"&&CN.exports?CN.exports=t(zq(),Kq(),Qq()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(jq,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(R,G){var I=arguments.length>=1,w=arguments.length>=2;if(!(this instanceof r))return I?w?new r(R,G):new r(R):new r;if(R===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?R=location.href+"":R=""}if(R===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(R),G!==void 0?this.absoluteTo(G):this}function s(R){return/^[0-9]+$/.test(R)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function d(R){return R.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(R){return R===void 0?"Undefined":String(Object.prototype.toString.call(R)).slice(8,-1)}function h(R){return u(R)==="Array"}function p(R,G){var I={},w,M;if(u(G)==="RegExp")I=null;else if(h(G))for(w=0,M=G.length;w<M;w++)I[G[w]]=!0;else I[G]=!0;for(w=0,M=R.length;w<M;w++){var O=I&&I[R[w]]!==void 0||!I&&G.test(R[w]);O&&(R.splice(w,1),M--,w--)}return R}function g(R,G){var I,w;if(h(G)){for(I=0,w=G.length;I<w;I++)if(!g(R,G[I]))return!1;return!0}var M=u(G);for(I=0,w=R.length;I<w;I++)if(M==="RegExp"){if(typeof R[I]=="string"&&R[I].match(G))return!0}else if(R[I]===G)return!0;return!1}function f(R,G){if(!h(R)||!h(G)||R.length!==G.length)return!1;R.sort(),G.sort();for(var I=0,w=R.length;I<w;I++)if(R[I]!==G[I])return!1;return!0}function y(R){var G=/^\/+|\/+$/g;return R.replace(G,"")}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(R){if(!(!R||!R.nodeName)){var G=R.nodeName.toLowerCase();if(!(G==="input"&&R.type!=="image"))return r.domAttributes[G]}};function x(R){return escape(R)}function S(R){return encodeURIComponent(R).replace(/[!'()*]/g,x).replace(/\*/g,"%2A")}r.encode=S,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=S,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(R,G){var I=r.encode(R+"");return G===void 0&&(G=r.escapeQuerySpace),G?I.replace(/%20/g,"+"):I},r.decodeQuery=function(R,G){R+="",G===void 0&&(G=r.escapeQuerySpace);try{return r.decode(G?R.replace(/\+/g,"%20"):R)}catch{return R}};var C={encode:"encode",decode:"decode"},V,L=function(R,G){return function(I){try{return r[G](I+"").replace(r.characters[R][G].expression,function(w){return r.characters[R][G].map[w]})}catch{return I}}};for(V in C)r[V+"PathSegment"]=L("pathname",C[V]),r[V+"UrnPathSegment"]=L("urnpath",C[V]);var Z=function(R,G,I){return function(w){var M;I?M=function(N){return r[G](r[I](N))}:M=r[G];for(var O=(w+"").split(R),k=0,B=O.length;k<B;k++)O[k]=M(O[k]);return O.join(R)}};r.decodePath=Z("/","decodePathSegment"),r.decodeUrnPath=Z(":","decodeUrnPathSegment"),r.recodePath=Z("/","encodePathSegment","decode"),r.recodeUrnPath=Z(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(R,G){var I;return G||(G={preventInvalidHostname:r.preventInvalidHostname}),R=R.replace(r.leading_whitespace_expression,""),R=R.replace(r.ascii_tab_whitespace,""),I=R.indexOf("#"),I>-1&&(G.fragment=R.substring(I+1)||null,R=R.substring(0,I)),I=R.indexOf("?"),I>-1&&(G.query=R.substring(I+1)||null,R=R.substring(0,I)),R=R.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),R=R.replace(/^[/\\]{2,}/i,"//"),R.substring(0,2)==="//"?(G.protocol=null,R=R.substring(2),R=r.parseAuthority(R,G)):(I=R.indexOf(":"),I>-1&&(G.protocol=R.substring(0,I)||null,G.protocol&&!G.protocol.match(r.protocol_expression)?G.protocol=void 0:R.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(R=R.substring(I+3),R=r.parseAuthority(R,G)):(R=R.substring(I+1),G.urn=!0))),G.path=R,G},r.parseHost=function(R,G){R||(R=""),R=R.replace(/\\/g,"/");var I=R.indexOf("/"),w,M;if(I===-1&&(I=R.length),R.charAt(0)==="[")w=R.indexOf("]"),G.hostname=R.substring(1,w)||null,G.port=R.substring(w+2,I)||null,G.port==="/"&&(G.port=null);else{var O=R.indexOf(":"),k=R.indexOf("/"),B=R.indexOf(":",O+1);B!==-1&&(k===-1||B<k)?(G.hostname=R.substring(0,I)||null,G.port=null):(M=R.substring(0,I).split(":"),G.hostname=M[0]||null,G.port=M[1]||null)}return G.hostname&&R.substring(I).charAt(0)!=="/"&&(I++,R="/"+R),G.preventInvalidHostname&&r.ensureValidHostname(G.hostname,G.protocol),G.port&&r.ensureValidPort(G.port),R.substring(I)||"/"},r.parseAuthority=function(R,G){return R=r.parseUserinfo(R,G),r.parseHost(R,G)},r.parseUserinfo=function(R,G){var I=R,w=R.indexOf("\\");w!==-1&&(R=R.replace(/\\/g,"/"));var M=R.indexOf("/"),O=R.lastIndexOf("@",M>-1?M:R.length-1),k;return O>-1&&(M===-1||O<M)?(k=R.substring(0,O).split(":"),G.username=k[0]?r.decode(k[0]):null,k.shift(),G.password=k[0]?r.decode(k.join(":")):null,R=I.substring(O+1)):(G.username=null,G.password=null),R},r.parseQuery=function(R,G){if(!R)return{};if(R=R.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!R)return{};for(var I={},w=R.split("&"),M=w.length,O,k,B,N=0;N<M;N++)O=w[N].split("="),k=r.decodeQuery(O.shift(),G),B=O.length?r.decodeQuery(O.join("="),G):null,k!=="__proto__"&&(c.call(I,k)?((typeof I[k]=="string"||I[k]===null)&&(I[k]=[I[k]]),I[k].push(B)):I[k]=B);return I},r.build=function(R){var G="",I=!1;return R.protocol&&(G+=R.protocol+":"),!R.urn&&(G||R.hostname)&&(G+="//",I=!0),G+=r.buildAuthority(R)||"",typeof R.path=="string"&&(R.path.charAt(0)!=="/"&&I&&(G+="/"),G+=R.path),typeof R.query=="string"&&R.query&&(G+="?"+R.query),typeof R.fragment=="string"&&R.fragment&&(G+="#"+R.fragment),G},r.buildHost=function(R){var G="";if(R.hostname)r.ip6_expression.test(R.hostname)?G+="["+R.hostname+"]":G+=R.hostname;else return"";return R.port&&(G+=":"+R.port),G},r.buildAuthority=function(R){return r.buildUserinfo(R)+r.buildHost(R)},r.buildUserinfo=function(R){var G="";return R.username&&(G+=r.encode(R.username)),R.password&&(G+=":"+r.encode(R.password)),G&&(G+="@"),G},r.buildQuery=function(R,G,I){var w="",M,O,k,B;for(O in R)if(O!=="__proto__"&&c.call(R,O))if(h(R[O]))for(M={},k=0,B=R[O].length;k<B;k++)R[O][k]!==void 0&&M[R[O][k]+""]===void 0&&(w+="&"+r.buildQueryParameter(O,R[O][k],I),G!==!0&&(M[R[O][k]+""]=!0));else R[O]!==void 0&&(w+="&"+r.buildQueryParameter(O,R[O],I));return w.substring(1)},r.buildQueryParameter=function(R,G,I){return r.encodeQuery(R,I)+(G!==null?"="+r.encodeQuery(G,I):"")},r.addQuery=function(R,G,I){if(typeof G=="object")for(var w in G)c.call(G,w)&&r.addQuery(R,w,G[w]);else if(typeof G=="string"){if(R[G]===void 0){R[G]=I;return}else typeof R[G]=="string"&&(R[G]=[R[G]]);h(I)||(I=[I]),R[G]=(R[G]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(R,G,I){if(typeof G=="object")for(var w in G)c.call(G,w)&&r.setQuery(R,w,G[w]);else if(typeof G=="string")R[G]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(R,G,I){var w,M,O;if(h(G))for(w=0,M=G.length;w<M;w++)R[G[w]]=void 0;else if(u(G)==="RegExp")for(O in R)G.test(O)&&(R[O]=void 0);else if(typeof G=="object")for(O in G)c.call(G,O)&&r.removeQuery(R,O,G[O]);else if(typeof G=="string")I!==void 0?u(I)==="RegExp"?!h(R[G])&&I.test(R[G])?R[G]=void 0:R[G]=p(R[G],I):R[G]===String(I)&&(!h(I)||I.length===1)?R[G]=void 0:h(R[G])&&(R[G]=p(R[G],I)):R[G]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(R,G,I,w){switch(u(G)){case"String":break;case"RegExp":for(var M in R)if(c.call(R,M)&&G.test(M)&&(I===void 0||r.hasQuery(R,M,I)))return!0;return!1;case"Object":for(var O in G)if(c.call(G,O)&&!r.hasQuery(R,O,G[O]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(I)){case"Undefined":return G in R;case"Boolean":var k=!!(h(R[G])?R[G].length:R[G]);return I===k;case"Function":return!!I(R[G],G,R);case"Array":if(!h(R[G]))return!1;var B=w?g:f;return B(R[G],I);case"RegExp":return h(R[G])?w?g(R[G],I):!1:!!(R[G]&&R[G].match(I));case"Number":I=String(I);case"String":return h(R[G])?w?g(R[G],I):!1:R[G]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var R=[],G=[],I=0,w=0;w<arguments.length;w++){var M=new r(arguments[w]);R.push(M);for(var O=M.segment(),k=0;k<O.length;k++)typeof O[k]=="string"&&G.push(O[k]),O[k]&&I++}if(!G.length||!I)return new r("");var B=new r("").segment(G);return(R[0].path()===""||R[0].path().slice(0,1)==="/")&&B.path("/"+B.path()),B.normalize()},r.commonPath=function(R,G){var I=Math.min(R.length,G.length),w;for(w=0;w<I;w++)if(R.charAt(w)!==G.charAt(w)){w--;break}return w<1?R.charAt(0)===G.charAt(0)&&R.charAt(0)==="/"?"/":"":((R.charAt(w)!=="/"||G.charAt(w)!=="/")&&(w=R.substring(0,w).lastIndexOf("/")),R.substring(0,w+1))},r.withinString=function(R,G,I){I||(I={});var w=I.start||r.findUri.start,M=I.end||r.findUri.end,O=I.trim||r.findUri.trim,k=I.parens||r.findUri.parens,B=/[a-z0-9-]=["']?$/i;for(w.lastIndex=0;;){var N=w.exec(R);if(!N)break;var z=N.index;if(I.ignoreHtml){var K=R.slice(Math.max(z-3,0),z);if(K&&B.test(K))continue}for(var te=z+R.slice(z).search(M),H=R.slice(z,te),j=-1;;){var ee=k.exec(H);if(!ee)break;var pe=ee.index+ee[0].length;j=Math.max(j,pe)}if(j>-1?H=H.slice(0,j)+H.slice(j).replace(O,""):H=H.replace(O,""),!(H.length<=N[0].length)&&!(I.ignore&&I.ignore.test(H))){te=z+H.length;var _e=G(H,z,te,R);if(_e===void 0){w.lastIndex=te;continue}_e=String(_e),R=R.slice(0,z)+_e+R.slice(te),w.lastIndex=z+_e.length}}return w.lastIndex=0,R},r.ensureValidHostname=function(R,G){var I=!!R,w=!!G,M=!1;if(w&&(M=g(r.hostProtocols,G)),M&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+G);if(R&&R.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(R).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(R){if(R){var G=Number(R);if(!(s(G)&&G>0&&G<65536))throw new TypeError('Port "'+R+'" is not a valid port')}},r.noConflict=function(R){if(R){var G={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(G.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(G.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(G.SecondLevelDomains=i.SecondLevelDomains.noConflict()),G}else i.URI===this&&(i.URI=o);return this},a.build=function(R){return R===!0?this._deferred_build=!0:(R===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function E(R){return function(G,I){return G===void 0?this._parts[R]||"":(this._parts[R]=G||null,this.build(!I),this)}}function P(R,G){return function(I,w){return I===void 0?this._parts[R]||"":(I!==null&&(I=I+"",I.charAt(0)===G&&(I=I.substring(1))),this._parts[R]=I,this.build(!w),this)}}a.protocol=E("protocol"),a.username=E("username"),a.password=E("password"),a.hostname=E("hostname"),a.port=E("port"),a.query=P("query","?"),a.fragment=P("fragment","#"),a.search=function(R,G){var I=this.query(R,G);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(R,G){var I=this.fragment(R,G);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(R,G){if(R===void 0||R===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return R?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=R?r.recodeUrnPath(R):"":this._parts.path=R?r.recodePath(R):"/",this.build(!G),this},a.path=a.pathname,a.href=function(R,G){var I;if(R===void 0)return this.toString();this._string="",this._parts=r._parts();var w=R instanceof r,M=typeof R=="object"&&(R.hostname||R.path||R.pathname);if(R.nodeName){var O=r.getDomAttribute(R);R=R[O]||"",M=!1}if(!w&&M&&R.pathname!==void 0&&(R=R.toString()),typeof R=="string"||R instanceof String)this._parts=r.parse(String(R),this._parts);else if(w||M){var k=w?R._parts:R;for(I in k)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=k[I]);k.query&&this.query(k.query,!1)}else throw new TypeError("invalid input");return this.build(!G),this},a.is=function(R){var G=!1,I=!1,w=!1,M=!1,O=!1,k=!1,B=!1,N=!this._parts.urn;switch(this._parts.hostname&&(N=!1,I=r.ip4_expression.test(this._parts.hostname),w=r.ip6_expression.test(this._parts.hostname),G=I||w,M=!G,O=M&&n&&n.has(this._parts.hostname),k=M&&r.idn_expression.test(this._parts.hostname),B=M&&r.punycode_expression.test(this._parts.hostname)),R.toLowerCase()){case"relative":return N;case"absolute":return!N;case"domain":case"name":return M;case"sld":return O;case"ip":return G;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return w;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return B}return null};var W=a.protocol,v=a.port,A=a.hostname;a.protocol=function(R,G){if(R&&(R=R.replace(/:(\/\/)?$/,""),!R.match(r.protocol_expression)))throw new TypeError('Protocol "'+R+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return W.call(this,R,G)},a.scheme=a.protocol,a.port=function(R,G){return this._parts.urn?R===void 0?"":this:(R!==void 0&&(R===0&&(R=null),R&&(R+="",R.charAt(0)===":"&&(R=R.substring(1)),r.ensureValidPort(R))),v.call(this,R,G))},a.hostname=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},w=r.parseHost(R,I);if(w!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');R=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(R,this._parts.protocol)}return A.call(this,R,G)},a.origin=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var I=this.protocol(),w=this.authority();return w?(I?I+"://":"")+this.authority():""}else{var M=r(R);return this.protocol(M.protocol()).authority(M.authority()).build(!G),this}},a.host=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(R,this._parts);if(I!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!G),this},a.authority=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(R,this._parts);if(I!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!G),this},a.userinfo=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return R[R.length-1]!=="@"&&(R+="@"),r.parseUserinfo(R,this._parts),this.build(!G),this},a.resource=function(R,G){var I;return R===void 0?this.path()+this.search()+this.hash():(I=r.parse(R),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!G),this)},a.subdomain=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var w=this._parts.hostname.length-this.domain().length,M=this._parts.hostname.substring(0,w),O=new RegExp("^"+d(M));if(R&&R.charAt(R.length-1)!=="."&&(R+="."),R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return R&&r.ensureValidHostname(R,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(O,R),this.build(!G),this}},a.domain=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(G=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var w=this._parts.hostname.length-this.tld(G).length-1;return w=this._parts.hostname.lastIndexOf(".",w-1)+1,this._parts.hostname.substring(w)||""}else{if(!R)throw new TypeError("cannot set domain empty");if(R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(R,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=R;else{var M=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(M,R)}return this.build(!G),this}},a.tld=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(G=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),w=this._parts.hostname.substring(I+1);return G!==!0&&n&&n.list[w.toLowerCase()]&&n.get(this._parts.hostname)||w}else{var M;if(R)if(R.match(/[^a-zA-Z0-9-]/))if(n&&n.is(R))M=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(M,R);else throw new TypeError('TLD "'+R+'" 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");M=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(M,R)}else throw new TypeError("cannot set TLD empty");return this.build(!G),this}},a.directory=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,w=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return R?r.decodePath(w):w}else{var M=this._parts.path.length-this.filename().length,O=this._parts.path.substring(0,M),k=new RegExp("^"+d(O));return this.is("relative")||(R||(R="/"),R.charAt(0)!=="/"&&(R="/"+R)),R&&R.charAt(R.length-1)!=="/"&&(R+="/"),R=r.recodePath(R),this._parts.path=this._parts.path.replace(k,R),this.build(!G),this}},a.filename=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(typeof R!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),w=this._parts.path.substring(I+1);return R?r.decodePathSegment(w):w}else{var M=!1;R.charAt(0)==="/"&&(R=R.substring(1)),R.match(/\.?\//)&&(M=!0);var O=new RegExp(d(this.filename())+"$");return R=r.recodePath(R),this._parts.path=this._parts.path.replace(O,R),M?this.normalizePath(G):this.build(!G),this}},a.suffix=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),w=I.lastIndexOf("."),M,O;return w===-1?"":(M=I.substring(w+1),O=/^[a-z0-9%]+$/i.test(M)?M:"",R?r.decodePathSegment(O):O)}else{R.charAt(0)==="."&&(R=R.substring(1));var k=this.suffix(),B;if(k)R?B=new RegExp(d(k)+"$"):B=new RegExp(d("."+k)+"$");else{if(!R)return this;this._parts.path+="."+r.recodePath(R)}return B&&(R=r.recodePath(R),this._parts.path=this._parts.path.replace(B,R)),this.build(!G),this}},a.segment=function(R,G,I){var w=this._parts.urn?":":"/",M=this.path(),O=M.substring(0,1)==="/",k=M.split(w);if(R!==void 0&&typeof R!="number"&&(I=G,G=R,R=void 0),R!==void 0&&typeof R!="number")throw new Error('Bad segment "'+R+'", must be 0-based integer');if(O&&k.shift(),R<0&&(R=Math.max(k.length+R,0)),G===void 0)return R===void 0?k:k[R];if(R===null||k[R]===void 0)if(h(G)){k=[];for(var B=0,N=G.length;B<N;B++)!G[B].length&&(!k.length||!k[k.length-1].length)||(k.length&&!k[k.length-1].length&&k.pop(),k.push(y(G[B])))}else(G||typeof G=="string")&&(G=y(G),k[k.length-1]===""?k[k.length-1]=G:k.push(G));else G?k[R]=y(G):k.splice(R,1);return O&&k.unshift(""),this.path(k.join(w),I)},a.segmentCoded=function(R,G,I){var w,M,O;if(typeof R!="number"&&(I=G,G=R,R=void 0),G===void 0){if(w=this.segment(R,G,I),!h(w))w=w!==void 0?r.decode(w):void 0;else for(M=0,O=w.length;M<O;M++)w[M]=r.decode(w[M]);return w}if(!h(G))G=typeof G=="string"||G instanceof String?r.encode(G):G;else for(M=0,O=G.length;M<O;M++)G[M]=r.encode(G[M]);return this.segment(R,G,I)};var b=a.query;return a.query=function(R,G){if(R===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof R=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),w=R.call(this,I);return this._parts.query=r.buildQuery(w||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!G),this}else return R!==void 0&&typeof R!="string"?(this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!G),this):b.call(this,R,G)},a.setQuery=function(R,G,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof R=="string"||R instanceof String)w[R]=G!==void 0?G:null;else if(typeof R=="object")for(var M in R)c.call(R,M)&&(w[M]=R[M]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(I=G),this.build(!I),this},a.addQuery=function(R,G,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(w,R,G===void 0?null:G),this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(I=G),this.build(!I),this},a.removeQuery=function(R,G,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(w,R,G),this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(I=G),this.build(!I),this},a.hasQuery=function(R,G,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(w,R,G,I)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(R){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!R)),this},a.normalizeHostname=function(R){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(!R)),this},a.normalizePort=function(R){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!R)),this},a.normalizePath=function(R){var G=this._parts.path;if(!G)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!R),this;if(this._parts.path==="/")return this;G=r.recodePath(G);var I,w="",M,O;for(G.charAt(0)!=="/"&&(I=!0,G="/"+G),(G.slice(-3)==="/.."||G.slice(-2)==="/.")&&(G+="/"),G=G.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(w=G.substring(1).match(/^(\.\.\/)+/)||"",w&&(w=w[0]));M=G.search(/\/\.\.(\/|$)/),M!==-1;){if(M===0){G=G.substring(3);continue}O=G.substring(0,M).lastIndexOf("/"),O===-1&&(O=M),G=G.substring(0,O)+G.substring(M+3)}return I&&this.is("relative")&&(G=w+G.substring(1)),this._parts.path=G,this.build(!R),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(R){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(!R)),this},a.normalizeFragment=function(R){return this._parts.fragment||(this._parts.fragment=null,this.build(!R)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var R=r.encode,G=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=R,r.decode=G}return this},a.unicode=function(){var R=r.encode,G=r.decode;r.encode=S,r.decode=unescape;try{this.normalize()}finally{r.encode=R,r.decode=G}return this},a.readable=function(){var R=this.clone();R.username("").password("").normalize();var G="";if(R._parts.protocol&&(G+=R._parts.protocol+"://"),R._parts.hostname&&(R.is("punycode")&&e?(G+=e.toUnicode(R._parts.hostname),R._parts.port&&(G+=":"+R._parts.port)):G+=R.host()),R._parts.hostname&&R._parts.path&&R._parts.path.charAt(0)!=="/"&&(G+="/"),G+=R.path(!0),R._parts.query){for(var I="",w=0,M=R._parts.query.split("&"),O=M.length;w<O;w++){var k=(M[w]||"").split("=");I+="&"+r.decodeQuery(k[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),k[1]!==void 0&&(I+="="+r.decodeQuery(k[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}G+="?"+I.substring(1)}return G+=r.decodeQuery(R.hash(),!0),G},a.absoluteTo=function(R){var G=this.clone(),I=["protocol","username","password","hostname","port"],w,M,O;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(R instanceof r||(R=new r(R)),G._parts.protocol||(G._parts.protocol=R._parts.protocol,this._parts.hostname))return G;for(M=0;O=I[M];M++)G._parts[O]=R._parts[O];return G._parts.path?(G._parts.path.substring(-2)===".."&&(G._parts.path+="/"),G.path().charAt(0)!=="/"&&(w=R.directory(),w=w||(R.path().indexOf("/")===0?"/":""),G._parts.path=(w?w+"/":"")+G._parts.path,G.normalizePath())):(G._parts.path=R._parts.path,G._parts.query||(G._parts.query=R._parts.query)),G.build(),G},a.relativeTo=function(R){var G=this.clone().normalize(),I,w,M,O,k;if(G._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(R=new r(R).normalize(),I=G._parts,w=R._parts,O=G.path(),k=R.path(),O.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(I.protocol===w.protocol&&(I.protocol=null),I.username!==w.username||I.password!==w.password||I.protocol!==null||I.username!==null||I.password!==null)return G.build();if(I.hostname===w.hostname&&I.port===w.port)I.hostname=null,I.port=null;else return G.build();if(O===k)return I.path="",G.build();if(M=r.commonPath(O,k),!M)return G.build();var B=w.path.substring(M.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=B+I.path.substring(M.length)||"./",G.build()},a.equals=function(R){var G=this.clone(),I=new r(R),w={},M={},O={},k,B,N;if(G.normalize(),I.normalize(),G.toString()===I.toString())return!0;if(k=G.query(),B=I.query(),G.query(""),I.query(""),G.toString()!==I.toString()||k.length!==B.length)return!1;w=r.parseQuery(k,this._parts.escapeQuerySpace),M=r.parseQuery(B,this._parts.escapeQuerySpace);for(N in w)if(c.call(w,N)){if(h(w[N])){if(!f(w[N],M[N]))return!1}else if(w[N]!==M[N])return!1;O[N]=!0}for(N in M)if(c.call(M,N)&&!O[N])return!1;return!0},a.preventInvalidHostname=function(R){return this._parts.preventInvalidHostname=!!R,this},a.duplicateQueryParameters=function(R){return this._parts.duplicateQueryParameters=!!R,this},a.escapeQuerySpace=function(R){return this._parts.escapeQuerySpace=!!R,this},r})});var Qz=ad((exports,module)=>{var Fen=_(T());/*!
|
|
|
* protobuf.js v7.4.0 (c) 2016, daniel wirtz
|
|
|
* compiled thu, 22 aug 2024 20:30:39 utc
|
|
|
* licensed under the bsd-3-clause license
|
|
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
|
*/(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,d=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(h,p){s[a]=function(f){if(d)if(d=!1,f)p(f);else{for(var y=new Array(arguments.length-1),x=0;x<y.length;)y[x++]=arguments[x];h.apply(null,y)}};try{o.apply(r||null,s)}catch(g){d&&(d=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(d){var u=d.length;if(!u)return 0;for(var h=0;--u%4>1&&d.charAt(u)==="=";)++h;return Math.ceil(d.length*3)/4-h};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(d,u,h){for(var p=null,g=[],f=0,y=0,x;u<h;){var S=d[u++];switch(y){case 0:g[f++]=o[S>>2],x=(S&3)<<4,y=1;break;case 1:g[f++]=o[x|S>>4],x=(S&15)<<2,y=2;break;case 2:g[f++]=o[x|S>>6],g[f++]=o[S&63],y=0;break}f>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),f=0)}return y&&(g[f++]=o[x],g[f++]=61,y===1&&(g[f++]=61)),p?(f&&p.push(String.fromCharCode.apply(String,g.slice(0,f))),p.join("")):String.fromCharCode.apply(String,g.slice(0,f))};var a="invalid encoding";i.decode=function(d,u,h){for(var p=h,g=0,f,y=0;y<d.length;){var x=d.charCodeAt(y++);if(x===61&&g>1)break;if((x=r[x])===undefined)throw Error(a);switch(g){case 0:f=x,g=1;break;case 1:u[h++]=f<<2|(x&48)>>4,f=x,g=2;break;case 2:u[h++]=(f&15)<<4|(x&60)>>2,f=x,g=3;break;case 3:u[h++]=(f&3)<<6|x,g=0;break}}if(g===1)throw Error(a);return h-p},i.test=function(d){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(d)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var d=new Float32Array([-0]),u=new Uint8Array(d.buffer),h=u[3]===128;function p(x,S,C){d[0]=x,S[C]=u[0],S[C+1]=u[1],S[C+2]=u[2],S[C+3]=u[3]}function g(x,S,C){d[0]=x,S[C]=u[3],S[C+1]=u[2],S[C+2]=u[1],S[C+3]=u[0]}c.writeFloatLE=h?p:g,c.writeFloatBE=h?g:p;function f(x,S){return u[0]=x[S],u[1]=x[S+1],u[2]=x[S+2],u[3]=x[S+3],d[0]}function y(x,S){return u[3]=x[S],u[2]=x[S+1],u[1]=x[S+2],u[0]=x[S+3],d[0]}c.readFloatLE=h?f:y,c.readFloatBE=h?y:f}():function(){function d(h,p,g,f){var y=p<0?1:0;if(y&&(p=-p),p===0)h(1/p>0?0:2147483648,g,f);else if(isNaN(p))h(2143289344,g,f);else if(p>34028234663852886e22)h((y<<31|2139095040)>>>0,g,f);else if(p<11754943508222875e-54)h((y<<31|Math.round(p/1401298464324817e-60))>>>0,g,f);else{var x=Math.floor(Math.log(p)/Math.LN2),S=Math.round(p*Math.pow(2,-x)*8388608)&8388607;h((y<<31|x+127<<23|S)>>>0,g,f)}}c.writeFloatLE=d.bind(null,o),c.writeFloatBE=d.bind(null,r);function u(h,p,g){var f=h(p,g),y=(f>>31)*2+1,x=f>>>23&255,S=f&8388607;return x===255?S?NaN:y*(1/0):x===0?y*1401298464324817e-60*S:y*Math.pow(2,x-150)*(S+8388608)}c.readFloatLE=u.bind(null,s),c.readFloatBE=u.bind(null,a)}(),typeof Float64Array<"u"?function(){var d=new Float64Array([-0]),u=new Uint8Array(d.buffer),h=u[7]===128;function p(x,S,C){d[0]=x,S[C]=u[0],S[C+1]=u[1],S[C+2]=u[2],S[C+3]=u[3],S[C+4]=u[4],S[C+5]=u[5],S[C+6]=u[6],S[C+7]=u[7]}function g(x,S,C){d[0]=x,S[C]=u[7],S[C+1]=u[6],S[C+2]=u[5],S[C+3]=u[4],S[C+4]=u[3],S[C+5]=u[2],S[C+6]=u[1],S[C+7]=u[0]}c.writeDoubleLE=h?p:g,c.writeDoubleBE=h?g:p;function f(x,S){return u[0]=x[S],u[1]=x[S+1],u[2]=x[S+2],u[3]=x[S+3],u[4]=x[S+4],u[5]=x[S+5],u[6]=x[S+6],u[7]=x[S+7],d[0]}function y(x,S){return u[7]=x[S],u[6]=x[S+1],u[5]=x[S+2],u[4]=x[S+3],u[3]=x[S+4],u[2]=x[S+5],u[1]=x[S+6],u[0]=x[S+7],d[0]}c.readDoubleLE=h?f:y,c.readDoubleBE=h?y:f}():function(){function d(h,p,g,f,y,x){var S=f<0?1:0;if(S&&(f=-f),f===0)h(0,y,x+p),h(1/f>0?0:2147483648,y,x+g);else if(isNaN(f))h(0,y,x+p),h(2146959360,y,x+g);else if(f>17976931348623157e292)h(0,y,x+p),h((S<<31|2146435072)>>>0,y,x+g);else{var C;if(f<22250738585072014e-324)C=f/5e-324,h(C>>>0,y,x+p),h((S<<31|C/4294967296)>>>0,y,x+g);else{var V=Math.floor(Math.log(f)/Math.LN2);V===1024&&(V=1023),C=f*Math.pow(2,-V),h(C*4503599627370496>>>0,y,x+p),h((S<<31|V+1023<<20|C*1048576&1048575)>>>0,y,x+g)}}}c.writeDoubleLE=d.bind(null,o,0,4),c.writeDoubleBE=d.bind(null,r,4,0);function u(h,p,g,f,y){var x=h(f,y+p),S=h(f,y+g),C=(S>>31)*2+1,V=S>>>20&2047,L=4294967296*(S&1048575)+x;return V===2047?L?NaN:C*(1/0):V===0?C*5e-324*L:C*Math.pow(2,V-1075)*(L+4503599627370496)}c.readDoubleLE=u.bind(null,s,0,4),c.readDoubleBE=u.bind(null,a,4,0)}(),c}function o(c,d,u){d[u]=c&255,d[u+1]=c>>>8&255,d[u+2]=c>>>16&255,d[u+3]=c>>>24}function r(c,d,u){d[u]=c>>>24,d[u+1]=c>>>16&255,d[u+2]=c>>>8&255,d[u+3]=c&255}function s(c,d){return(c[d]|c[d+1]<<8|c[d+2]<<16|c[d+3]<<24)>>>0}function a(c,d){return(c[d]<<24|c[d+1]<<16|c[d+2]<<8|c[d+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,d=null,u=a;return function(p){if(p<1||p>c)return o(p);u+p>a&&(d=o(a),u=0);var g=r.call(d,u,u+=p);return u&7&&(u=(u|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var d=null,u=[],h=0,p;s<a;)p=r[s++],p<128?u[h++]=p:p>191&&p<224?u[h++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,u[h++]=55296+(p>>10),u[h++]=56320+(p&1023)):u[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,u)),h=0);return d?(h&&d.push(String.fromCharCode.apply(String,u.slice(0,h))),d.join("")):String.fromCharCode.apply(String,u.slice(0,h))},i.write=function(r,s,a){for(var c=a,d,u,h=0;h<r.length;++h)d=r.charCodeAt(h),d<128?s[a++]=d:d<2048?(s[a++]=d>>6|192,s[a++]=d&63|128):(d&64512)===55296&&((u=r.charCodeAt(h+1))&64512)===56320?(d=65536+((d&1023)<<10)+(u&1023),++h,s[a++]=d>>18|240,s[a++]=d>>12&63|128,s[a++]=d>>6&63|128,s[a++]=d&63|128):(s[a++]=d>>12|224,s[a++]=d>>6&63|128,s[a++]=d&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(f,y){return RangeError("index out of range: "+f.pos+" + "+(y||1)+" > "+f.len)}function c(f){this.buf=f,this.pos=0,this.len=f.length}var d=typeof Uint8Array<"u"?function(y){if(y instanceof Uint8Array||Array.isArray(y))return new c(y);throw Error("illegal buffer")}:function(y){if(Array.isArray(y))return new c(y);throw Error("illegal buffer")},u=function(){return i.Buffer?function(x){return(c.create=function(C){return i.Buffer.isBuffer(C)?new o(C):d(C)})(x)}:d};c.create=u(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var y=4294967295;return function(){if(y=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(y=(y|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return y;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return y}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var y=this.uint32();return y>>>1^-(y&1)|0};function h(){var f=new r(0,0),y=0;if(this.len-this.pos>4){for(;y<4;++y)if(f.lo=(f.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return f;if(f.lo=(f.lo|(this.buf[this.pos]&127)<<28)>>>0,f.hi=(f.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return f;y=0}else{for(;y<3;++y){if(this.pos>=this.len)throw a(this);if(f.lo=(f.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return f}return f.lo=(f.lo|(this.buf[this.pos++]&127)<<y*7)>>>0,f}if(this.len-this.pos>4){for(;y<5;++y)if(f.hi=(f.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return f}else for(;y<5;++y){if(this.pos>=this.len)throw a(this);if(f.hi=(f.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return f}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(f,y){return(f[y-4]|f[y-3]<<8|f[y-2]<<16|f[y-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var y=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,y},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var y=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,y},c.prototype.bytes=function(){var y=this.uint32(),x=this.pos,S=this.pos+y;if(S>this.len)throw a(this,y);if(this.pos+=y,Array.isArray(this.buf))return this.buf.slice(x,S);if(x===S){var C=i.Buffer;return C?C.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,x,S)},c.prototype.string=function(){var y=this.bytes();return s.read(y,0,y.length)},c.prototype.skip=function(y){if(typeof y=="number"){if(this.pos+y>this.len)throw a(this,y);this.pos+=y}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(f){switch(f){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(f=this.uint32()&7)!==4;)this.skipType(f);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+f+" at offset "+this.pos)}return this},c._configure=function(f){o=f,c.create=u(),o._configure();var y=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[y](!1)},uint64:function(){return h.call(this)[y](!0)},sint64:function(){return h.call(this).zzDecode()[y](!1)},fixed64:function(){return g.call(this)[y](!0)},sfixed64:function(){return g.call(this)[y](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,d,u){if(!d)throw TypeError("request must be specified");var h=this;if(!u)return i.asPromise(r,h,s,a,c,d);if(!h.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(g,f){if(g)return h.emit("error",g,s),u(g);if(f===null)return h.end(!0),undefined;if(!(f instanceof c))try{f=c[h.responseDelimited?"decodeDelimited":"decode"](f)}catch(y){return h.emit("error",y,s),u(y)}return h.emit("data",f,s),u(null,f)})}catch(p){return h.emit("error",p,s),setTimeout(function(){u(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,d){this.lo=c>>>0,this.hi=d>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(d){if(d===0)return r;var u=d<0;u&&(d=-d);var h=d>>>0,p=(d-h)/4294967296>>>0;return u&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(d){if(typeof d=="number")return o.fromNumber(d);if(i.isString(d))if(i.Long)d=i.Long.fromString(d);else return o.fromNumber(parseInt(d,10));return d.low||d.high?new o(d.low>>>0,d.high>>>0):r},o.prototype.toNumber=function(d){if(!d&&this.hi>>>31){var u=~this.lo+1>>>0,h=~this.hi>>>0;return u||(h=h+1>>>0),-(u+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(d){return i.Long?new i.Long(this.lo|0,this.hi|0,!!d):{low:this.lo|0,high:this.hi|0,unsigned:!!d}};var a=String.prototype.charCodeAt;o.fromHash=function(d){return d===s?r:new o((a.call(d,0)|a.call(d,1)<<8|a.call(d,2)<<16|a.call(d,3)<<24)>>>0,(a.call(d,4)|a.call(d,5)<<8|a.call(d,6)<<16|a.call(d,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var d=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^d)>>>0,this.lo=(this.lo<<1^d)>>>0,this},o.prototype.zzDecode=function(){var d=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^d)>>>0,this.hi=(this.hi>>>1^d)>>>0,this},o.prototype.length=function(){var d=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?u===0?d<16384?d<128?1:2:d<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:h<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var d=a[c];return d!=null&&a.hasOwnProperty(c)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var d=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(d.lo,d.hi,c):d.toNumber(!!c)};function o(s,a,c){for(var d=Object.keys(a),u=0;u<d.length;++u)(s[d[u]]===undefined||!c)&&(s[d[u]]=a[d[u]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,d){if(!(this instanceof a))return new a(c,d);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&o(this,d)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},d=0;d<a.length;++d)c[a[d]]=1;return function(){for(var u=Object.keys(this),h=u.length-1;h>-1;--h)if(c[u[h]]===1&&this[u[h]]!==undefined&&this[u[h]]!==null)return u[h]}},i.oneOfSetter=function(a){return function(c){for(var d=0;d<a.length;++d)a[d]!==c&&delete this[a[d]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,d){return new s(c,d)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=h;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(V,L,Z){this.fn=V,this.len=L,this.next=undefined,this.val=Z}function d(){}function u(V){this.head=V.head,this.tail=V.tail,this.len=V.len,this.next=V.states}function h(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(h.create=function(){return new o})()}:function(){return new h}};h.create=p(),h.alloc=function(L){return new i.Array(L)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(L,Z,E){return this.tail=this.tail.next=new c(L,Z,E),this.len+=Z,this};function g(V,L,Z){L[Z]=V&255}function f(V,L,Z){for(;V>127;)L[Z++]=V&127|128,V>>>=7;L[Z]=V}function y(V,L){this.len=V,this.next=undefined,this.val=L}y.prototype=Object.create(c.prototype),y.prototype.fn=f,h.prototype.uint32=function(L){return this.len+=(this.tail=this.tail.next=new y((L=L>>>0)<128?1:L<16384?2:L<2097152?3:L<268435456?4:5,L)).len,this},h.prototype.int32=function(L){return L<0?this._push(x,10,r.fromNumber(L)):this.uint32(L)},h.prototype.sint32=function(L){return this.uint32((L<<1^L>>31)>>>0)};function x(V,L,Z){for(;V.hi;)L[Z++]=V.lo&127|128,V.lo=(V.lo>>>7|V.hi<<25)>>>0,V.hi>>>=7;for(;V.lo>127;)L[Z++]=V.lo&127|128,V.lo=V.lo>>>7;L[Z++]=V.lo}h.prototype.uint64=function(L){var Z=r.from(L);return this._push(x,Z.length(),Z)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(L){var Z=r.from(L).zzEncode();return this._push(x,Z.length(),Z)},h.prototype.bool=function(L){return this._push(g,1,L?1:0)};function S(V,L,Z){L[Z]=V&255,L[Z+1]=V>>>8&255,L[Z+2]=V>>>16&255,L[Z+3]=V>>>24}h.prototype.fixed32=function(L){return this._push(S,4,L>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(L){var Z=r.from(L);return this._push(S,4,Z.lo)._push(S,4,Z.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(L){return this._push(i.float.writeFloatLE,4,L)},h.prototype.double=function(L){return this._push(i.float.writeDoubleLE,8,L)};var C=i.Array.prototype.set?function(L,Z,E){Z.set(L,E)}:function(L,Z,E){for(var P=0;P<L.length;++P)Z[E+P]=L[P]};h.prototype.bytes=function(L){var Z=L.length>>>0;if(!Z)return this._push(g,1,0);if(i.isString(L)){var E=h.alloc(Z=s.length(L));s.decode(L,E,0),L=E}return this.uint32(Z)._push(C,Z,L)},h.prototype.string=function(L){var Z=a.length(L);return Z?this.uint32(Z)._push(a.write,Z,L):this._push(g,1,0)},h.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(d,0,0),this.len=0),this},h.prototype.ldelim=function(){var L=this.head,Z=this.tail,E=this.len;return this.reset().uint32(E),E&&(this.tail.next=L.next,this.tail=Z,this.len+=E),this},h.prototype.finish=function(){for(var L=this.head.next,Z=this.constructor.alloc(this.len),E=0;L;)L.fn(L.val,Z,E),E+=L.len,L=L.next;return Z},h._configure=function(V){o=V,h.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,d,u){d.set(c,u)}:function(c,d,u){if(c.copy)c.copy(d,u,0,c.length);else for(var h=0;h<c.length;)d[u++]=c[h++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var d=c.length>>>0;return this.uint32(d),d&&this._push(r.writeBytesBuffer,d,c),this};function s(a,c,d){a.length<40?o.utf8.write(a,c,d):c.utf8Write?c.utf8Write(a,d):c.write(a,d)}r.prototype.string=function(c){var d=o.Buffer.byteLength(c);return this.uint32(d),d&&this._push(s,d,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var Ose=ad((MH,NH)=>{var Kan=_(T());(function(e,t){typeof MH=="object"&&typeof NH<"u"?NH.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(MH,function(){"use strict";function e(x,S,C,V,L){(function Z(E,P,W,v,A){for(;v>W;){if(v-W>600){var b=v-W+1,R=P-W+1,G=Math.log(b),I=.5*Math.exp(2*G/3),w=.5*Math.sqrt(G*I*(b-I)/b)*(R-b/2<0?-1:1),M=Math.max(W,Math.floor(P-R*I/b+w)),O=Math.min(v,Math.floor(P+(b-R)*I/b+w));Z(E,P,M,O,A)}var k=E[P],B=W,N=v;for(t(E,W,P),A(E[v],k)>0&&t(E,W,v);B<N;){for(t(E,B,N),B++,N--;A(E[B],k)<0;)B++;for(;A(E[N],k)>0;)N--}A(E[W],k)===0?t(E,W,N):t(E,++N,v),N<=P&&(W=N+1),P<=N&&(v=N-1)}})(x,S,C||0,V||x.length-1,L||n)}function t(x,S,C){var V=x[S];x[S]=x[C],x[C]=V}function n(x,S){return x<S?-1:x>S?1:0}var i=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(x,S,C){if(!C)return S.indexOf(x);for(var V=0;V<S.length;V++)if(C(x,S[V]))return V;return-1}function r(x,S){s(x,0,x.children.length,S,x)}function s(x,S,C,V,L){L||(L=f(null)),L.minX=1/0,L.minY=1/0,L.maxX=-1/0,L.maxY=-1/0;for(var Z=S;Z<C;Z++){var E=x.children[Z];a(L,x.leaf?V(E):E)}return L}function a(x,S){return x.minX=Math.min(x.minX,S.minX),x.minY=Math.min(x.minY,S.minY),x.maxX=Math.max(x.maxX,S.maxX),x.maxY=Math.max(x.maxY,S.maxY),x}function c(x,S){return x.minX-S.minX}function d(x,S){return x.minY-S.minY}function u(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function h(x){return x.maxX-x.minX+(x.maxY-x.minY)}function p(x,S){return x.minX<=S.minX&&x.minY<=S.minY&&S.maxX<=x.maxX&&S.maxY<=x.maxY}function g(x,S){return S.minX<=x.maxX&&S.minY<=x.maxY&&S.maxX>=x.minX&&S.maxY>=x.minY}function f(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(x,S,C,V,L){for(var Z=[S,C];Z.length;)if(!((C=Z.pop())-(S=Z.pop())<=V)){var E=S+Math.ceil((C-S)/V/2)*V;e(x,E,S,C,L),Z.push(S,E,E,C)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(x){var S=this.data,C=[];if(!g(x,S))return C;for(var V=this.toBBox,L=[];S;){for(var Z=0;Z<S.children.length;Z++){var E=S.children[Z],P=S.leaf?V(E):E;g(x,P)&&(S.leaf?C.push(E):p(x,P)?this._all(E,C):L.push(E))}S=L.pop()}return C},i.prototype.collides=function(x){var S=this.data;if(!g(x,S))return!1;for(var C=[];S;){for(var V=0;V<S.children.length;V++){var L=S.children[V],Z=S.leaf?this.toBBox(L):L;if(g(x,Z)){if(S.leaf||p(x,Z))return!0;C.push(L)}}S=C.pop()}return!1},i.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var S=0;S<x.length;S++)this.insert(x[S]);return this}var C=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===C.height)this._splitRoot(this.data,C);else{if(this.data.height<C.height){var V=this.data;this.data=C,C=V}this._insert(C,this.data.height-C.height-1,!0)}else this.data=C;return this},i.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},i.prototype.clear=function(){return this.data=f([]),this},i.prototype.remove=function(x,S){if(!x)return this;for(var C,V,L,Z=this.data,E=this.toBBox(x),P=[],W=[];Z||P.length;){if(Z||(Z=P.pop(),V=P[P.length-1],C=W.pop(),L=!0),Z.leaf){var v=o(x,Z.children,S);if(v!==-1)return Z.children.splice(v,1),P.push(Z),this._condense(P),this}L||Z.leaf||!p(Z,E)?V?(C++,Z=V.children[C],L=!1):Z=null:(P.push(Z),W.push(C),C=0,V=Z,Z=Z.children[0])}return this},i.prototype.toBBox=function(x){return x},i.prototype.compareMinX=function(x,S){return x.minX-S.minX},i.prototype.compareMinY=function(x,S){return x.minY-S.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(x){return this.data=x,this},i.prototype._all=function(x,S){for(var C=[];x;)x.leaf?S.push.apply(S,x.children):C.push.apply(C,x.children),x=C.pop();return S},i.prototype._build=function(x,S,C,V){var L,Z=C-S+1,E=this._maxEntries;if(Z<=E)return r(L=f(x.slice(S,C+1)),this.toBBox),L;V||(V=Math.ceil(Math.log(Z)/Math.log(E)),E=Math.ceil(Z/Math.pow(E,V-1))),(L=f([])).leaf=!1,L.height=V;var P=Math.ceil(Z/E),W=P*Math.ceil(Math.sqrt(E));y(x,S,C,W,this.compareMinX);for(var v=S;v<=C;v+=W){var A=Math.min(v+W-1,C);y(x,v,A,P,this.compareMinY);for(var b=v;b<=A;b+=P){var R=Math.min(b+P-1,A);L.children.push(this._build(x,b,R,V-1))}}return r(L,this.toBBox),L},i.prototype._chooseSubtree=function(x,S,C,V){for(;V.push(S),!S.leaf&&V.length-1!==C;){for(var L=1/0,Z=1/0,E=void 0,P=0;P<S.children.length;P++){var W=S.children[P],v=u(W),A=(b=x,R=W,(Math.max(R.maxX,b.maxX)-Math.min(R.minX,b.minX))*(Math.max(R.maxY,b.maxY)-Math.min(R.minY,b.minY))-v);A<Z?(Z=A,L=v<L?v:L,E=W):A===Z&&v<L&&(L=v,E=W)}S=E||S.children[0]}var b,R;return S},i.prototype._insert=function(x,S,C){var V=C?x:this.toBBox(x),L=[],Z=this._chooseSubtree(V,this.data,S,L);for(Z.children.push(x),a(Z,V);S>=0&&L[S].children.length>this._maxEntries;)this._split(L,S),S--;this._adjustParentBBoxes(V,L,S)},i.prototype._split=function(x,S){var C=x[S],V=C.children.length,L=this._minEntries;this._chooseSplitAxis(C,L,V);var Z=this._chooseSplitIndex(C,L,V),E=f(C.children.splice(Z,C.children.length-Z));E.height=C.height,E.leaf=C.leaf,r(C,this.toBBox),r(E,this.toBBox),S?x[S-1].children.push(E):this._splitRoot(C,E)},i.prototype._splitRoot=function(x,S){this.data=f([x,S]),this.data.height=x.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(x,S,C){for(var V,L,Z,E,P,W,v,A=1/0,b=1/0,R=S;R<=C-S;R++){var G=s(x,0,R,this.toBBox),I=s(x,R,C,this.toBBox),w=(L=G,Z=I,E=void 0,P=void 0,W=void 0,v=void 0,E=Math.max(L.minX,Z.minX),P=Math.max(L.minY,Z.minY),W=Math.min(L.maxX,Z.maxX),v=Math.min(L.maxY,Z.maxY),Math.max(0,W-E)*Math.max(0,v-P)),M=u(G)+u(I);w<A?(A=w,V=R,b=M<b?M:b):w===A&&M<b&&(b=M,V=R)}return V||C-S},i.prototype._chooseSplitAxis=function(x,S,C){var V=x.leaf?this.compareMinX:c,L=x.leaf?this.compareMinY:d;this._allDistMargin(x,S,C,V)<this._allDistMargin(x,S,C,L)&&x.children.sort(V)},i.prototype._allDistMargin=function(x,S,C,V){x.children.sort(V);for(var L=this.toBBox,Z=s(x,0,S,L),E=s(x,C-S,C,L),P=h(Z)+h(E),W=S;W<C-S;W++){var v=x.children[W];a(Z,x.leaf?L(v):v),P+=h(Z)}for(var A=C-S-1;A>=S;A--){var b=x.children[A];a(E,x.leaf?L(b):b),P+=h(E)}return P},i.prototype._adjustParentBBoxes=function(x,S,C){for(var V=C;V>=0;V--)a(S[V],x)},i.prototype._condense=function(x){for(var S=x.length-1,C=void 0;S>=0;S--)x[S].children.length===0?S>0?(C=x[S-1].children).splice(C.indexOf(x[S]),1):this.clear():r(x[S],this.toBBox)},i})});var Jme=ad((Pjn,Kme)=>{"use strict";var vjn=_(T());Kme.exports=Y8e;var z2=1e20;function Y8e(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,d,u,h,p,g,f,y;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,s=p.height,g=h.getImageData(0,0,r,s),c=g.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,s=p.height,g=h.getImageData(0,0,r,s),c=g.data,u=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(d=c,c=Array(r*s),f=0,y=Math.floor(d.length/u);f<y;f++)c[f]=d[f*u+o]/255;else if(u!==1)throw Error("Raw data can have only 1 value per pixel");var x=Array(r*s),S=Array(r*s),C=Array(a),V=Array(a),L=Array(a+1),Z=Array(a);for(f=0,y=r*s;f<y;f++){var E=c[f];x[f]=E===1?0:E===0?z2:Math.pow(Math.max(0,.5-E),2),S[f]=E===1?z2:E===0?0:Math.pow(Math.max(0,E-.5),2)}zme(x,r,s,C,V,Z,L),zme(S,r,s,C,V,Z,L);var P=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(f=0,y=r*s;f<y;f++)P[f]=Math.min(Math.max(1-((x[f]-S[f])/i+n),0),1);return P}function zme(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(Hme(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(Hme(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function Hme(e,t,n,i,o){n[0]=0,i[0]=-z2,i[1]=+z2;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+z2}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var ehe=ad(($jn,aU)=>{var e8n=_(T());function n7e(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,d=9,u=10,h=11,p=12,g=13,f=14,y=15,x=16,S=17,C=0,V=1,L=2,Z=3,E=4;function P(b,R){return 55296<=b.charCodeAt(R)&&b.charCodeAt(R)<=56319&&56320<=b.charCodeAt(R+1)&&b.charCodeAt(R+1)<=57343}function W(b,R){R===void 0&&(R=0);var G=b.charCodeAt(R);if(55296<=G&&G<=56319&&R<b.length-1){var I=G,w=b.charCodeAt(R+1);return 56320<=w&&w<=57343?(I-55296)*1024+(w-56320)+65536:I}if(56320<=G&&G<=57343&&R>=1){var I=b.charCodeAt(R-1),w=G;return 55296<=I&&I<=56319?(I-55296)*1024+(w-56320)+65536:w}return G}function v(b,R,G){var I=[b].concat(R).concat([G]),w=I[I.length-2],M=G,O=I.lastIndexOf(f);if(O>1&&I.slice(1,O).every(function(N){return N==i})&&[i,g,S].indexOf(b)==-1)return L;var k=I.lastIndexOf(o);if(k>0&&I.slice(1,k).every(function(N){return N==o})&&[p,o].indexOf(w)==-1)return I.filter(function(N){return N==o}).length%2==1?Z:E;if(w==e&&M==t)return C;if(w==n||w==e||w==t)return M==f&&R.every(function(N){return N==i})?L:V;if(M==n||M==e||M==t)return V;if(w==s&&(M==s||M==a||M==d||M==u))return C;if((w==d||w==a)&&(M==a||M==c))return C;if((w==u||w==c)&&M==c)return C;if(M==i||M==y)return C;if(M==r)return C;if(w==p)return C;var B=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,S].indexOf(I[B])!=-1&&I.slice(B+1,-1).every(function(N){return N==i})&&M==f||w==y&&[x,S].indexOf(M)!=-1?C:R.indexOf(o)!=-1?L:w==o&&M==o?C:V}this.nextBreak=function(b,R){if(R===void 0&&(R=0),R<0)return 0;if(R>=b.length-1)return b.length;for(var G=A(W(b,R)),I=[],w=R+1;w<b.length;w++)if(!P(b,w-1)){var M=A(W(b,w));if(v(G,I,M))return w;I.push(M)}return b.length},this.splitGraphemes=function(b){for(var R=[],G=0,I;(I=this.nextBreak(b,G))<b.length;)R.push(b.slice(G,I)),G=I;return G<b.length&&R.push(b.slice(G)),R},this.iterateGraphemes=function(b){var R=0,G={next:function(){var I,w;return(w=this.nextBreak(b,R))<b.length?(I=b.slice(R,w),R=w,{value:I,done:!1}):R<b.length?(I=b.slice(R),R=b.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(G[Symbol.iterator]=function(){return G}),G},this.countGraphemes=function(b){for(var R=0,G=0,I;(I=this.nextBreak(b,G))<b.length;)G=I,R++;return G<b.length&&R++,R};function A(b){return 1536<=b&&b<=1541||b==1757||b==1807||b==2274||b==3406||b==69821||70082<=b&&b<=70083||b==72250||72326<=b&&b<=72329||b==73030?p:b==13?e:b==10?t:0<=b&&b<=9||11<=b&&b<=12||14<=b&&b<=31||127<=b&&b<=159||b==173||b==1564||b==6158||b==8203||8206<=b&&b<=8207||b==8232||b==8233||8234<=b&&b<=8238||8288<=b&&b<=8292||b==8293||8294<=b&&b<=8303||55296<=b&&b<=57343||b==65279||65520<=b&&b<=65528||65529<=b&&b<=65531||113824<=b&&b<=113827||119155<=b&&b<=119162||b==917504||b==917505||917506<=b&&b<=917535||917632<=b&&b<=917759||918e3<=b&&b<=921599?n:768<=b&&b<=879||1155<=b&&b<=1159||1160<=b&&b<=1161||1425<=b&&b<=1469||b==1471||1473<=b&&b<=1474||1476<=b&&b<=1477||b==1479||1552<=b&&b<=1562||1611<=b&&b<=1631||b==1648||1750<=b&&b<=1756||1759<=b&&b<=1764||1767<=b&&b<=1768||1770<=b&&b<=1773||b==1809||1840<=b&&b<=1866||1958<=b&&b<=1968||2027<=b&&b<=2035||2070<=b&&b<=2073||2075<=b&&b<=2083||2085<=b&&b<=2087||2089<=b&&b<=2093||2137<=b&&b<=2139||2260<=b&&b<=2273||2275<=b&&b<=2306||b==2362||b==2364||2369<=b&&b<=2376||b==2381||2385<=b&&b<=2391||2402<=b&&b<=2403||b==2433||b==2492||b==2494||2497<=b&&b<=2500||b==2509||b==2519||2530<=b&&b<=2531||2561<=b&&b<=2562||b==2620||2625<=b&&b<=2626||2631<=b&&b<=2632||2635<=b&&b<=2637||b==2641||2672<=b&&b<=2673||b==2677||2689<=b&&b<=2690||b==2748||2753<=b&&b<=2757||2759<=b&&b<=2760||b==2765||2786<=b&&b<=2787||2810<=b&&b<=2815||b==2817||b==2876||b==2878||b==2879||2881<=b&&b<=2884||b==2893||b==2902||b==2903||2914<=b&&b<=2915||b==2946||b==3006||b==3008||b==3021||b==3031||b==3072||3134<=b&&b<=3136||3142<=b&&b<=3144||3146<=b&&b<=3149||3157<=b&&b<=3158||3170<=b&&b<=3171||b==3201||b==3260||b==3263||b==3266||b==3270||3276<=b&&b<=3277||3285<=b&&b<=3286||3298<=b&&b<=3299||3328<=b&&b<=3329||3387<=b&&b<=3388||b==3390||3393<=b&&b<=3396||b==3405||b==3415||3426<=b&&b<=3427||b==3530||b==3535||3538<=b&&b<=3540||b==3542||b==3551||b==3633||3636<=b&&b<=3642||3655<=b&&b<=3662||b==3761||3764<=b&&b<=3769||3771<=b&&b<=3772||3784<=b&&b<=3789||3864<=b&&b<=3865||b==3893||b==3895||b==3897||3953<=b&&b<=3966||3968<=b&&b<=3972||3974<=b&&b<=3975||3981<=b&&b<=3991||3993<=b&&b<=4028||b==4038||4141<=b&&b<=4144||4146<=b&&b<=4151||4153<=b&&b<=4154||4157<=b&&b<=4158||4184<=b&&b<=4185||4190<=b&&b<=4192||4209<=b&&b<=4212||b==4226||4229<=b&&b<=4230||b==4237||b==4253||4957<=b&&b<=4959||5906<=b&&b<=5908||5938<=b&&b<=5940||5970<=b&&b<=5971||6002<=b&&b<=6003||6068<=b&&b<=6069||6071<=b&&b<=6077||b==6086||6089<=b&&b<=6099||b==6109||6155<=b&&b<=6157||6277<=b&&b<=6278||b==6313||6432<=b&&b<=6434||6439<=b&&b<=6440||b==6450||6457<=b&&b<=6459||6679<=b&&b<=6680||b==6683||b==6742||6744<=b&&b<=6750||b==6752||b==6754||6757<=b&&b<=6764||6771<=b&&b<=6780||b==6783||6832<=b&&b<=6845||b==6846||6912<=b&&b<=6915||b==6964||6966<=b&&b<=6970||b==6972||b==6978||7019<=b&&b<=7027||7040<=b&&b<=7041||7074<=b&&b<=7077||7080<=b&&b<=7081||7083<=b&&b<=7085||b==7142||7144<=b&&b<=7145||b==7149||7151<=b&&b<=7153||7212<=b&&b<=7219||7222<=b&&b<=7223||7376<=b&&b<=7378||7380<=b&&b<=7392||7394<=b&&b<=7400||b==7405||b==7412||7416<=b&&b<=7417||7616<=b&&b<=7673||7675<=b&&b<=7679||b==8204||8400<=b&&b<=8412||8413<=b&&b<=8416||b==8417||8418<=b&&b<=8420||8421<=b&&b<=8432||11503<=b&&b<=11505||b==11647||11744<=b&&b<=11775||12330<=b&&b<=12333||12334<=b&&b<=12335||12441<=b&&b<=12442||b==42607||42608<=b&&b<=42610||42612<=b&&b<=42621||42654<=b&&b<=42655||42736<=b&&b<=42737||b==43010||b==43014||b==43019||43045<=b&&b<=43046||43204<=b&&b<=43205||43232<=b&&b<=43249||43302<=b&&b<=43309||43335<=b&&b<=43345||43392<=b&&b<=43394||b==43443||43446<=b&&b<=43449||b==43452||b==43493||43561<=b&&b<=43566||43569<=b&&b<=43570||43573<=b&&b<=43574||b==43587||b==43596||b==43644||b==43696||43698<=b&&b<=43700||43703<=b&&b<=43704||43710<=b&&b<=43711||b==43713||43756<=b&&b<=43757||b==43766||b==44005||b==44008||b==44013||b==64286||65024<=b&&b<=65039||65056<=b&&b<=65071||65438<=b&&b<=65439||b==66045||b==66272||66422<=b&&b<=66426||68097<=b&&b<=68099||68101<=b&&b<=68102||68108<=b&&b<=68111||68152<=b&&b<=68154||b==68159||68325<=b&&b<=68326||b==69633||69688<=b&&b<=69702||69759<=b&&b<=69761||69811<=b&&b<=69814||69817<=b&&b<=69818||69888<=b&&b<=69890||69927<=b&&b<=69931||69933<=b&&b<=69940||b==70003||70016<=b&&b<=70017||70070<=b&&b<=70078||70090<=b&&b<=70092||70191<=b&&b<=70193||b==70196||70198<=b&&b<=70199||b==70206||b==70367||70371<=b&&b<=70378||70400<=b&&b<=70401||b==70460||b==70462||b==70464||b==70487||70502<=b&&b<=70508||70512<=b&&b<=70516||70712<=b&&b<=70719||70722<=b&&b<=70724||b==70726||b==70832||70835<=b&&b<=70840||b==70842||b==70845||70847<=b&&b<=70848||70850<=b&&b<=70851||b==71087||71090<=b&&b<=71093||71100<=b&&b<=71101||71103<=b&&b<=71104||71132<=b&&b<=71133||71219<=b&&b<=71226||b==71229||71231<=b&&b<=71232||b==71339||b==71341||71344<=b&&b<=71349||b==71351||71453<=b&&b<=71455||71458<=b&&b<=71461||71463<=b&&b<=71467||72193<=b&&b<=72198||72201<=b&&b<=72202||72243<=b&&b<=72248||72251<=b&&b<=72254||b==72263||72273<=b&&b<=72278||72281<=b&&b<=72283||72330<=b&&b<=72342||72344<=b&&b<=72345||72752<=b&&b<=72758||72760<=b&&b<=72765||b==72767||72850<=b&&b<=72871||72874<=b&&b<=72880||72882<=b&&b<=72883||72885<=b&&b<=72886||73009<=b&&b<=73014||b==73018||73020<=b&&b<=73021||73023<=b&&b<=73029||b==73031||92912<=b&&b<=92916||92976<=b&&b<=92982||94095<=b&&b<=94098||113821<=b&&b<=113822||b==119141||119143<=b&&b<=119145||119150<=b&&b<=119154||119163<=b&&b<=119170||119173<=b&&b<=119179||119210<=b&&b<=119213||119362<=b&&b<=119364||121344<=b&&b<=121398||121403<=b&&b<=121452||b==121461||b==121476||121499<=b&&b<=121503||121505<=b&&b<=121519||122880<=b&&b<=122886||122888<=b&&b<=122904||122907<=b&&b<=122913||122915<=b&&b<=122916||122918<=b&&b<=122922||125136<=b&&b<=125142||125252<=b&&b<=125258||917536<=b&&b<=917631||917760<=b&&b<=917999?i:127462<=b&&b<=127487?o:b==2307||b==2363||2366<=b&&b<=2368||2377<=b&&b<=2380||2382<=b&&b<=2383||2434<=b&&b<=2435||2495<=b&&b<=2496||2503<=b&&b<=2504||2507<=b&&b<=2508||b==2563||2622<=b&&b<=2624||b==2691||2750<=b&&b<=2752||b==2761||2763<=b&&b<=2764||2818<=b&&b<=2819||b==2880||2887<=b&&b<=2888||2891<=b&&b<=2892||b==3007||3009<=b&&b<=3010||3014<=b&&b<=3016||3018<=b&&b<=3020||3073<=b&&b<=3075||3137<=b&&b<=3140||3202<=b&&b<=3203||b==3262||3264<=b&&b<=3265||3267<=b&&b<=3268||3271<=b&&b<=3272||3274<=b&&b<=3275||3330<=b&&b<=3331||3391<=b&&b<=3392||3398<=b&&b<=3400||3402<=b&&b<=3404||3458<=b&&b<=3459||3536<=b&&b<=3537||3544<=b&&b<=3550||3570<=b&&b<=3571||b==3635||b==3763||3902<=b&&b<=3903||b==3967||b==4145||4155<=b&&b<=4156||4182<=b&&b<=4183||b==4228||b==6070||6078<=b&&b<=6085||6087<=b&&b<=6088||6435<=b&&b<=6438||6441<=b&&b<=6443||6448<=b&&b<=6449||6451<=b&&b<=6456||6681<=b&&b<=6682||b==6741||b==6743||6765<=b&&b<=6770||b==6916||b==6965||b==6971||6973<=b&&b<=6977||6979<=b&&b<=6980||b==7042||b==7073||7078<=b&&b<=7079||b==7082||b==7143||7146<=b&&b<=7148||b==7150||7154<=b&&b<=7155||7204<=b&&b<=7211||7220<=b&&b<=7221||b==7393||7410<=b&&b<=7411||b==7415||43043<=b&&b<=43044||b==43047||43136<=b&&b<=43137||43188<=b&&b<=43203||43346<=b&&b<=43347||b==43395||43444<=b&&b<=43445||43450<=b&&b<=43451||43453<=b&&b<=43456||43567<=b&&b<=43568||43571<=b&&b<=43572||b==43597||b==43755||43758<=b&&b<=43759||b==43765||44003<=b&&b<=44004||44006<=b&&b<=44007||44009<=b&&b<=44010||b==44012||b==69632||b==69634||b==69762||69808<=b&&b<=69810||69815<=b&&b<=69816||b==69932||b==70018||70067<=b&&b<=70069||70079<=b&&b<=70080||70188<=b&&b<=70190||70194<=b&&b<=70195||b==70197||70368<=b&&b<=70370||70402<=b&&b<=70403||b==70463||70465<=b&&b<=70468||70471<=b&&b<=70472||70475<=b&&b<=70477||70498<=b&&b<=70499||70709<=b&&b<=70711||70720<=b&&b<=70721||b==70725||70833<=b&&b<=70834||b==70841||70843<=b&&b<=70844||b==70846||b==70849||71088<=b&&b<=71089||71096<=b&&b<=71099||b==71102||71216<=b&&b<=71218||71227<=b&&b<=71228||b==71230||b==71340||71342<=b&&b<=71343||b==71350||71456<=b&&b<=71457||b==71462||72199<=b&&b<=72200||b==72249||72279<=b&&b<=72280||b==72343||b==72751||b==72766||b==72873||b==72881||b==72884||94033<=b&&b<=94078||b==119142||b==119149?r:4352<=b&&b<=4447||43360<=b&&b<=43388?s:4448<=b&&b<=4519||55216<=b&&b<=55238?a:4520<=b&&b<=4607||55243<=b&&b<=55291?c:b==44032||b==44060||b==44088||b==44116||b==44144||b==44172||b==44200||b==44228||b==44256||b==44284||b==44312||b==44340||b==44368||b==44396||b==44424||b==44452||b==44480||b==44508||b==44536||b==44564||b==44592||b==44620||b==44648||b==44676||b==44704||b==44732||b==44760||b==44788||b==44816||b==44844||b==44872||b==44900||b==44928||b==44956||b==44984||b==45012||b==45040||b==45068||b==45096||b==45124||b==45152||b==45180||b==45208||b==45236||b==45264||b==45292||b==45320||b==45348||b==45376||b==45404||b==45432||b==45460||b==45488||b==45516||b==45544||b==45572||b==45600||b==45628||b==45656||b==45684||b==45712||b==45740||b==45768||b==45796||b==45824||b==45852||b==45880||b==45908||b==45936||b==45964||b==45992||b==46020||b==46048||b==46076||b==46104||b==46132||b==46160||b==46188||b==46216||b==46244||b==46272||b==46300||b==46328||b==46356||b==46384||b==46412||b==46440||b==46468||b==46496||b==46524||b==46552||b==46580||b==46608||b==46636||b==46664||b==46692||b==46720||b==46748||b==46776||b==46804||b==46832||b==46860||b==46888||b==46916||b==46944||b==46972||b==47e3||b==47028||b==47056||b==47084||b==47112||b==47140||b==47168||b==47196||b==47224||b==47252||b==47280||b==47308||b==47336||b==47364||b==47392||b==47420||b==47448||b==47476||b==47504||b==47532||b==47560||b==47588||b==47616||b==47644||b==47672||b==47700||b==47728||b==47756||b==47784||b==47812||b==47840||b==47868||b==47896||b==47924||b==47952||b==47980||b==48008||b==48036||b==48064||b==48092||b==48120||b==48148||b==48176||b==48204||b==48232||b==48260||b==48288||b==48316||b==48344||b==48372||b==48400||b==48428||b==48456||b==48484||b==48512||b==48540||b==48568||b==48596||b==48624||b==48652||b==48680||b==48708||b==48736||b==48764||b==48792||b==48820||b==48848||b==48876||b==48904||b==48932||b==48960||b==48988||b==49016||b==49044||b==49072||b==49100||b==49128||b==49156||b==49184||b==49212||b==49240||b==49268||b==49296||b==49324||b==49352||b==49380||b==49408||b==49436||b==49464||b==49492||b==49520||b==49548||b==49576||b==49604||b==49632||b==49660||b==49688||b==49716||b==49744||b==49772||b==49800||b==49828||b==49856||b==49884||b==49912||b==49940||b==49968||b==49996||b==50024||b==50052||b==50080||b==50108||b==50136||b==50164||b==50192||b==50220||b==50248||b==50276||b==50304||b==50332||b==50360||b==50388||b==50416||b==50444||b==50472||b==50500||b==50528||b==50556||b==50584||b==50612||b==50640||b==50668||b==50696||b==50724||b==50752||b==50780||b==50808||b==50836||b==50864||b==50892||b==50920||b==50948||b==50976||b==51004||b==51032||b==51060||b==51088||b==51116||b==51144||b==51172||b==51200||b==51228||b==51256||b==51284||b==51312||b==51340||b==51368||b==51396||b==51424||b==51452||b==51480||b==51508||b==51536||b==51564||b==51592||b==51620||b==51648||b==51676||b==51704||b==51732||b==51760||b==51788||b==51816||b==51844||b==51872||b==51900||b==51928||b==51956||b==51984||b==52012||b==52040||b==52068||b==52096||b==52124||b==52152||b==52180||b==52208||b==52236||b==52264||b==52292||b==52320||b==52348||b==52376||b==52404||b==52432||b==52460||b==52488||b==52516||b==52544||b==52572||b==52600||b==52628||b==52656||b==52684||b==52712||b==52740||b==52768||b==52796||b==52824||b==52852||b==52880||b==52908||b==52936||b==52964||b==52992||b==53020||b==53048||b==53076||b==53104||b==53132||b==53160||b==53188||b==53216||b==53244||b==53272||b==53300||b==53328||b==53356||b==53384||b==53412||b==53440||b==53468||b==53496||b==53524||b==53552||b==53580||b==53608||b==53636||b==53664||b==53692||b==53720||b==53748||b==53776||b==53804||b==53832||b==53860||b==53888||b==53916||b==53944||b==53972||b==54e3||b==54028||b==54056||b==54084||b==54112||b==54140||b==54168||b==54196||b==54224||b==54252||b==54280||b==54308||b==54336||b==54364||b==54392||b==54420||b==54448||b==54476||b==54504||b==54532||b==54560||b==54588||b==54616||b==54644||b==54672||b==54700||b==54728||b==54756||b==54784||b==54812||b==54840||b==54868||b==54896||b==54924||b==54952||b==54980||b==55008||b==55036||b==55064||b==55092||b==55120||b==55148||b==55176?d:44033<=b&&b<=44059||44061<=b&&b<=44087||44089<=b&&b<=44115||44117<=b&&b<=44143||44145<=b&&b<=44171||44173<=b&&b<=44199||44201<=b&&b<=44227||44229<=b&&b<=44255||44257<=b&&b<=44283||44285<=b&&b<=44311||44313<=b&&b<=44339||44341<=b&&b<=44367||44369<=b&&b<=44395||44397<=b&&b<=44423||44425<=b&&b<=44451||44453<=b&&b<=44479||44481<=b&&b<=44507||44509<=b&&b<=44535||44537<=b&&b<=44563||44565<=b&&b<=44591||44593<=b&&b<=44619||44621<=b&&b<=44647||44649<=b&&b<=44675||44677<=b&&b<=44703||44705<=b&&b<=44731||44733<=b&&b<=44759||44761<=b&&b<=44787||44789<=b&&b<=44815||44817<=b&&b<=44843||44845<=b&&b<=44871||44873<=b&&b<=44899||44901<=b&&b<=44927||44929<=b&&b<=44955||44957<=b&&b<=44983||44985<=b&&b<=45011||45013<=b&&b<=45039||45041<=b&&b<=45067||45069<=b&&b<=45095||45097<=b&&b<=45123||45125<=b&&b<=45151||45153<=b&&b<=45179||45181<=b&&b<=45207||45209<=b&&b<=45235||45237<=b&&b<=45263||45265<=b&&b<=45291||45293<=b&&b<=45319||45321<=b&&b<=45347||45349<=b&&b<=45375||45377<=b&&b<=45403||45405<=b&&b<=45431||45433<=b&&b<=45459||45461<=b&&b<=45487||45489<=b&&b<=45515||45517<=b&&b<=45543||45545<=b&&b<=45571||45573<=b&&b<=45599||45601<=b&&b<=45627||45629<=b&&b<=45655||45657<=b&&b<=45683||45685<=b&&b<=45711||45713<=b&&b<=45739||45741<=b&&b<=45767||45769<=b&&b<=45795||45797<=b&&b<=45823||45825<=b&&b<=45851||45853<=b&&b<=45879||45881<=b&&b<=45907||45909<=b&&b<=45935||45937<=b&&b<=45963||45965<=b&&b<=45991||45993<=b&&b<=46019||46021<=b&&b<=46047||46049<=b&&b<=46075||46077<=b&&b<=46103||46105<=b&&b<=46131||46133<=b&&b<=46159||46161<=b&&b<=46187||46189<=b&&b<=46215||46217<=b&&b<=46243||46245<=b&&b<=46271||46273<=b&&b<=46299||46301<=b&&b<=46327||46329<=b&&b<=46355||46357<=b&&b<=46383||46385<=b&&b<=46411||46413<=b&&b<=46439||46441<=b&&b<=46467||46469<=b&&b<=46495||46497<=b&&b<=46523||46525<=b&&b<=46551||46553<=b&&b<=46579||46581<=b&&b<=46607||46609<=b&&b<=46635||46637<=b&&b<=46663||46665<=b&&b<=46691||46693<=b&&b<=46719||46721<=b&&b<=46747||46749<=b&&b<=46775||46777<=b&&b<=46803||46805<=b&&b<=46831||46833<=b&&b<=46859||46861<=b&&b<=46887||46889<=b&&b<=46915||46917<=b&&b<=46943||46945<=b&&b<=46971||46973<=b&&b<=46999||47001<=b&&b<=47027||47029<=b&&b<=47055||47057<=b&&b<=47083||47085<=b&&b<=47111||47113<=b&&b<=47139||47141<=b&&b<=47167||47169<=b&&b<=47195||47197<=b&&b<=47223||47225<=b&&b<=47251||47253<=b&&b<=47279||47281<=b&&b<=47307||47309<=b&&b<=47335||47337<=b&&b<=47363||47365<=b&&b<=47391||47393<=b&&b<=47419||47421<=b&&b<=47447||47449<=b&&b<=47475||47477<=b&&b<=47503||47505<=b&&b<=47531||47533<=b&&b<=47559||47561<=b&&b<=47587||47589<=b&&b<=47615||47617<=b&&b<=47643||47645<=b&&b<=47671||47673<=b&&b<=47699||47701<=b&&b<=47727||47729<=b&&b<=47755||47757<=b&&b<=47783||47785<=b&&b<=47811||47813<=b&&b<=47839||47841<=b&&b<=47867||47869<=b&&b<=47895||47897<=b&&b<=47923||47925<=b&&b<=47951||47953<=b&&b<=47979||47981<=b&&b<=48007||48009<=b&&b<=48035||48037<=b&&b<=48063||48065<=b&&b<=48091||48093<=b&&b<=48119||48121<=b&&b<=48147||48149<=b&&b<=48175||48177<=b&&b<=48203||48205<=b&&b<=48231||48233<=b&&b<=48259||48261<=b&&b<=48287||48289<=b&&b<=48315||48317<=b&&b<=48343||48345<=b&&b<=48371||48373<=b&&b<=48399||48401<=b&&b<=48427||48429<=b&&b<=48455||48457<=b&&b<=48483||48485<=b&&b<=48511||48513<=b&&b<=48539||48541<=b&&b<=48567||48569<=b&&b<=48595||48597<=b&&b<=48623||48625<=b&&b<=48651||48653<=b&&b<=48679||48681<=b&&b<=48707||48709<=b&&b<=48735||48737<=b&&b<=48763||48765<=b&&b<=48791||48793<=b&&b<=48819||48821<=b&&b<=48847||48849<=b&&b<=48875||48877<=b&&b<=48903||48905<=b&&b<=48931||48933<=b&&b<=48959||48961<=b&&b<=48987||48989<=b&&b<=49015||49017<=b&&b<=49043||49045<=b&&b<=49071||49073<=b&&b<=49099||49101<=b&&b<=49127||49129<=b&&b<=49155||49157<=b&&b<=49183||49185<=b&&b<=49211||49213<=b&&b<=49239||49241<=b&&b<=49267||49269<=b&&b<=49295||49297<=b&&b<=49323||49325<=b&&b<=49351||49353<=b&&b<=49379||49381<=b&&b<=49407||49409<=b&&b<=49435||49437<=b&&b<=49463||49465<=b&&b<=49491||49493<=b&&b<=49519||49521<=b&&b<=49547||49549<=b&&b<=49575||49577<=b&&b<=49603||49605<=b&&b<=49631||49633<=b&&b<=49659||49661<=b&&b<=49687||49689<=b&&b<=49715||49717<=b&&b<=49743||49745<=b&&b<=49771||49773<=b&&b<=49799||49801<=b&&b<=49827||49829<=b&&b<=49855||49857<=b&&b<=49883||49885<=b&&b<=49911||49913<=b&&b<=49939||49941<=b&&b<=49967||49969<=b&&b<=49995||49997<=b&&b<=50023||50025<=b&&b<=50051||50053<=b&&b<=50079||50081<=b&&b<=50107||50109<=b&&b<=50135||50137<=b&&b<=50163||50165<=b&&b<=50191||50193<=b&&b<=50219||50221<=b&&b<=50247||50249<=b&&b<=50275||50277<=b&&b<=50303||50305<=b&&b<=50331||50333<=b&&b<=50359||50361<=b&&b<=50387||50389<=b&&b<=50415||50417<=b&&b<=50443||50445<=b&&b<=50471||50473<=b&&b<=50499||50501<=b&&b<=50527||50529<=b&&b<=50555||50557<=b&&b<=50583||50585<=b&&b<=50611||50613<=b&&b<=50639||50641<=b&&b<=50667||50669<=b&&b<=50695||50697<=b&&b<=50723||50725<=b&&b<=50751||50753<=b&&b<=50779||50781<=b&&b<=50807||50809<=b&&b<=50835||50837<=b&&b<=50863||50865<=b&&b<=50891||50893<=b&&b<=50919||50921<=b&&b<=50947||50949<=b&&b<=50975||50977<=b&&b<=51003||51005<=b&&b<=51031||51033<=b&&b<=51059||51061<=b&&b<=51087||51089<=b&&b<=51115||51117<=b&&b<=51143||51145<=b&&b<=51171||51173<=b&&b<=51199||51201<=b&&b<=51227||51229<=b&&b<=51255||51257<=b&&b<=51283||51285<=b&&b<=51311||51313<=b&&b<=51339||51341<=b&&b<=51367||51369<=b&&b<=51395||51397<=b&&b<=51423||51425<=b&&b<=51451||51453<=b&&b<=51479||51481<=b&&b<=51507||51509<=b&&b<=51535||51537<=b&&b<=51563||51565<=b&&b<=51591||51593<=b&&b<=51619||51621<=b&&b<=51647||51649<=b&&b<=51675||51677<=b&&b<=51703||51705<=b&&b<=51731||51733<=b&&b<=51759||51761<=b&&b<=51787||51789<=b&&b<=51815||51817<=b&&b<=51843||51845<=b&&b<=51871||51873<=b&&b<=51899||51901<=b&&b<=51927||51929<=b&&b<=51955||51957<=b&&b<=51983||51985<=b&&b<=52011||52013<=b&&b<=52039||52041<=b&&b<=52067||52069<=b&&b<=52095||52097<=b&&b<=52123||52125<=b&&b<=52151||52153<=b&&b<=52179||52181<=b&&b<=52207||52209<=b&&b<=52235||52237<=b&&b<=52263||52265<=b&&b<=52291||52293<=b&&b<=52319||52321<=b&&b<=52347||52349<=b&&b<=52375||52377<=b&&b<=52403||52405<=b&&b<=52431||52433<=b&&b<=52459||52461<=b&&b<=52487||52489<=b&&b<=52515||52517<=b&&b<=52543||52545<=b&&b<=52571||52573<=b&&b<=52599||52601<=b&&b<=52627||52629<=b&&b<=52655||52657<=b&&b<=52683||52685<=b&&b<=52711||52713<=b&&b<=52739||52741<=b&&b<=52767||52769<=b&&b<=52795||52797<=b&&b<=52823||52825<=b&&b<=52851||52853<=b&&b<=52879||52881<=b&&b<=52907||52909<=b&&b<=52935||52937<=b&&b<=52963||52965<=b&&b<=52991||52993<=b&&b<=53019||53021<=b&&b<=53047||53049<=b&&b<=53075||53077<=b&&b<=53103||53105<=b&&b<=53131||53133<=b&&b<=53159||53161<=b&&b<=53187||53189<=b&&b<=53215||53217<=b&&b<=53243||53245<=b&&b<=53271||53273<=b&&b<=53299||53301<=b&&b<=53327||53329<=b&&b<=53355||53357<=b&&b<=53383||53385<=b&&b<=53411||53413<=b&&b<=53439||53441<=b&&b<=53467||53469<=b&&b<=53495||53497<=b&&b<=53523||53525<=b&&b<=53551||53553<=b&&b<=53579||53581<=b&&b<=53607||53609<=b&&b<=53635||53637<=b&&b<=53663||53665<=b&&b<=53691||53693<=b&&b<=53719||53721<=b&&b<=53747||53749<=b&&b<=53775||53777<=b&&b<=53803||53805<=b&&b<=53831||53833<=b&&b<=53859||53861<=b&&b<=53887||53889<=b&&b<=53915||53917<=b&&b<=53943||53945<=b&&b<=53971||53973<=b&&b<=53999||54001<=b&&b<=54027||54029<=b&&b<=54055||54057<=b&&b<=54083||54085<=b&&b<=54111||54113<=b&&b<=54139||54141<=b&&b<=54167||54169<=b&&b<=54195||54197<=b&&b<=54223||54225<=b&&b<=54251||54253<=b&&b<=54279||54281<=b&&b<=54307||54309<=b&&b<=54335||54337<=b&&b<=54363||54365<=b&&b<=54391||54393<=b&&b<=54419||54421<=b&&b<=54447||54449<=b&&b<=54475||54477<=b&&b<=54503||54505<=b&&b<=54531||54533<=b&&b<=54559||54561<=b&&b<=54587||54589<=b&&b<=54615||54617<=b&&b<=54643||54645<=b&&b<=54671||54673<=b&&b<=54699||54701<=b&&b<=54727||54729<=b&&b<=54755||54757<=b&&b<=54783||54785<=b&&b<=54811||54813<=b&&b<=54839||54841<=b&&b<=54867||54869<=b&&b<=54895||54897<=b&&b<=54923||54925<=b&&b<=54951||54953<=b&&b<=54979||54981<=b&&b<=55007||55009<=b&&b<=55035||55037<=b&&b<=55063||55065<=b&&b<=55091||55093<=b&&b<=55119||55121<=b&&b<=55147||55149<=b&&b<=55175||55177<=b&&b<=55203?u:b==9757||b==9977||9994<=b&&b<=9997||b==127877||127938<=b&&b<=127940||b==127943||127946<=b&&b<=127948||128066<=b&&b<=128067||128070<=b&&b<=128080||b==128110||128112<=b&&b<=128120||b==128124||128129<=b&&b<=128131||128133<=b&&b<=128135||b==128170||128372<=b&&b<=128373||b==128378||b==128400||128405<=b&&b<=128406||128581<=b&&b<=128583||128587<=b&&b<=128591||b==128675||128692<=b&&b<=128694||b==128704||b==128716||129304<=b&&b<=129308||129310<=b&&b<=129311||b==129318||129328<=b&&b<=129337||129341<=b&&b<=129342||129489<=b&&b<=129501?g:127995<=b&&b<=127999?f:b==8205?y:b==9792||b==9794||9877<=b&&b<=9878||b==9992||b==10084||b==127752||b==127806||b==127859||b==127891||b==127908||b==127912||b==127979||b==127981||b==128139||128187<=b&&b<=128188||b==128295||b==128300||b==128488||b==128640||b==128658?x:128102<=b&&b<=128105?S:h}return this}typeof aU<"u"&&aU.exports&&(aU.exports=n7e)});var cCe=ad((sto,h3)=>{var ato=_(T());/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,g=c(u,h.inputOffset||0,p),f=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,y=r(g,h.pixelType||Float32Array,h.encodedMaskData,f,h.returnMask),x={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:f};return y.resultMask&&(x.maskData=y.resultMask),h.returnEncodedMask&&g.mask&&(x.encodedMaskData=g.mask.bitset?g.mask.bitset:null),h.returnFileInfo&&(x.fileInfo=s(g),h.computeUsedBitDepths&&(x.fileInfo.bitDepths=a(g))),x};var r=function(u,h,p,g,f){var y=0,x=u.pixels.numBlocksX,S=u.pixels.numBlocksY,C=Math.floor(u.width/x),V=Math.floor(u.height/S),L=2*u.maxZError,Z=Number.MAX_VALUE,E;p=p||(u.mask?u.mask.bitset:null);var P,W;P=new h(u.width*u.height),f&&p&&(W=new Uint8Array(u.width*u.height));for(var v=new Float32Array(C*V),A,b,R=0;R<=S;R++){var G=R!==S?V:u.height%S;if(G!==0)for(var I=0;I<=x;I++){var w=I!==x?C:u.width%x;if(w!==0){var M=R*u.width*V+I*C,O=u.width-w,k=u.pixels.blocks[y],B,N,z;k.encoding<2?(k.encoding===0?B=k.rawData:(d(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,L,v,u.pixels.maxValue),B=v),N=0):k.encoding===2?z=0:z=k.offset;var K;if(p)for(b=0;b<G;b++){for(M&7&&(K=p[M>>3],K<<=M&7),A=0;A<w;A++)M&7||(K=p[M>>3]),K&128?(W&&(W[M]=1),E=k.encoding<2?B[N++]:z,Z=Z>E?E:Z,P[M++]=E):(W&&(W[M]=0),P[M++]=g),K<<=1;M+=O}else if(k.encoding<2)for(b=0;b<G;b++){for(A=0;A<w;A++)E=B[N++],Z=Z>E?E:Z,P[M++]=E;M+=O}else for(Z=Z>z?z:Z,b=0;b<G;b++){for(A=0;A<w;A++)P[M++]=z;M+=O}if(k.encoding===1&&N!==k.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:P,resultMask:W,minValue:Z}},s=function(u){return{fileIdentifierString:u.fileIdentifierString,fileVersion:u.fileVersion,imageType:u.imageType,height:u.height,width:u.width,maxZError:u.maxZError,eofOffset:u.eofOffset,mask:u.mask?{numBlocksX:u.mask.numBlocksX,numBlocksY:u.mask.numBlocksY,numBytes:u.mask.numBytes,maxValue:u.mask.maxValue}:null,pixels:{numBlocksX:u.pixels.numBlocksX,numBlocksY:u.pixels.numBlocksY,numBytes:u.pixels.numBytes,maxValue:u.pixels.maxValue,noDataValue:u.noDataValue}}},a=function(u){for(var h=u.pixels.numBlocksX*u.pixels.numBlocksY,p={},g=0;g<h;g++){var f=u.pixels.blocks[g];f.encoding===0?p.float32=!0:f.encoding===1?p[f.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(u,h,p){var g={},f=new Uint8Array(u,h,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,f),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;h+=10;var y=new DataView(u,h,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),h+=24,!p)if(y=new DataView(u,h,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),h+=16,g.mask.numBytes>0){var x=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(u,h,g.mask.numBytes);var S=y.getInt16(0,!0),C=2,V=0;do{if(S>0)for(;S--;)x[V++]=y.getUint8(C++);else{var L=y.getUint8(C++);for(S=-S;S--;)x[V++]=L}S=y.getInt16(C,!0),C+=2}while(C<g.mask.numBytes);if(S!==-32768||V<x.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=x,h+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));y=new DataView(u,h,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),h+=16;var Z=g.pixels.numBlocksX,E=g.pixels.numBlocksY,P=Z+(g.width%Z>0?1:0),W=E+(g.height%E>0?1:0);g.pixels.blocks=new Array(P*W);for(var v=0,A=0;A<W;A++)for(var b=0;b<P;b++){var R=0,G=u.byteLength-h;y=new DataView(u,h,Math.min(10,G));var I={};g.pixels.blocks[v++]=I;var w=y.getUint8(0);if(R++,I.encoding=w&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){h++;continue}if(w!==0&&w!==2){if(w>>=6,I.offsetType=w,w===2)I.offset=y.getInt8(1),R++;else if(w===1)I.offset=y.getInt16(1,!0),R+=2;else if(w===0)I.offset=y.getFloat32(1,!0),R+=4;else throw"Invalid block offset type";if(I.encoding===1)if(w=y.getUint8(R),R++,I.bitsPerPixel=w&63,w>>=6,I.numValidPixelsType=w,w===2)I.numValidPixels=y.getUint8(R),R++;else if(w===1)I.numValidPixels=y.getUint16(R,!0),R+=2;else if(w===0)I.numValidPixels=y.getUint32(R,!0),R+=4;else throw"Invalid valid pixel count type"}if(h+=R,I.encoding!==3){var M,O;if(I.encoding===0){var k=(g.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";M=new ArrayBuffer(k*4),O=new Uint8Array(M),O.set(new Uint8Array(u,h,k*4));var B=new Float32Array(M);I.rawData=B,h+=k*4}else if(I.encoding===1){var N=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),z=Math.ceil(N/4);M=new ArrayBuffer(z*4),O=new Uint8Array(M),O.set(new Uint8Array(u,h,N)),I.stuffedData=new Uint32Array(M),h+=N}}}return g.eofOffset=h,g},d=function(u,h,p,g,f,y,x){var S=(1<<h)-1,C=0,V,L=0,Z,E,P=Math.ceil((x-g)/f),W=u.length*4-Math.ceil(h*p/8);for(u[u.length-1]<<=8*W,V=0;V<p;V++){if(L===0&&(E=u[C++],L=32),L>=h)Z=E>>>L-h&S,L-=h;else{var v=h-L;Z=(E&S)<<v&S,E=u[C++],L=32-v,Z+=E>>>L}y[V]=Z<P?g+Z*f:x}return y};return o}(),t=function(){"use strict";var o={unstuff:function(c,d,u,h,p,g,f,y){var x=(1<<u)-1,S=0,C,V=0,L,Z,E,P,W=c.length*4-Math.ceil(u*h/8);if(c[c.length-1]<<=8*W,p)for(C=0;C<h;C++)V===0&&(Z=c[S++],V=32),V>=u?(L=Z>>>V-u&x,V-=u):(E=u-V,L=(Z&x)<<E&x,Z=c[S++],V=32-E,L+=Z>>>V),d[C]=p[L];else for(P=Math.ceil((y-g)/f),C=0;C<h;C++)V===0&&(Z=c[S++],V=32),V>=u?(L=Z>>>V-u&x,V-=u):(E=u-V,L=(Z&x)<<E&x,Z=c[S++],V=32-E,L+=Z>>>V),d[C]=L<P?g+L*f:y},unstuffLUT:function(c,d,u,h,p,g){var f=(1<<d)-1,y=0,x=0,S=0,C=0,V=0,L,Z=[],E=c.length*4-Math.ceil(d*u/8);c[c.length-1]<<=8*E;var P=Math.ceil((g-h)/p);for(x=0;x<u;x++)C===0&&(L=c[y++],C=32),C>=d?(V=L>>>C-d&f,C-=d):(S=d-C,V=(L&f)<<S&f,L=c[y++],C=32-S,V+=L>>>C),Z[x]=V<P?h+V*p:g;return Z.unshift(h),Z},unstuff2:function(c,d,u,h,p,g,f,y){var x=(1<<u)-1,S=0,C,V=0,L=0,Z,E,P;if(p)for(C=0;C<h;C++)V===0&&(E=c[S++],V=32,L=0),V>=u?(Z=E>>>L&x,V-=u,L+=u):(P=u-V,Z=E>>>L&x,E=c[S++],V=32-P,Z|=(E&(1<<P)-1)<<u-P,L=P),d[C]=p[Z];else{var W=Math.ceil((y-g)/f);for(C=0;C<h;C++)V===0&&(E=c[S++],V=32,L=0),V>=u?(Z=E>>>L&x,V-=u,L+=u):(P=u-V,Z=E>>>L&x,E=c[S++],V=32-P,Z|=(E&(1<<P)-1)<<u-P,L=P),d[C]=Z<W?g+Z*f:y}return d},unstuffLUT2:function(c,d,u,h,p,g){var f=(1<<d)-1,y=0,x=0,S=0,C=0,V=0,L=0,Z,E=[],P=Math.ceil((g-h)/p);for(x=0;x<u;x++)C===0&&(Z=c[y++],C=32,L=0),C>=d?(V=Z>>>L&f,C-=d,L+=d):(S=d-C,V=Z>>>L&f,Z=c[y++],C=32-S,V|=(Z&(1<<S)-1)<<d-S,L=S),E[x]=V<P?h+V*p:g;return E.unshift(h),E},originalUnstuff:function(c,d,u,h){var p=(1<<u)-1,g=0,f,y=0,x,S,C,V=c.length*4-Math.ceil(u*h/8);for(c[c.length-1]<<=8*V,f=0;f<h;f++)y===0&&(S=c[g++],y=32),y>=u?(x=S>>>y-u&p,y-=u):(C=u-y,x=(S&p)<<C&p,S=c[g++],y=32-C,x+=S>>>y),d[f]=x;return d},originalUnstuff2:function(c,d,u,h){var p=(1<<u)-1,g=0,f,y=0,x=0,S,C,V;for(f=0;f<h;f++)y===0&&(C=c[g++],y=32,x=0),y>=u?(S=C>>>x&p,y-=u,x+=u):(V=u-y,S=C>>>x&p,C=c[g++],y=32-V,S|=(C&(1<<V)-1)<<u-V,x=V),d[f]=S;return d}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var d=65535,u=65535,h=c.length,p=Math.floor(h/2),g=0;p;){var f=p>=359?359:p;p-=f;do d+=c[g++]<<8,u+=d+=c[g++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return h&1&&(u+=d+=c[g]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(c,d){var u=d.ptr,h=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,h),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var g=new DataView(c,u,8),f=g.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=g.getUint32(4,!0),u+=4),g=new DataView(c,u,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),u+=8,f>=4?(p.numDims=g.getUint32(8,!0),u+=4):p.numDims=1,g=new DataView(c,u,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var y,x;if(f>=3&&(x=f>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,u-x,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,d){var u=d.headerInfo,h=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),g=this.readSubArray(c,d.ptr,h,p),f=this.readSubArray(c,d.ptr+p,h,p);d.ptr+=2*p;var y,x=!0;for(y=0;y<u.numDims;y++)if(g[y]!==f[y]){x=!1;break}return u.minValues=g,u.maxValues=f,x},readSubArray:function(c,d,u,h){var p;if(u===Uint8Array)p=new Uint8Array(c,d,h);else{var g=new ArrayBuffer(h),f=new Uint8Array(g);f.set(new Uint8Array(c,d,h)),p=new u(g)}return p},readMask:function(c,d){var u=d.ptr,h=d.headerInfo,p=h.width*h.height,g=h.numValidPixel,f=new DataView(c,u,4),y={};if(y.numBytes=f.getUint32(0,!0),u+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var x,S;if(g===0)x=new Uint8Array(Math.ceil(p/8)),y.bitset=x,S=new Uint8Array(p),d.pixels.resultMask=S,u+=y.numBytes;else if(y.numBytes>0){x=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,y.numBytes);var C=f.getInt16(0,!0),V=2,L=0,Z=0;do{if(C>0)for(;C--;)x[L++]=f.getUint8(V++);else for(Z=f.getUint8(V++),C=-C;C--;)x[L++]=Z;C=f.getInt16(V,!0),V+=2}while(V<y.numBytes);if(C!==-32768||L<x.length)throw"Unexpected end of mask RLE encoding";S=new Uint8Array(p);var E=0,P=0;for(P=0;P<p;P++)P&7?(E=x[P>>3],E<<=P&7):E=x[P>>3],E&128&&(S[P]=1);d.pixels.resultMask=S,y.bitset=x,u+=y.numBytes}return d.ptr=u,d.mask=y,!0},readDataOneSweep:function(c,d,u){var h=d.ptr,p=d.headerInfo,g=p.numDims,f=p.width*p.height,y=p.imageType,x=p.numValidPixel*r.getDataTypeSize(y)*g,S,C=d.pixels.resultMask;if(u===Uint8Array)S=new Uint8Array(c,h,x);else{var V=new ArrayBuffer(x),L=new Uint8Array(V);L.set(new Uint8Array(c,h,x)),S=new u(V)}if(S.length===f*g)d.pixels.resultPixels=S;else{d.pixels.resultPixels=new u(f*g);var Z=0,E=0,P=0,W=0;if(g>1)for(P=0;P<g;P++)for(W=P*f,E=0;E<f;E++)C[E]&&(d.pixels.resultPixels[W+E]=S[Z++]);else for(E=0;E<f;E++)C[E]&&(d.pixels.resultPixels[E]=S[Z++])}return h+=x,d.ptr=h,!0},readHuffmanTree:function(c,d){var u=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(c,d.ptr,16);d.ptr+=16;var p=h.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=h.getInt32(4,!0),f=h.getInt32(8,!0),y=h.getInt32(12,!0);if(f>=y)return!1;var x=new Uint32Array(y-f);r.decodeBits(c,d,x);var S=[],C,V,L,Z;for(C=f;C<y;C++)V=C-(C<g?0:g),S[V]={first:x[C-f],second:null};var E=c.byteLength-d.ptr,P=Math.ceil(E/4),W=new ArrayBuffer(P*4),v=new Uint8Array(W);v.set(new Uint8Array(c,d.ptr,E));var A=new Uint32Array(W),b=0,R,G=0;for(R=A[0],C=f;C<y;C++)V=C-(C<g?0:g),Z=S[V].first,Z>0&&(S[V].second=R<<b>>>32-Z,32-b>=Z?(b+=Z,b===32&&(b=0,G++,R=A[G])):(b+=Z-32,G++,R=A[G],S[V].second|=R>>>32-b));var I=0,w=0,M=new s;for(C=0;C<S.length;C++)S[C]!==void 0&&(I=Math.max(I,S[C].first));I>=u?w=u:w=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var O=[],k,B,N,z,K,te;for(C=f;C<y;C++)if(V=C-(C<g?0:g),Z=S[V].first,Z>0)if(k=[Z,V],Z<=w)for(B=S[V].second<<w-Z,N=1<<w-Z,L=0;L<N;L++)O[B|L]=k;else for(B=S[V].second,te=M,z=Z-1;z>=0;z--)K=B>>>z&1,K?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),z===0&&!te.val&&(te.val=k[1]);return{decodeLut:O,numBitsLUTQick:w,numBitsLUT:I,tree:M,stuffedData:A,srcPtr:G,bitPos:b}},readHuffman:function(c,d,u){var h=d.headerInfo,p=h.numDims,g=d.headerInfo.height,f=d.headerInfo.width,y=f*g,x=this.readHuffmanTree(c,d),S=x.decodeLut,C=x.tree,V=x.stuffedData,L=x.srcPtr,Z=x.bitPos,E=x.numBitsLUTQick,P=x.numBitsLUT,W=d.headerInfo.imageType===0?128:0,v,A,b,R=d.pixels.resultMask,G,I,w,M,O,k,B,N=0;Z>0&&(L++,Z=0);var z=V[L],K=d.encodeMode===1,te=new u(y*p),H=te,j;for(j=0;j<h.numDims;j++){if(p>1&&(H=new u(te.buffer,y*j,y),N=0),d.headerInfo.numValidPixel===f*g)for(k=0,M=0;M<g;M++)for(O=0;O<f;O++,k++){if(A=0,G=z<<Z>>>32-E,I=G,32-Z<E&&(G|=V[L+1]>>>64-Z-E,I=G),S[I])A=S[I][1],Z+=S[I][0];else for(G=z<<Z>>>32-P,I=G,32-Z<P&&(G|=V[L+1]>>>64-Z-P,I=G),v=C,B=0;B<P;B++)if(w=G>>>P-B-1&1,v=w?v.right:v.left,!(v.left||v.right)){A=v.val,Z=Z+B+1;break}Z>=32&&(Z-=32,L++,z=V[L]),b=A-W,K?(O>0?b+=N:M>0?b+=H[k-f]:b+=N,b&=255,H[k]=b,N=b):H[k]=b}else for(k=0,M=0;M<g;M++)for(O=0;O<f;O++,k++)if(R[k]){if(A=0,G=z<<Z>>>32-E,I=G,32-Z<E&&(G|=V[L+1]>>>64-Z-E,I=G),S[I])A=S[I][1],Z+=S[I][0];else for(G=z<<Z>>>32-P,I=G,32-Z<P&&(G|=V[L+1]>>>64-Z-P,I=G),v=C,B=0;B<P;B++)if(w=G>>>P-B-1&1,v=w?v.right:v.left,!(v.left||v.right)){A=v.val,Z=Z+B+1;break}Z>=32&&(Z-=32,L++,z=V[L]),b=A-W,K?(O>0&&R[k-1]?b+=N:M>0&&R[k-f]?b+=H[k-f]:b+=N,b&=255,H[k]=b,N=b):H[k]=b}d.ptr=d.ptr+(L+1)*4+(Z>0?4:0)}d.pixels.resultPixels=te},decodeBits:function(c,d,u,h,p){{var g=d.headerInfo,f=g.fileVersion,y=0,x=new DataView(c,d.ptr,5),S=x.getUint8(0);y++;var C=S>>6,V=C===0?4:3-C,L=(S&32)>0,Z=S&31,E=0;if(V===1)E=x.getUint8(y),y++;else if(V===2)E=x.getUint16(y,!0),y+=2;else if(V===4)E=x.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var P=2*g.maxZError,W,v,A,b,R,G,I,w,M,O,k=g.numDims>1?g.maxValues[p]:g.zMax;if(L){for(d.counter.lut++,w=x.getUint8(y),M=Z,y++,b=Math.ceil((w-1)*Z/8),R=Math.ceil(b/4),v=new ArrayBuffer(R*4),A=new Uint8Array(v),d.ptr+=y,A.set(new Uint8Array(c,d.ptr,b)),I=new Uint32Array(v),d.ptr+=b,O=0;w-1>>>O;)O++;b=Math.ceil(E*O/8),R=Math.ceil(b/4),v=new ArrayBuffer(R*4),A=new Uint8Array(v),A.set(new Uint8Array(c,d.ptr,b)),W=new Uint32Array(v),d.ptr+=b,f>=3?G=o.unstuffLUT2(I,Z,w-1,h,P,k):G=o.unstuffLUT(I,Z,w-1,h,P,k),f>=3?o.unstuff2(W,u,O,E,G):o.unstuff(W,u,O,E,G)}else d.counter.bitstuffer++,O=Z,d.ptr+=y,O>0&&(b=Math.ceil(E*O/8),R=Math.ceil(b/4),v=new ArrayBuffer(R*4),A=new Uint8Array(v),A.set(new Uint8Array(c,d.ptr,b)),W=new Uint32Array(v),d.ptr+=b,f>=3?h==null?o.originalUnstuff2(W,u,O,E):o.unstuff2(W,u,O,E,!1,h,P,k):h==null?o.originalUnstuff(W,u,O,E):o.unstuff(W,u,O,E,!1,h,P,k))}},readTiles:function(c,d,u){var h=d.headerInfo,p=h.width,g=h.height,f=h.microBlockSize,y=h.imageType,x=r.getDataTypeSize(y),S=Math.ceil(p/f),C=Math.ceil(g/f);d.pixels.numBlocksY=C,d.pixels.numBlocksX=S,d.pixels.ptr=0;var V=0,L=0,Z=0,E=0,P=0,W=0,v=0,A=0,b=0,R=0,G=0,I=0,w=0,M=0,O=0,k=0,B,N,z,K,te,H,j=new u(f*f),ee=g%f||f,pe=p%f||f,_e,ae,ye=h.numDims,Se,Ee=d.pixels.resultMask,Ie=d.pixels.resultPixels;for(Z=0;Z<C;Z++)for(P=Z!==C-1?f:ee,E=0;E<S;E++)for(W=E!==S-1?f:pe,G=Z*p*f+E*f,I=p-W,Se=0;Se<ye;Se++){if(ye>1&&(Ie=new u(d.pixels.resultPixels.buffer,p*g*Se*x,p*g)),v=c.byteLength-d.ptr,B=new DataView(c,d.ptr,Math.min(10,v)),N={},k=0,A=B.getUint8(0),k++,b=A>>6&255,R=A>>2&15,R!==(E*f>>3&15))throw"integrity issue";if(H=A&3,H>3)throw d.ptr+=k,"Invalid block encoding ("+H+")";if(H===2){d.counter.constant++,d.ptr+=k;continue}else if(H===0){if(d.counter.uncompressed++,d.ptr+=k,w=P*W*x,M=c.byteLength-d.ptr,w=w<M?w:M,z=new ArrayBuffer(w%x===0?w:w+x-w%x),K=new Uint8Array(z),K.set(new Uint8Array(c,d.ptr,w)),te=new u(z),O=0,Ee)for(V=0;V<P;V++){for(L=0;L<W;L++)Ee[G]&&(Ie[G]=te[O++]),G++;G+=I}else for(V=0;V<P;V++){for(L=0;L<W;L++)Ie[G++]=te[O++];G+=I}d.ptr+=O*x}else if(_e=r.getDataTypeUsed(y,b),ae=r.getOnePixel(N,k,_e,B),k+=r.getDataTypeSize(_e),H===3)if(d.ptr+=k,d.counter.constantoffset++,Ee)for(V=0;V<P;V++){for(L=0;L<W;L++)Ee[G]&&(Ie[G]=ae),G++;G+=I}else for(V=0;V<P;V++){for(L=0;L<W;L++)Ie[G++]=ae;G+=I}else if(d.ptr+=k,r.decodeBits(c,d,j,ae,Se),k=0,Ee)for(V=0;V<P;V++){for(L=0;L<W;L++)Ee[G]&&(Ie[G]=j[k++]),G++;G+=I}else for(V=0;V<P;V++){for(L=0;L<W;L++)Ie[G++]=j[k++];G+=I}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var d=c.headerInfo.zMax,u=c.headerInfo.numDims,h=c.headerInfo.height*c.headerInfo.width,p=h*u,g=0,f=0,y=0,x=c.pixels.resultMask;if(x)if(u>1)for(g=0;g<u;g++)for(y=g*h,f=0;f<h;f++)x[f]&&(c.pixels.resultPixels[y+f]=d);else for(f=0;f<h;f++)x[f]&&(c.pixels.resultPixels[f]=d);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(d);else for(f=0;f<p;f++)c.pixels.resultPixels[f]=d},getDataTypeArray:function(c){var d;switch(c){case 0:d=Int8Array;break;case 1:d=Uint8Array;break;case 2:d=Int16Array;break;case 3:d=Uint16Array;break;case 4:d=Int32Array;break;case 5:d=Uint32Array;break;case 6:d=Float32Array;break;case 7:d=Float64Array;break;default:d=Float32Array}return d},getPixelType:function(c){var d;switch(c){case 0:d="S8";break;case 1:d="U8";break;case 2:d="S16";break;case 3:d="U16";break;case 4:d="S32";break;case 5:d="U32";break;case 6:d="F32";break;case 7:d="F64";break;default:d="F32"}return d},isValidPixelValue:function(c,d){if(d==null)return!1;var u;switch(c){case 0:u=d>=-128&&d<=127;break;case 1:u=d>=0&&d<=255;break;case 2:u=d>=-32768&&d<=32767;break;case 3:u=d>=0&&d<=65536;break;case 4:u=d>=-2147483648&&d<=2147483647;break;case 5:u=d>=0&&d<=4294967296;break;case 6:u=d>=-34027999387901484e22&&d<=34027999387901484e22;break;case 7:u=d>=5e-324&&d<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(c){var d=0;switch(c){case 0:case 1:d=1;break;case 2:case 3:d=2;break;case 4:case 5:case 6:d=4;break;case 7:d=8;break;default:d=c}return d},getDataTypeUsed:function(c,d){var u=c;switch(c){case 2:case 4:u=c-d;break;case 3:case 5:u=c-2*d;break;case 6:d===0?u=c:d===1?u=2:u=1;break;case 7:d===0?u=c:u=c-2*d+1;break;default:u=c;break}return u},getOnePixel:function(c,d,u,h){var p=0;switch(u){case 0:p=h.getInt8(d);break;case 1:p=h.getUint8(d);break;case 2:p=h.getInt16(d,!0);break;case 3:p=h.getUint16(d,!0);break;case 4:p=h.getInt32(d,!0);break;case 5:p=h.getUInt32(d,!0);break;case 6:p=h.getFloat32(d,!0);break;case 7:p=h.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,d,u){this.val=c,this.left=d,this.right=u},a={decode:function(c,d){d=d||{};var u=d.noDataValue,h=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,f=g.fileVersion,y=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var x=g.width*g.height;if(p.pixels.resultPixels=new y(x*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var S=new DataView(c,p.ptr,2),C=S.getUint8(0);if(p.ptr++,C)r.readDataOneSweep(c,p,y);else if(f>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var V=S.getUint8(1);if(p.ptr++,p.encodeMode=V,V>2||f<4&&V>1)throw"Invalid Huffman flag "+V;V?r.readHuffman(c,p,y):r.readTiles(c,p,y)}else r.readTiles(c,p,y)}p.eofOffset=p.ptr;var L;d.inputOffset?(L=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(L)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(L=p.headerInfo.blobSize-p.ptr,Math.abs(L)>=1&&(p.eofOffset=p.headerInfo.blobSize));var Z={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,u)){var E=p.pixels.resultMask;for(h=0;h<x;h++)E[h]||(Z.pixelData[h]=u);Z.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(Z.fileInfo=r.formatFileInfo(p)),Z}},getBandCount:function(c){var d=0,u=0,h={};for(h.ptr=0,h.pixels={};u<c.byteLength-58;)r.readHeaderInfo(c,h),u+=h.headerInfo.blobSize,d++,h.ptr=u;return d}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),d,u;if(c.trim()==="CntZImage")d=e,u=1;else if(c.substring(0,5)==="Lerc2")d=t,u=2;else throw"Unexpected file identifier string: "+c;for(var h=0,p=o.byteLength-10,g,f=[],y,x,S={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var C=d.decode(o,{inputOffset:s,encodedMaskData:g,maskData:x,returnMask:h===0,returnEncodedMask:h===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=C.fileInfo.eofOffset,h===0&&(g=C.encodedMaskData,x=C.maskData,S.width=C.width,S.height=C.height,S.dimCount=C.dimCount||1,S.pixelType=C.pixelType||C.fileInfo.pixelType,S.mask=C.maskData),u>1&&C.fileInfo.mask&&C.fileInfo.mask.numBytes>0&&f.push(C.maskData),h++,S.pixels.push(C.pixelData),S.statistics.push({minValue:C.minValue,maxValue:C.maxValue,noDataValue:C.noDataValue,dimStats:C.dimStats})}var V,L,Z;if(u>1&&f.length>1){for(Z=S.width*S.height,S.bandMasks=f,x=new Uint8Array(Z),x.set(f[0]),V=1;V<f.length;V++)for(y=f[V],L=0;L<Z;L++)x[L]=x[L]&y[L];S.maskData=x}return S}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof h3<"u"&&h3.exports?h3.exports=i:this.Lerc=i})()});var HCe=ad((sGo,zCe)=>{var aGo=_(T());zCe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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mopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVM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AAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var JCe=ad((cGo,KCe)=>{var lGo=_(T()),{webm:lVt,mp4:dVt}=HCe(),aq=()=>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,cq=()=>"wakeLock"in navigator,lq=class{constructor(){if(this.enabled=!1,cq()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else aq()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",lVt),this._addSourceToVideo(this.noSleepVideo,"mp4",dVt),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 cq()?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}):aq()?(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(){cq()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):aq()?this.noSleepTimer&&(console.warn(`
|
|
|
NoSleep now disabled for older iOS devices.
|
|
|
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};KCe.exports=lq});var PVt={};l1e(PVt,{AlphaMode:()=>Gf,AlphaPipelineStage:()=>vP,AnchorPointDirect:()=>UW,AnchorPointIndirect:()=>DW,Animation:()=>_M,AnimationViewModel:()=>TM,Appearance:()=>ao,ApproximateTerrainHeights:()=>ui,ArcGISTiledElevationTerrainProvider:()=>JY,ArcGisBaseMapType:()=>Mh,ArcGisMapServerImageryProvider:()=>m0,ArcGisMapService:()=>$d,ArcType:()=>on,ArticulationStageType:()=>dc,AssociativeArray:()=>It,Atmosphere:()=>sT,AtmospherePipelineStage:()=>fP,AttributeCompression:()=>Fn,AttributeType:()=>an,AutoExposure:()=>CA,AutomaticUniforms:()=>bp,Axis:()=>vo,AxisAlignedBoundingBox:()=>z0,B3dmLoader:()=>tP,B3dmParser:()=>qW,BaseLayerPicker:()=>mM,BaseLayerPickerViewModel:()=>uM,BatchTable:()=>x_,BatchTableHierarchy:()=>U_,BatchTexture:()=>ol,BatchTexturePipelineStage:()=>wP,Billboard:()=>fo,BillboardCollection:()=>vd,BillboardGraphics:()=>gc,BillboardLoadState:()=>as,BillboardTexture:()=>Fb,BillboardVisualizer:()=>OI,BingMapsGeocoderService:()=>jY,BingMapsImageryProvider:()=>Qw,BingMapsStyle:()=>nL,BlendEquation:()=>ka,BlendFunction:()=>Ro,BlendOption:()=>Go,BlendingState:()=>fn,BoundingRectangle:()=>ze,BoundingSphere:()=>de,BoundingSphereState:()=>ut,BoundingVolumeSemantics:()=>iT,BoxEmitter:()=>J7,BoxGeometry:()=>va,BoxGeometryUpdater:()=>HX,BoxGraphics:()=>R_,BoxOutlineGeometry:()=>vm,BrdfLutGenerator:()=>LF,Buffer:()=>Ct,BufferLoader:()=>z_,BufferUsage:()=>ke,CPUStylingPipelineStage:()=>NP,CallbackPositionProperty:()=>KX,CallbackProperty:()=>jm,Camera:()=>lo,CameraEventAggregator:()=>EA,CameraEventType:()=>Mi,CameraFlightPath:()=>ZF,Cartesian2:()=>U,Cartesian3:()=>m,Cartesian4:()=>re,Cartographic:()=>he,CartographicGeocoderService:()=>$Y,CatmullRomSpline:()=>ez,Cesium3DContentGroup:()=>k_,Cesium3DTile:()=>ju,Cesium3DTileBatchTable:()=>hb,Cesium3DTileColorBlendMode:()=>Al,Cesium3DTileContent:()=>Q7,Cesium3DTileContentFactory:()=>xT,Cesium3DTileContentState:()=>Bo,Cesium3DTileContentType:()=>Fs,Cesium3DTileFeature:()=>js,Cesium3DTileFeatureTable:()=>ch,Cesium3DTileOptimizationHint:()=>Ku,Cesium3DTileOptimizations:()=>gv,Cesium3DTilePass:()=>Fo,Cesium3DTilePassState:()=>um,Cesium3DTilePointFeature:()=>Ab,Cesium3DTileRefine:()=>Do,Cesium3DTileStyle:()=>ES,Cesium3DTileStyleEngine:()=>Tv,Cesium3DTilesInspector:()=>LM,Cesium3DTilesInspectorViewModel:()=>VM,Cesium3DTilesVoxelProvider:()=>j7,Cesium3DTileset:()=>Ts,Cesium3DTilesetBaseTraversal:()=>Rv,Cesium3DTilesetCache:()=>yv,Cesium3DTilesetGraphics:()=>P_,Cesium3DTilesetHeatmap:()=>xv,Cesium3DTilesetMetadata:()=>RT,Cesium3DTilesetMostDetailedTraversal:()=>Cv,Cesium3DTilesetSkipTraversal:()=>Ev,Cesium3DTilesetStatistics:()=>xh,Cesium3DTilesetTraversal:()=>ia,Cesium3DTilesetVisualizer:()=>Iv,CesiumInspector:()=>gM,CesiumInspectorViewModel:()=>bM,CesiumTerrainProvider:()=>Xx,CesiumWidget:()=>G9,Check:()=>To,CheckerboardMaterialProperty:()=>iV,CircleEmitter:()=>M9,CircleGeometry:()=>hz,CircleOutlineGeometry:()=>fz,ClassificationModelDrawCommand:()=>X2,ClassificationPipelineStage:()=>FP,ClassificationPrimitive:()=>l1,ClassificationType:()=>On,ClearCommand:()=>ii,ClippingPlane:()=>oT,ClippingPlaneCollection:()=>ys,ClippingPolygon:()=>X1,ClippingPolygonCollection:()=>oh,Clock:()=>Am,ClockRange:()=>Mr,ClockStep:()=>yo,ClockViewModel:()=>lM,CloudCollection:()=>i6,CloudType:()=>NL,Color:()=>D,ColorBlendMode:()=>Cc,ColorGeometryInstanceAttribute:()=>Kt,ColorMaterialProperty:()=>zt,Command:()=>H6,ComponentDatatype:()=>Q,Composite3DTileContent:()=>jX,CompositeEntityCollection:()=>IQ,CompositeMaterialProperty:()=>rV,CompositePositionProperty:()=>Sa,CompositeProperty:()=>Zc,CompressedTextureBuffer:()=>bR,ComputeCommand:()=>Fc,ComputeEngine:()=>pR,ConditionsExpression:()=>v9,ConeEmitter:()=>r6,ConstantPositionProperty:()=>el,ConstantProperty:()=>jn,ConstantSpline:()=>ZE,ContentMetadata:()=>dv,Context:()=>cE,ContextLimits:()=>Dt,CoplanarPolygonGeometry:()=>vE,CoplanarPolygonGeometryLibrary:()=>wp,CoplanarPolygonOutlineGeometry:()=>Vu,CornerType:()=>vi,CorrelationGroup:()=>OW,CorridorGeometry:()=>Nx,CorridorGeometryLibrary:()=>Ui,CorridorGeometryUpdater:()=>Wv,CorridorGraphics:()=>G_,CorridorOutlineGeometry:()=>DE,Credit:()=>Gt,CreditDisplay:()=>XF,CubeMap:()=>Lr,CubeMapFace:()=>RR,CubicRealPolynomial:()=>fx,CullFace:()=>Ti,CullingVolume:()=>bs,CumulusCloud:()=>au,CustomDataSource:()=>wv,CustomHeightmapTerrainProvider:()=>vz,CustomShader:()=>_S,CustomShaderMode:()=>Pb,CustomShaderPipelineStage:()=>zP,CustomShaderTranslucencyMode:()=>Jg,CylinderGeometry:()=>BE,CylinderGeometryLibrary:()=>Ux,CylinderGeometryUpdater:()=>Fv,CylinderGraphics:()=>E_,CylinderOutlineGeometry:()=>YE,CzmlDataSource:()=>Ov,DataSource:()=>Jr,DataSourceClock:()=>Sh,DataSourceCollection:()=>Bv,DataSourceDisplay:()=>mw,DebugAppearance:()=>d6,DebugCameraPrimitive:()=>ep,DebugInspector:()=>AA,DebugModelMatrixPrimitive:()=>U9,DefaultProxy:()=>kz,DepthFunction:()=>yc,DepthPlane:()=>FF,DequantizationPipelineStage:()=>KP,DerivedCommand:()=>tp,DeveloperError:()=>fe,DeviceOrientationCameraController:()=>AF,DirectionalLight:()=>u6,DiscardEmptyTileImagePolicy:()=>iL,DiscardMissingTileImagePolicy:()=>Kw,DistanceDisplayCondition:()=>At,DistanceDisplayConditionGeometryInstanceAttribute:()=>Dn,DoubleEndedPriorityQueue:()=>Ox,DoublyLinkedList:()=>jE,DracoLoader:()=>xb,DrawCommand:()=>$e,DynamicAtmosphereLightingType:()=>Sb,DynamicEnvironmentMapManager:()=>Cb,DynamicGeometryBatch:()=>wT,DynamicGeometryUpdater:()=>si,EarthOrientationParameters:()=>aR,EarthOrientationParametersSample:()=>P0,EasingFunction:()=>kr,EllipseGeometry:()=>Hc,EllipseGeometryLibrary:()=>Wl,EllipseGeometryUpdater:()=>zv,EllipseGraphics:()=>I_,EllipseOutlineGeometry:()=>fd,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>Mp,EllipsoidGeometry:()=>Ks,EllipsoidGeometryUpdater:()=>Kv,EllipsoidGraphics:()=>X_,EllipsoidOutlineGeometry:()=>gd,EllipsoidPrimitive:()=>_F,EllipsoidRhumbLine:()=>Ma,EllipsoidSurfaceAppearance:()=>m6,EllipsoidTangentPlane:()=>$r,EllipsoidTerrainProvider:()=>Bx,EllipsoidalOccluder:()=>Ip,Empty3DTileContent:()=>K1,EncodedCartesian3:()=>Yn,Entity:()=>er,EntityCluster:()=>Md,EntityCollection:()=>oa,EntityView:()=>fw,Event:()=>be,EventHelper:()=>dr,Expression:()=>Mu,ExpressionNodeType:()=>xt,ExtrapolationType:()=>yd,FeatureDetection:()=>Ht,FeatureIdPipelineStage:()=>Kg,Fog:()=>MF,ForEach:()=>We,FrameRateMonitor:()=>B9,FrameState:()=>NF,Framebuffer:()=>Fr,FramebufferManager:()=>pi,Frozen:()=>Y,FrustumCommands:()=>BF,FrustumGeometry:()=>zx,FrustumOutlineGeometry:()=>tI,Fullscreen:()=>Sr,FullscreenButton:()=>ZM,FullscreenButtonViewModel:()=>RM,GeoJsonDataSource:()=>Gy,GeoJsonLoader:()=>nP,GeocodeType:()=>dg,Geocoder:()=>EM,GeocoderService:()=>NC,GeocoderViewModel:()=>GM,GeographicProjection:()=>Ii,GeographicTilingScheme:()=>Ki,Geometry:()=>ht,Geometry3DTileContent:()=>eW,GeometryAttribute:()=>Ze,GeometryAttributes:()=>pn,GeometryFactory:()=>Jz,GeometryInstance:()=>Xt,GeometryInstanceAttribute:()=>uc,GeometryOffsetAttribute:()=>ln,GeometryPipeline:()=>An,GeometryPipelineStage:()=>qP,GeometryType:()=>fu,GeometryUpdater:()=>ai,GeometryUpdaterSet:()=>MT,GeometryVisualizer:()=>tw,GetFeatureInfoFormat:()=>qT,Globe:()=>xF,GlobeDepth:()=>YF,GlobeSurfaceShaderSet:()=>Hw,GlobeSurfaceTile:()=>cm,GlobeSurfaceTileProvider:()=>lF,GlobeTranslucency:()=>dF,GlobeTranslucencyFramebuffer:()=>zF,GlobeTranslucencyState:()=>kF,GltfBufferViewLoader:()=>x1,GltfDracoLoader:()=>_1,GltfGpmLoader:()=>YW,GltfGpmLocal:()=>P1,GltfImageLoader:()=>T1,GltfIndexBufferLoader:()=>S1,GltfJsonLoader:()=>V1,GltfLoader:()=>ah,GltfLoaderUtil:()=>kl,GltfMeshPrimitiveGpmLoader:()=>JW,GltfStructuralMetadataLoader:()=>NW,GltfTextureLoader:()=>L1,GltfVertexBufferLoader:()=>R1,GoogleEarthEnterpriseImageryProvider:()=>f6,GoogleEarthEnterpriseMapsProvider:()=>$w,GoogleEarthEnterpriseMetadata:()=>zp,GoogleEarthEnterpriseTerrainData:()=>kC,GoogleEarthEnterpriseTerrainProvider:()=>iH,GoogleEarthEnterpriseTileInformation:()=>iI,GoogleGeocoderService:()=>rH,GoogleMaps:()=>Kx,GpxDataSource:()=>Fw,GregorianDate:()=>yp,GridImageryProvider:()=>p6,GridMaterialProperty:()=>dV,GroundGeometryUpdater:()=>zn,GroundPolylineGeometry:()=>Jx,GroundPolylinePrimitive:()=>zm,GroundPrimitive:()=>$c,GroupMetadata:()=>eV,HeadingPitchRange:()=>Gu,HeadingPitchRoll:()=>Xa,Heap:()=>iR,HeightReference:()=>Ke,HeightmapEncoding:()=>Tu,HeightmapTerrainData:()=>Fa,HeightmapTessellator:()=>uC,HermitePolynomialApproximation:()=>rI,HermiteSpline:()=>j0,HilbertOrder:()=>UC,HomeButton:()=>WM,HomeButtonViewModel:()=>XM,HorizontalOrigin:()=>_i,I3SBuildingSceneLayerExplorer:()=>nq,I3SBuildingSceneLayerExplorerViewModel:()=>IM,I3SDataProvider:()=>zh,I3SDecoder:()=>Y9,I3SFeature:()=>z9,I3SField:()=>H9,I3SGeometry:()=>kL,I3SLayer:()=>vS,I3SNode:()=>UL,I3SStatistics:()=>Q9,I3SSublayer:()=>q9,I3SSymbology:()=>J9,I3dmLoader:()=>oP,I3dmParser:()=>iP,ITwinData:()=>x6,ITwinPlatform:()=>Xs,Iau2000Orientation:()=>aI,Iau2006XysData:()=>cR,Iau2006XysSample:()=>dx,IauOrientationAxes:()=>cI,IauOrientationParameters:()=>sI,ImageBasedLighting:()=>N_,ImageBasedLightingPipelineStage:()=>bP,ImageMaterialProperty:()=>Eg,Imagery:()=>lL,ImageryLayer:()=>Ja,ImageryLayerCollection:()=>uF,ImageryLayerFeatureInfo:()=>Ah,ImageryProvider:()=>bl,ImageryState:()=>qn,Implicit3DTileContent:()=>E1,ImplicitAvailabilityBitstream:()=>g1,ImplicitMetadataView:()=>y1,ImplicitSubdivisionScheme:()=>os,ImplicitSubtree:()=>tT,ImplicitSubtreeCache:()=>F9,ImplicitSubtreeMetadata:()=>tW,ImplicitTileCoordinates:()=>ET,ImplicitTileset:()=>GT,IndexDatatype:()=>Ne,InfoBox:()=>kM,InfoBoxViewModel:()=>NM,InspectorShared:()=>ja,InstanceAttributeSemantic:()=>ss,InstancingPipelineStage:()=>IP,InterpolationAlgorithm:()=>yH,InterpolationType:()=>Om,Intersect:()=>Jt,IntersectionTests:()=>ei,Intersections2D:()=>Wp,Interval:()=>Pa,InvertClassification:()=>TL,Ion:()=>wm,IonGeocodeProviderType:()=>Kp,IonGeocoderService:()=>Qx,IonImageryProvider:()=>h0,IonResource:()=>hd,IonWorldImageryStyle:()=>f0,Iso8601:()=>Oe,JobScheduler:()=>UF,JobType:()=>Da,JsonMetadataTable:()=>Vb,JulianDate:()=>q,KTX2Transcoder:()=>gR,KeyboardEventModifier:()=>Js,KeyframeNode:()=>_o,KmlCamera:()=>Aw,KmlDataSource:()=>JT,KmlLookAt:()=>Mw,KmlTour:()=>Nw,KmlTourFlyTo:()=>kw,KmlTourWait:()=>Uw,Label:()=>ey,LabelCollection:()=>Pf,LabelGraphics:()=>Km,LabelStyle:()=>Oo,LabelVisualizer:()=>nw,LagrangePolynomialApproximation:()=>uI,LeapSecond:()=>Hi,Light:()=>_6,LightingModel:()=>If,LightingPipelineStage:()=>e2,LinearApproximation:()=>jx,LinearSpline:()=>Q0,ManagedArray:()=>qc,MapMode2D:()=>ed,MapProjection:()=>CH,MapboxImageryProvider:()=>eF,MapboxStyleImageryProvider:()=>T6,Mars3DEx:()=>Ep,Material:()=>Ji,MaterialAppearance:()=>mo,MaterialPipelineStage:()=>n2,MaterialProperty:()=>$o,Math:()=>X,Matrix2:()=>Xi,Matrix3:()=>$,Matrix4:()=>F,Megatexture:()=>IL,MeshPrimitiveGpmLocal:()=>KW,MetadataClass:()=>th,MetadataClassProperty:()=>Lf,MetadataComponentType:()=>Mt,MetadataEntity:()=>kn,MetadataEnum:()=>TW,MetadataEnumValue:()=>_W,MetadataPicking:()=>DF,MetadataPickingPipelineStage:()=>Xd,MetadataPipelineStage:()=>Uu,MetadataSchema:()=>Ed,MetadataSchemaLoader:()=>Z1,MetadataSemantic:()=>nT,MetadataTable:()=>Nu,MetadataTableProperty:()=>iW,MetadataType:()=>mt,MipmapHint:()=>af,Model:()=>uh,Model3DTileContent:()=>Pd,ModelAlphaOptions:()=>_2,ModelAnimation:()=>sP,ModelAnimationChannel:()=>rP,ModelAnimationCollection:()=>aP,ModelAnimationLoop:()=>Dl,ModelAnimationState:()=>lh,ModelArticulation:()=>yP,ModelArticulationStage:()=>gP,ModelClippingPlanesPipelineStage:()=>TP,ModelClippingPolygonsPipelineStage:()=>VP,ModelColorPipelineStage:()=>Hg,ModelComponents:()=>Vn,ModelDrawCommand:()=>W2,ModelDrawCommands:()=>w2,ModelFeature:()=>cP,ModelFeatureTable:()=>dP,ModelGraphics:()=>ab,ModelLightingOptions:()=>G2,ModelMatrixUpdateStage:()=>XP,ModelNode:()=>LP,ModelRenderResources:()=>T2,ModelRuntimeNode:()=>PP,ModelRuntimePrimitive:()=>y2,ModelSceneGraph:()=>F2,ModelSilhouettePipelineStage:()=>V2,ModelSkin:()=>x2,ModelSplitterPipelineStage:()=>R2,ModelStatistics:()=>A2,ModelType:()=>hr,ModelUtility:()=>qt,ModelVisualizer:()=>iw,Moon:()=>SF,MorphTargetsPipelineStage:()=>o2,MorphWeightSpline:()=>ZH,MortonOrder:()=>fg,Multiple3DTileContent:()=>hv,MultisampleFramebuffer:()=>lE,NavigationHelpButton:()=>vM,NavigationHelpButtonViewModel:()=>PM,NearFarScalar:()=>Ot,NeverTileDiscardPolicy:()=>C6,NodeRenderResources:()=>Z2,NodeStatisticsPipelineStage:()=>WP,NodeTransformationProperty:()=>W_,OIT:()=>KF,Occluder:()=>hI,OffsetGeometryInstanceAttribute:()=>io,OpenCageGeocoderService:()=>WH,OpenStreetMapImageryProvider:()=>G0,OrderedGroundPrimitiveCollection:()=>Yv,OrientedBoundingBox:()=>Xn,OrthographicFrustum:()=>un,OrthographicOffCenterFrustum:()=>Ar,Packable:()=>PH,PackableForInterpolation:()=>vH,Particle:()=>BL,ParticleBurst:()=>L6,ParticleEmitter:()=>R6,ParticleSystem:()=>Z6,Pass:()=>Ge,PassState:()=>ac,PathGraphics:()=>cb,PathVisualizer:()=>rw,PeliasGeocoderService:()=>dI,PerInstanceColorAppearance:()=>hn,PerformanceDisplay:()=>g0,PerformanceWatchdog:()=>FM,PerformanceWatchdogViewModel:()=>wM,PerspectiveFrustum:()=>Ci,PerspectiveOffCenterFrustum:()=>Qc,PickDepth:()=>OF,PickDepthFramebuffer:()=>QF,PickFramebuffer:()=>qF,PickedMetadataInfo:()=>l9,Picking:()=>iA,PickingPipelineStage:()=>r2,PinBuilder:()=>Qp,PixelDatatype:()=>je,PixelFormat:()=>ot,Plane:()=>dn,PlaneGeometry:()=>gI,PlaneGeometryUpdater:()=>Jv,PlaneGraphics:()=>kX,PlaneOutlineGeometry:()=>yI,PntsLoader:()=>N2,PntsParser:()=>fT,PointCloud:()=>R9,PointCloudEyeDomeLighting:()=>Rb,PointCloudShading:()=>Ef,PointCloudStylingPipelineStage:()=>a2,PointGraphics:()=>v_,PointPrimitive:()=>As,PointPrimitiveCollection:()=>aV,PointVisualizer:()=>aw,PolygonGeometry:()=>jp,PolygonGeometryLibrary:()=>Un,PolygonGeometryUpdater:()=>Qv,PolygonGraphics:()=>Jm,PolygonHierarchy:()=>Na,PolygonOutlineGeometry:()=>xI,PolygonPipeline:()=>ri,Polyline:()=>Yu,PolylineArrowMaterialProperty:()=>mV,PolylineCollection:()=>fh,PolylineColorAppearance:()=>is,PolylineDashMaterialProperty:()=>fV,PolylineGeometry:()=>qp,PolylineGeometryUpdater:()=>lw,PolylineGlowMaterialProperty:()=>bV,PolylineGraphics:()=>xc,PolylineMaterialAppearance:()=>ya,PolylineOutlineMaterialProperty:()=>dy,PolylinePipeline:()=>wi,PolylineVisualizer:()=>uw,PolylineVolumeGeometry:()=>CI,PolylineVolumeGeometryLibrary:()=>Mm,PolylineVolumeGeometryUpdater:()=>jv,PolylineVolumeGraphics:()=>w_,PolylineVolumeOutlineGeometry:()=>RI,PositionProperty:()=>Hm,PositionPropertyArray:()=>qb,PostProcessStage:()=>go,PostProcessStageCollection:()=>RA,PostProcessStageComposite:()=>nd,PostProcessStageLibrary:()=>iu,PostProcessStageSampleMode:()=>nu,PostProcessStageTextureCache:()=>mS,PpeMetadata:()=>HW,PpeSource:()=>O6,PpeTexture:()=>zW,Primitive:()=>Wn,PrimitiveCollection:()=>ml,PrimitiveLoadPlan:()=>lT,PrimitiveOutlineGenerator:()=>cT,PrimitiveOutlinePipelineStage:()=>d2,PrimitivePipeline:()=>__,PrimitiveRenderResources:()=>E2,PrimitiveState:()=>Gr,PrimitiveStatisticsPipelineStage:()=>u2,PrimitiveType:()=>Ae,ProjectionPicker:()=>DM,ProjectionPickerViewModel:()=>UM,Property:()=>J,PropertyArray:()=>yV,PropertyAttribute:()=>aT,PropertyAttributeProperty:()=>wW,PropertyBag:()=>nl,PropertyTable:()=>sl,PropertyTexture:()=>Lb,PropertyTextureProperty:()=>vW,ProviderViewModel:()=>ds,Proxy:()=>AH,QuadraticRealPolynomial:()=>Ac,QuadtreeOccluders:()=>mF,QuadtreePrimitive:()=>yF,QuadtreeTile:()=>hF,QuadtreeTileLoadState:()=>aa,QuadtreeTileProvider:()=>G6,QuantizedMeshTerrainData:()=>Ix,QuarticRealPolynomial:()=>_R,Quaternion:()=>we,QuaternionSpline:()=>ZI,Queue:()=>ig,Ray:()=>yn,Rectangle:()=>le,RectangleCollisionChecker:()=>o_,RectangleGeometry:()=>r_,RectangleGeometryLibrary:()=>Ws,RectangleGeometryUpdater:()=>qv,RectangleGraphics:()=>Qm,RectangleOutlineGeometry:()=>s_,ReferenceFrame:()=>Di,ReferenceProperty:()=>$b,RenderState:()=>Ue,Renderbuffer:()=>md,RenderbufferFormat:()=>Nc,Request:()=>Ho,RequestErrorEvent:()=>qh,RequestScheduler:()=>oc,RequestState:()=>$n,RequestType:()=>hs,Resource:()=>Re,ResourceCache:()=>Li,ResourceCacheKey:()=>Ul,ResourceCacheStatistics:()=>VW,ResourceLoader:()=>Qi,ResourceLoaderState:()=>_t,Rotation:()=>$u,RuntimeError:()=>ce,S2Cell:()=>$p,SDFSettings:()=>ta,SampledPositionProperty:()=>Ca,SampledProperty:()=>Ud,Sampler:()=>tn,ScaledPositionProperty:()=>Nf,Scene:()=>u9,SceneFramebuffer:()=>rS,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>m2,SceneModePicker:()=>MM,SceneModePickerViewModel:()=>AM,SceneTransforms:()=>Oi,SceneTransitioner:()=>GA,ScreenSpaceCameraController:()=>WA,ScreenSpaceEventHandler:()=>Td,ScreenSpaceEventType:()=>Tn,SelectedFeatureIdPipelineStage:()=>Qg,SelectionIndicator:()=>YM,SelectionIndicatorViewModel:()=>BM,SensorVolumePortionToDisplay:()=>SV,ShaderBuilder:()=>Cx,ShaderCache:()=>iE,ShaderDestination:()=>ge,ShaderFunction:()=>hE,ShaderProgram:()=>nn,ShaderSource:()=>De,ShaderStruct:()=>mE,ShadowMap:()=>_0,ShadowMapShader:()=>op,ShadowMode:()=>Cn,ShadowVolumeAppearance:()=>Cd,ShowGeometryInstanceAttribute:()=>Sn,Simon1994PlanetaryPositions:()=>B0,SimplePolylineGeometry:()=>nK,SingleTileImageryProvider:()=>tF,SkinningPipelineStage:()=>f2,SkyAtmosphere:()=>f9,SkyBox:()=>g9,SpatialNode:()=>s9,Spdcf:()=>BW,SpecularEnvironmentCubeMap:()=>qm,SphereEmitter:()=>I6,SphereGeometry:()=>iK,SphereOutlineGeometry:()=>eb,Spherical:()=>WI,Spline:()=>so,SplitDirection:()=>Br,Splitter:()=>wL,StaticGeometryColorBatch:()=>im,StaticGeometryPerMaterialBatch:()=>om,StaticGroundGeometryColorBatch:()=>PV,StaticGroundGeometryPerMaterialBatch:()=>ew,StaticGroundPolylinePerMaterialBatch:()=>dw,StaticOutlineGeometryBatch:()=>FV,StencilConstants:()=>Yt,StencilFunction:()=>Bn,StencilOperation:()=>pt,SteppedSpline:()=>PI,Stereographic:()=>fc,StorageType:()=>Dg,StripeMaterialProperty:()=>_V,StripeOrientation:()=>Ch,StructuralMetadata:()=>$s,StyleCommandsNeeded:()=>dh,StyleExpression:()=>X6,Sun:()=>C9,SunLight:()=>Zp,SunPostProcess:()=>wA,SupportedImageFormats:()=>kW,SvgPathBindingHandler:()=>aM,TaskProcessor:()=>yi,Terrain:()=>nM,TerrainData:()=>Wm,TerrainEncoding:()=>lc,TerrainFillMesh:()=>hL,TerrainMesh:()=>Cu,TerrainOffsetProperty:()=>F_,TerrainProvider:()=>es,TerrainQuantization:()=>Hs,TerrainState:()=>bo,Texture:()=>vt,TextureAtlas:()=>Vx,TextureCache:()=>oE,TextureMagnificationFilter:()=>fi,TextureManager:()=>n9,TextureMinificationFilter:()=>en,TexturePacker:()=>lC,TextureUniform:()=>U6,TextureWrap:()=>Ln,TileAvailability:()=>Pm,TileBoundingRegion:()=>Fd,TileBoundingS2Cell:()=>pv,TileBoundingSphere:()=>zb,TileBoundingVolume:()=>W6,TileCoordinatesImageryProvider:()=>oM,TileDiscardPolicy:()=>v6,TileEdge:()=>_n,TileImagery:()=>dL,TileMapServiceImageryProvider:()=>wy,TileMetadata:()=>uv,TileOrientedBoundingBox:()=>zl,TileProviderError:()=>Lo,TileReplacementQueue:()=>fF,TileSelectionResult:()=>Qn,TileState:()=>w6,Tileset3DTileContent:()=>D2,TilesetMetadata:()=>bv,TilesetPipelineStage:()=>uP,TilingScheme:()=>oK,TimeConstants:()=>Jn,TimeDynamicImagery:()=>$T,TimeDynamicPointCloud:()=>AL,TimeInterval:()=>Rn,TimeIntervalCollection:()=>Or,TimeIntervalCollectionPositionProperty:()=>e0,TimeIntervalCollectionProperty:()=>t0,TimeStandard:()=>Kn,Timeline:()=>KM,TimelineHighlightRange:()=>zM,TimelineTrack:()=>HM,Tipsify:()=>TR,ToggleButtonViewModel:()=>Ky,Tonemapper:()=>S0,TrackingReferenceFrame:()=>tb,Transforms:()=>Ft,TranslationRotationScale:()=>Vg,TranslucentTileClassification:()=>eA,TridiagonalSystemSolver:()=>gC,TrustedServers:()=>jS,TweenCollection:()=>pS,UniformState:()=>aE,UniformType:()=>GL,UrlTemplateImageryProvider:()=>Ka,VERSION:()=>WVt,VRButton:()=>QM,VRButtonViewModel:()=>JM,VRTheWorldTerrainProvider:()=>lK,VaryingType:()=>D6,Vector3DTileBatch:()=>Cf,Vector3DTileClampedPolylines:()=>cv,Vector3DTileContent:()=>lv,Vector3DTileGeometry:()=>pb,Vector3DTilePoints:()=>tv,Vector3DTilePolygons:()=>nv,Vector3DTilePolylines:()=>yT,Vector3DTilePrimitive:()=>B_,VelocityOrientationProperty:()=>Mv,VelocityVectorProperty:()=>n0,VertexArray:()=>oi,VertexArrayFacade:()=>Gp,VertexAttributeSemantic:()=>yt,VertexFormat:()=>Xe,VerticalExaggeration:()=>Zr,VerticalExaggerationPipelineStage:()=>b2,VerticalOrigin:()=>Mn,VideoSynchronizer:()=>cK,View:()=>cS,Viewer:()=>uq,ViewportQuad:()=>F6,Visibility:()=>ur,Visualizer:()=>t8,VoxelBoxShape:()=>cp,VoxelCell:()=>MA,VoxelContent:()=>TS,VoxelCylinderShape:()=>SS,VoxelEllipsoidShape:()=>CS,VoxelInspector:()=>qM,VoxelInspectorViewModel:()=>jM,VoxelMetadataOrder:()=>pm,VoxelPrimitive:()=>Yy,VoxelProvider:()=>M6,VoxelRenderResources:()=>$A,VoxelShape:()=>N6,VoxelShapeType:()=>Ni,VoxelTraversal:()=>a9,VulkanConstants:()=>dK,WallGeometry:()=>MI,WallGeometryLibrary:()=>h_,WallGeometryUpdater:()=>$v,WallGraphics:()=>lb,WallOutlineGeometry:()=>kI,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>iF,WebMapTileServiceImageryProvider:()=>rF,WebMercatorProjection:()=>Pi,WebMercatorTilingScheme:()=>ts,WindingOrder:()=>fs,WireframeIndexGenerator:()=>i1,WireframePipelineStage:()=>g2,_shadersAcesTonemappingStage:()=>oA,_shadersAdditiveBlend:()=>PA,_shadersAdjustTranslucentFS:()=>SL,_shadersAllMaterialAppearanceFS:()=>BI,_shadersAllMaterialAppearanceVS:()=>YI,_shadersAmbientOcclusionGenerate:()=>rA,_shadersAmbientOcclusionModulate:()=>sA,_shadersAspectRampMaterial:()=>QI,_shadersAtmosphereCommon:()=>rh,_shadersAtmosphereStageFS:()=>mP,_shadersAtmosphereStageVS:()=>hP,_shadersBasicMaterialAppearanceFS:()=>zI,_shadersBasicMaterialAppearanceVS:()=>HI,_shadersBillboardCollectionFS:()=>O2,_shadersBillboardCollectionVS:()=>B2,_shadersBlackAndWhite:()=>aA,_shadersBloomComposite:()=>cA,_shadersBrdfLutGeneratorFS:()=>CF,_shadersBrightPass:()=>vA,_shadersBrightness:()=>lA,_shadersBumpMapMaterial:()=>jI,_shadersCPUStylingStageFS:()=>MP,_shadersCPUStylingStageVS:()=>AP,_shadersCheckerboardMaterial:()=>qI,_shadersCloudCollectionFS:()=>E9,_shadersCloudCollectionVS:()=>I9,_shadersCloudNoiseFS:()=>X9,_shadersCloudNoiseVS:()=>W9,_shadersCompareAndPackTranslucentDepth:()=>$F,_shadersCompositeOITFS:()=>HF,_shadersCompositeTranslucentClassification:()=>aS,_shadersComputeIrradianceFS:()=>ZW,_shadersComputeRadianceMapFS:()=>GW,_shadersContrastBias:()=>dA,_shadersConvolveSpecularMapFS:()=>EW,_shadersConvolveSpecularMapVS:()=>IW,_shadersCustomShaderStageFS:()=>UP,_shadersCustomShaderStageVS:()=>kP,_shadersCzmBuiltins:()=>_x,_shadersDepthOfField:()=>uA,_shadersDepthPlaneFS:()=>WF,_shadersDepthPlaneVS:()=>PF,_shadersDepthView:()=>mA,_shadersDepthViewPacked:()=>k6,_shadersDotMaterial:()=>$I,_shadersEdgeDetection:()=>hA,_shadersElevationBandMaterial:()=>eX,_shadersElevationContourMaterial:()=>tX,_shadersElevationRampMaterial:()=>nX,_shadersEllipsoidFS:()=>pL,_shadersEllipsoidSurfaceAppearanceFS:()=>D9,_shadersEllipsoidSurfaceAppearanceVS:()=>O9,_shadersEllipsoidVS:()=>bL,_shadersFXAA:()=>bA,_shadersFXAA3_11:()=>SA,_shadersFadeMaterial:()=>iX,_shadersFeatureIdStageFS:()=>DP,_shadersFeatureIdStageVS:()=>OP,_shadersFilmicTonemapping:()=>fA,_shadersGaussianBlur1D:()=>Dy,_shadersGeometryStageFS:()=>JP,_shadersGeometryStageVS:()=>QP,_shadersGlobeFS:()=>Yw,_shadersGlobeVS:()=>zw,_shadersGridMaterial:()=>oX,_shadersGroundAtmosphere:()=>$V,_shadersHSBToRGB:()=>nG,_shadersHSLToRGB:()=>iG,_shadersImageBasedLightingStageFS:()=>pP,_shadersInstancingStageCommon:()=>RP,_shadersInstancingStageVS:()=>ZP,_shadersIntersectBox:()=>YA,_shadersIntersectClippingPlanes:()=>BA,_shadersIntersectCylinder:()=>zA,_shadersIntersectDepth:()=>OA,_shadersIntersectEllipsoid:()=>HA,_shadersIntersectLongitude:()=>ZL,_shadersIntersection:()=>yS,_shadersIntersectionUtils:()=>DA,_shadersLegacyInstancingStageVS:()=>GP,_shadersLensFlare:()=>gA,_shadersLightingStageFS:()=>$P,_shadersMaterialStageFS:()=>t2,_shadersMegatexture:()=>qA,_shadersMetadataStageFS:()=>BP,_shadersMetadataStageVS:()=>YP,_shadersModelClippingPlanesStageFS:()=>_P,_shadersModelClippingPolygonsStageFS:()=>CP,_shadersModelClippingPolygonsStageVS:()=>SP,_shadersModelColorStageFS:()=>xP,_shadersModelFS:()=>v2,_shadersModelSilhouetteStageFS:()=>S2,_shadersModelSilhouetteStageVS:()=>C2,_shadersModelSplitterStageFS:()=>L2,_shadersModelVS:()=>P2,_shadersModifiedReinhardTonemapping:()=>yA,_shadersMorphTargetsStageVS:()=>i2,_shadersNightVision:()=>xA,_shadersNormalMapMaterial:()=>rX,_shadersOctree:()=>jA,_shadersPassThrough:()=>td,_shadersPassThroughDepth:()=>Ny,_shadersPbrNeutralTonemapping:()=>pA,_shadersPerInstanceColorAppearanceFS:()=>bX,_shadersPerInstanceColorAppearanceVS:()=>gX,_shadersPerInstanceFlatColorAppearanceFS:()=>y_,_shadersPerInstanceFlatColorAppearanceVS:()=>yX,_shadersPointCloudEyeDomeLighting:()=>QW,_shadersPointCloudStylingStageVS:()=>s2,_shadersPointPrimitiveCollectionFS:()=>ly,_shadersPointPrimitiveCollectionVS:()=>Pv,_shadersPolygonSignedDistanceFS:()=>LW,_shadersPolylineArrowMaterial:()=>sX,_shadersPolylineColorAppearanceVS:()=>ZX,_shadersPolylineCommon:()=>Vd,_shadersPolylineDashMaterial:()=>aX,_shadersPolylineFS:()=>V_,_shadersPolylineGlowMaterial:()=>cX,_shadersPolylineMaterialAppearanceVS:()=>GX,_shadersPolylineOutlineMaterial:()=>lX,_shadersPolylineShadowVolumeFS:()=>CX,_shadersPolylineShadowVolumeMorphFS:()=>VX,_shadersPolylineShadowVolumeMorphVS:()=>LX,_shadersPolylineShadowVolumeVS:()=>RX,_shadersPolylineVS:()=>Q2,_shadersPrimitiveOutlineStageFS:()=>l2,_shadersPrimitiveOutlineStageVS:()=>c2,_shadersRGBToHSB:()=>EG,_shadersRGBToHSL:()=>IG,_shadersRGBToXYZ:()=>XG,_shadersReinhardTonemapping:()=>_A,_shadersReprojectWebMercatorFS:()=>sF,_shadersReprojectWebMercatorVS:()=>aF,_shadersRimLightingMaterial:()=>dX,_shadersSelectedFeatureIdStageCommon:()=>k1,_shadersShadowVolumeAppearanceFS:()=>a1,_shadersShadowVolumeAppearanceVS:()=>xX,_shadersShadowVolumeFS:()=>Gg,_shadersSilhouette:()=>TA,_shadersSkinningStageVS:()=>h2,_shadersSkyAtmosphereCommon:()=>XL,_shadersSkyAtmosphereFS:()=>m9,_shadersSkyAtmosphereVS:()=>h9,_shadersSkyBoxFS:()=>p9,_shadersSkyBoxVS:()=>b9,_shadersSlopeRampMaterial:()=>uX,_shadersStripeMaterial:()=>mX,_shadersSunFS:()=>y9,_shadersSunTextureFS:()=>x9,_shadersSunVS:()=>_9,_shadersTexturedMaterialAppearanceFS:()=>KI,_shadersTexturedMaterialAppearanceVS:()=>JI,_shadersVector3DTileClampedPolylinesFS:()=>sv,_shadersVector3DTileClampedPolylinesVS:()=>rv,_shadersVector3DTilePolylinesVS:()=>iv,_shadersVectorTileVS:()=>b1,_shadersVerticalExaggerationStageVS:()=>p2,_shadersViewportQuadFS:()=>P9,_shadersViewportQuadVS:()=>ux,_shadersVoxelFS:()=>kA,_shadersVoxelUtils:()=>NA,_shadersVoxelVS:()=>UA,_shadersWater:()=>fX,_shadersWaterMaskMaterial:()=>hX,_shadersXYZToRGB:()=>tE,_shadersacesTonemapping:()=>_Z,_shadersalphaWeight:()=>TZ,_shadersantialias:()=>SZ,_shadersapplyHSBShift:()=>CZ,_shadersapproximateSphericalCoordinates:()=>VZ,_shadersapproximateTanh:()=>LZ,_shadersbackFacing:()=>RZ,_shadersbranchFreeTernary:()=>ZZ,_shaderscascadeColor:()=>GZ,_shaderscascadeDistance:()=>EZ,_shaderscascadeMatrix:()=>IZ,_shaderscascadeWeights:()=>XZ,_shadersclipPolygons:()=>WZ,_shaderscolumbusViewMorph:()=>PZ,_shaderscomputeAtmosphereColor:()=>vZ,_shaderscomputeGroundAtmosphereScattering:()=>wZ,_shaderscomputePosition:()=>FZ,_shaderscomputeScattering:()=>AZ,_shadersconvertUvToBox:()=>KA,_shadersconvertUvToCylinder:()=>JA,_shadersconvertUvToEllipsoid:()=>QA,_shaderscosineAndSine:()=>MZ,_shadersdecompressTextureCoordinates:()=>NZ,_shadersdegreesPerRadian:()=>GR,_shadersdepthClamp:()=>kZ,_shadersdepthRange:()=>ER,_shadersdepthRangeStruct:()=>mZ,_shaderseastNorthUpToEyeCoordinates:()=>UZ,_shadersellipsoidContainsPoint:()=>DZ,_shadersellipsoidTextureCoordinates:()=>OZ,_shadersepsilon1:()=>IR,_shadersepsilon2:()=>XR,_shadersepsilon3:()=>WR,_shadersepsilon4:()=>PR,_shadersepsilon5:()=>vR,_shadersepsilon6:()=>wR,_shadersepsilon7:()=>FR,_shadersequalsEpsilon:()=>BZ,_shaderseyeOffset:()=>YZ,_shaderseyeToWindowCoordinates:()=>zZ,_shadersfastApproximateAtan:()=>HZ,_shadersfog:()=>KZ,_shadersgammaCorrect:()=>JZ,_shadersgeodeticSurfaceNormal:()=>QZ,_shadersgetDefaultMaterial:()=>jZ,_shadersgetDynamicAtmosphereLightDirection:()=>qZ,_shadersgetLambertDiffuse:()=>$Z,_shadersgetSpecular:()=>eG,_shadersgetWaterNoise:()=>tG,_shadershue:()=>oG,_shadersinfinity:()=>AR,_shadersinverseGamma:()=>rG,_shadersisEmpty:()=>sG,_shadersisFull:()=>aG,_shaderslatitudeToWebMercatorFraction:()=>cG,_shaderslineDistance:()=>dG,_shaderslinearToSrgb:()=>lG,_shadersluminance:()=>uG,_shadersmaterial:()=>hZ,_shadersmaterialInput:()=>fZ,_shadersmaximumComponent:()=>mG,_shadersmetersPerPixel:()=>hG,_shadersmodelMaterial:()=>pZ,_shadersmodelToWindowCoordinates:()=>fG,_shadersmodelVertexOutput:()=>bZ,_shadersmultiplyWithColorBalance:()=>pG,_shadersnearFarScalar:()=>bG,_shadersoctDecode:()=>gG,_shadersoneOverPi:()=>MR,_shadersoneOverTwoPi:()=>NR,_shaderspackDepth:()=>yG,_shaderspassCesium3DTile:()=>kR,_shaderspassCesium3DTileClassification:()=>UR,_shaderspassCesium3DTileClassificationIgnoreShow:()=>DR,_shaderspassClassification:()=>OR,_shaderspassCompute:()=>BR,_shaderspassEnvironment:()=>YR,_shaderspassGlobe:()=>zR,_shaderspassOpaque:()=>HR,_shaderspassOverlay:()=>KR,_shaderspassTerrainClassification:()=>JR,_shaderspassTranslucent:()=>QR,_shaderspassVoxels:()=>jR,_shaderspbrLighting:()=>xG,_shaderspbrNeutralTonemapping:()=>_G,_shadersphong:()=>TG,_shaderspi:()=>qR,_shaderspiOverFour:()=>$R,_shaderspiOverSix:()=>eZ,_shaderspiOverThree:()=>tZ,_shaderspiOverTwo:()=>nZ,_shadersplaneDistance:()=>SG,_shaderspointAlongRay:()=>CG,_shadersradiansPerDegree:()=>iZ,_shadersray:()=>gZ,_shadersrayEllipsoidIntersectionInterval:()=>VG,_shadersraySegment:()=>yZ,_shadersraySphereIntersectionInterval:()=>LG,_shadersreadDepth:()=>RG,_shadersreadNonPerspective:()=>ZG,_shadersreverseLogDepth:()=>GG,_shadersround:()=>WG,_shaderssaturation:()=>PG,_shaderssceneMode2D:()=>oZ,_shaderssceneMode3D:()=>rZ,_shaderssceneModeColumbusView:()=>sZ,_shaderssceneModeMorphing:()=>aZ,_shadersshadowDepthCompare:()=>vG,_shadersshadowParameters:()=>xZ,_shadersshadowVisibility:()=>wG,_shaderssignNotZero:()=>FG,_shaderssolarRadius:()=>cZ,_shaderssphericalHarmonics:()=>AG,_shaderssrgbToLinear:()=>MG,_shaderstangentToEyeSpaceMatrix:()=>NG,_shaderstextureCube:()=>kG,_shadersthreePiOver2:()=>lZ,_shaderstransformPlane:()=>UG,_shaderstranslateRelativeToEye:()=>DG,_shaderstranslucentPhong:()=>OG,_shaderstranspose:()=>BG,_shaderstwoPi:()=>dZ,_shadersunpackClippingExtents:()=>YG,_shadersunpackDepth:()=>zG,_shadersunpackFloat:()=>HG,_shadersunpackUint:()=>KG,_shadersvalueTransform:()=>JG,_shadersvertexLogDepth:()=>QG,_shaderswebMercatorMaxLatitude:()=>uZ,_shaderswindowToEyeCoordinates:()=>jG,_shaderswriteDepthClamp:()=>qG,_shaderswriteLogDepth:()=>$G,_shaderswriteNonPerspective:()=>eE,addBuffer:()=>mW,addDefaults:()=>oW,addExtensionsRequired:()=>lW,addExtensionsUsed:()=>ku,addPipelineExtras:()=>Fg,addToArray:()=>vs,appendForwardSlash:()=>$L,arrayRemoveDuplicates:()=>Co,barycentricCoordinates:()=>hx,binarySearch:()=>Wo,buildModuleUrl:()=>sn,buildVoxelDrawCommands:()=>t9,clone:()=>Be,combine:()=>Rt,computeFlyToLocationForRectangle:()=>QT,createBillboardPointCallback:()=>bT,createCommand:()=>Zn,createDefaultImageryProviderViewModels:()=>hM,createDefaultTerrainProviderViewModels:()=>fM,createElevationBandMaterial:()=>s6,createGooglePhotorealistic3DTileset:()=>a6,createGuid:()=>Hn,createMaterialPropertyDescriptor:()=>Po,createOsmBuildingsAsync:()=>c6,createPropertyDescriptor:()=>ue,createRawPropertyDescriptor:()=>tl,createTangentSpaceDebugPrimitive:()=>l6,createTaskProcessorWorker:()=>B6,createUniform:()=>mR,createUniformArray:()=>hR,createWorldBathymetryAsync:()=>OE,createWorldImageryAsync:()=>p0,createWorldTerrainAsync:()=>kx,decodeGoogleEarthEnterpriseData:()=>zE,decodeVectorPolylinePositions:()=>HE,defaultValue:()=>Uz,defer:()=>Cl,defined:()=>l,demodernizeShader:()=>nE,deprecationWarning:()=>Is,destroyObject:()=>me,exportKml:()=>uj,findAccessorMinMax:()=>j_,findContentMetadata:()=>_T,findGroupMetadata:()=>TT,findTileMetadata:()=>mv,forEachTextureInMaterial:()=>C1,formatError:()=>hf,freezeRenderState:()=>WB,getAbsoluteUri:()=>Qh,getAccessorByteStride:()=>Nl,getBaseUri:()=>eR,getBinaryAccessor:()=>Rd,getClipAndStyleCode:()=>V9,getClippingFunction:()=>u0,getComponentReader:()=>Tb,getElement:()=>Pn,getExtensionFromUri:()=>nx,getFilenameFromUri:()=>Yp,getImageFromTypedArray:()=>nI,getImagePixels:()=>Cm,getJsonFromTypedArray:()=>Qo,getMagic:()=>Dm,getMetadataClassProperty:()=>c9,getMetadataProperty:()=>d9,getStringFromTypedArray:()=>Xl,getTimestamp:()=>xi,hasExtension:()=>ci,heightReferenceOnEntityPropertyChanged:()=>db,isBitSet:()=>mc,isBlobUri:()=>ix,isCrossOriginUrl:()=>w0,isDataUri:()=>xp,isLeapYear:()=>Sm,knockout:()=>Te,knockout_3_5_1:()=>FS,knockout_es5:()=>sM,loadAndExecuteScript:()=>ox,loadCubeMap:()=>uE,loadImageFromTypedArray:()=>qx,loadKTX2:()=>Ll,mergeSort:()=>Jp,moveTechniqueRenderStates:()=>cW,moveTechniquesToExtension:()=>dW,numberOfComponentsForType:()=>Gd,objectToQuery:()=>rx,oneTimeWarning:()=>Vt,parseBatchTable:()=>Eb,parseFeatureMetadataLegacy:()=>MW,parseGlb:()=>sW,parseResponseHeaders:()=>tR,parseStructuralMetadata:()=>AW,pickModel:()=>O1,pointInsideTriangle:()=>wH,preprocess3DTileContent:()=>Yb,processVoxelProperties:()=>e9,queryToObject:()=>ld,readAccessorPacked:()=>hW,removeExtension:()=>q_,removeExtensionsRequired:()=>rW,removeExtensionsUsed:()=>Q_,removePipelineExtras:()=>aW,removeUnusedElements:()=>uW,resizeImageToNextPowerOfTwo:()=>gg,sampleTerrain:()=>EI,sampleTerrainMostDetailed:()=>c_,scaleToGeodeticSurface:()=>tx,srgbToLinear:()=>u_,subdivideArray:()=>vI,subscribeAndEvaluate:()=>Ea,updateAccessorComponentTypes:()=>fW,updateVersion:()=>pW,usesExtension:()=>mr,viewerCesium3DTilesInspectorMixin:()=>mq,viewerCesiumInspectorMixin:()=>hq,viewerDragDropMixin:()=>pq,viewerPerformanceWatchdogMixin:()=>bq,viewerVoxelInspectorMixin:()=>gq,webGLConstantToGlslType:()=>mK,wrapFunction:()=>UI,writeTextToCanvas:()=>e_});var CIo=_(T(),1);var Nio=_(T(),1);var ELt=_(T(),1);var $Vt=_(T(),1);var YVt=_(T(),1);var MVt=_(T(),1);function u1e(e){return e!=null}var l=u1e;var UVt=_(T(),1);function $y(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&($y.prototype=Object.create(Error.prototype),$y.prototype.constructor=$y);$y.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
|
|
|
${this.stack.toString()}`),e};$y.throwInstantiationError=function(){throw new $y("This function defines an interface and should not be called directly.")};var fe=$y;var Zs={};Zs.typeOf={};function m1e(e){return`${e} is required, actual value was undefined`}function US(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Zs.defined=function(e,t){if(!l(t))throw new fe(m1e(e))};Zs.typeOf.func=function(e,t){if(typeof t!="function")throw new fe(US(typeof t,"function",e))};Zs.typeOf.string=function(e,t){if(typeof t!="string")throw new fe(US(typeof t,"string",e))};Zs.typeOf.number=function(e,t){if(typeof t!="number")throw new fe(US(typeof t,"number",e))};Zs.typeOf.number.lessThan=function(e,t,n){if(Zs.typeOf.number(e,t),t>=n)throw new fe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Zs.typeOf.number.lessThanOrEquals=function(e,t,n){if(Zs.typeOf.number(e,t),t>n)throw new fe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Zs.typeOf.number.greaterThan=function(e,t,n){if(Zs.typeOf.number(e,t),t<=n)throw new fe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Zs.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Zs.typeOf.number(e,t),t<n)throw new fe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};Zs.typeOf.object=function(e,t){if(typeof t!="object")throw new fe(US(typeof t,"object",e))};Zs.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new fe(US(typeof t,"boolean",e))};Zs.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new fe(US(typeof t,"bigint",e))};Zs.typeOf.number.equals=function(e,t,n,i){if(Zs.typeOf.number(e,n),Zs.typeOf.number(t,i),n!==i)throw new fe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var To=Zs;var JVt=_(T(),1),D3=_(tN(),1);var dt={};dt.EPSILON1=.1;dt.EPSILON2=.01;dt.EPSILON3=.001;dt.EPSILON4=1e-4;dt.EPSILON5=1e-5;dt.EPSILON6=1e-6;dt.EPSILON7=1e-7;dt.EPSILON8=1e-8;dt.EPSILON9=1e-9;dt.EPSILON10=1e-10;dt.EPSILON11=1e-11;dt.EPSILON12=1e-12;dt.EPSILON13=1e-13;dt.EPSILON14=1e-14;dt.EPSILON15=1e-15;dt.EPSILON16=1e-16;dt.EPSILON17=1e-17;dt.EPSILON18=1e-18;dt.EPSILON19=1e-19;dt.EPSILON20=1e-20;dt.EPSILON21=1e-21;dt.GRAVITATIONALPARAMETER=3986004418e5;dt.SOLAR_RADIUS=6955e5;dt.LUNAR_RADIUS=1737400;dt.SIXTY_FOUR_KILOBYTES=64*1024;dt.FOUR_GIGABYTES=4*1024*1024*1024;dt.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};dt.signNotZero=function(e){return e<0?-1:1};dt.toSNorm=function(e,t){return t=t??255,Math.round((dt.clamp(e,-1,1)*.5+.5)*t)};dt.fromSNorm=function(e,t){return t=t??255,dt.clamp(e,0,t)/t*2-1};dt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:dt.clamp((e-t)/n,0,1)};dt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};dt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};dt.lerp=function(e,t,n){return(1-n)*e+n*t};dt.PI=Math.PI;dt.ONE_OVER_PI=1/Math.PI;dt.PI_OVER_TWO=Math.PI/2;dt.PI_OVER_THREE=Math.PI/3;dt.PI_OVER_FOUR=Math.PI/4;dt.PI_OVER_SIX=Math.PI/6;dt.THREE_PI_OVER_TWO=3*Math.PI/2;dt.TWO_PI=2*Math.PI;dt.ONE_OVER_TWO_PI=1/(2*Math.PI);dt.RADIANS_PER_DEGREE=Math.PI/180;dt.DEGREES_PER_RADIAN=180/Math.PI;dt.RADIANS_PER_ARCSECOND=dt.RADIANS_PER_DEGREE/3600;dt.toRadians=function(e){return e*dt.RADIANS_PER_DEGREE};dt.toDegrees=function(e){return e*dt.DEGREES_PER_RADIAN};dt.convertLongitudeRange=function(e){let t=dt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};dt.clampToLatitudeRange=function(e){return dt.clamp(e,-1*dt.PI_OVER_TWO,dt.PI_OVER_TWO)};dt.negativePiToPi=function(e){return e>=-dt.PI&&e<=dt.PI?e:dt.zeroToTwoPi(e+dt.PI)-dt.PI};dt.zeroToTwoPi=function(e){if(e>=0&&e<=dt.TWO_PI)return e;let t=dt.mod(e,dt.TWO_PI);return Math.abs(t)<dt.EPSILON14&&Math.abs(e)>dt.EPSILON14?dt.TWO_PI:t};dt.mod=function(e,t){return dt.sign(e)===dt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};dt.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))};dt.lessThan=function(e,t,n){return e-t<-n};dt.lessThanOrEquals=function(e,t,n){return e-t<n};dt.greaterThan=function(e,t,n){return e-t>n};dt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var nN=[1];dt.factorial=function(e){let t=nN.length;if(e>=t){let n=nN[t-1];for(let i=t;i<=e;i++){let o=n*i;nN.push(o),n=o}}return nN[e]};dt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};dt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};dt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};dt.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};dt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var Sq=new D3.default;dt.setRandomNumberSeed=function(e){Sq=new D3.default(e)};dt.nextRandomNumber=function(){return Sq.random()};dt.randomBetween=function(e,t){return dt.nextRandomNumber()*(t-e)+e};dt.acosClamped=function(e){return Math.acos(dt.clamp(e,-1,1))};dt.asinClamped=function(e){return Math.asin(dt.clamp(e,-1,1))};dt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};dt.logBase=function(e,t){return Math.log(e)/Math.log(t)};dt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};dt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};dt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};dt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};dt.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=dt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?dt.PI_OVER_TWO-i:i,i=e<0?dt.PI-i:i,i=t<0?-i:i,i};var X=dt;function tt(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}tt.fromSpherical=function(e,t){l(t)||(t=new tt);let n=e.clock,i=e.cone,o=e.magnitude??1,r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};tt.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new tt(e,t,n)};tt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new tt(e.x,e.y,e.z)};tt.fromCartesian4=tt.clone;tt.packedLength=3;tt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};tt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new tt),n.x=e[t++],n.y=e[t++],n.z=e[t],n};tt.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)tt.pack(e[o],t,o*3);return t};tt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=tt.unpack(e,i,t[o])}return t};tt.fromArray=tt.unpack;tt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};tt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};tt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};tt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};tt.clamp=function(e,t,n,i){let o=X.clamp(e.x,t.x,n.x),r=X.clamp(e.y,t.y,n.y),s=X.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};tt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};tt.magnitude=function(e){return Math.sqrt(tt.magnitudeSquared(e))};var oN=new tt;tt.distance=function(e,t){return tt.subtract(e,t,oN),tt.magnitude(oN)};tt.distanceSquared=function(e,t){return tt.subtract(e,t,oN),tt.magnitudeSquared(oN)};tt.normalize=function(e,t){let n=tt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};tt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};tt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};tt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};tt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};tt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};tt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};tt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};tt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};tt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var Cq=new tt;tt.lerp=function(e,t,n,i){return tt.multiplyByScalar(t,n,Cq),i=tt.multiplyByScalar(e,1-n,i),tt.add(Cq,i,i)};var iN=new tt,O3=new tt;tt.angleBetween=function(e,t){tt.normalize(e,iN),tt.normalize(t,O3);let n=tt.dot(iN,O3),i=tt.magnitude(tt.cross(iN,O3,iN));return Math.atan2(i,n)};var h1e=new tt;tt.mostOrthogonalAxis=function(e,t){let n=tt.normalize(e,h1e);return tt.abs(n,n),n.x<=n.y?n.x<=n.z?t=tt.clone(tt.UNIT_X,t):t=tt.clone(tt.UNIT_Z,t):n.y<=n.z?t=tt.clone(tt.UNIT_Y,t):t=tt.clone(tt.UNIT_Z,t),t};tt.projectVector=function(e,t,n){let i=tt.dot(e,t)/tt.dot(t,t);return tt.multiplyByScalar(t,i,n)};tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};tt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};tt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&X.equalsEpsilon(e.x,t.x,n,i)&&X.equalsEpsilon(e.y,t.y,n,i)&&X.equalsEpsilon(e.z,t.z,n,i)};tt.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,d=o*c-r*a,u=r*s-i*c,h=i*a-o*s;return n.x=d,n.y=u,n.z=h,n};tt.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};tt.fromDegrees=function(e,t,n,i,o){return e=X.toRadians(e),t=X.toRadians(t),tt.fromRadians(e,t,n,i,o)};var uu=new tt,DS=new tt;tt._ellipsoidRadiiSquared=new tt(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);tt.fromRadians=function(e,t,n,i,o){n=n??0;let r=l(i)?i.radiiSquared:tt._ellipsoidRadiiSquared,s=Math.cos(t);uu.x=s*Math.cos(e),uu.y=s*Math.sin(e),uu.z=Math.sin(t),uu=tt.normalize(uu,uu),tt.multiplyComponents(r,uu,DS);let a=Math.sqrt(tt.dot(uu,DS));return DS=tt.divideByScalar(DS,a,DS),uu=tt.multiplyByScalar(uu,n,uu),l(o)||(o=new tt),tt.add(DS,uu,o)};tt.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=tt.fromDegrees(r,s,0,t,n[a])}return n};tt.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=tt.fromRadians(r,s,0,t,n[a])}return n};tt.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=tt.fromDegrees(r,s,a,t,n[c])}return n};tt.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=tt.fromRadians(r,s,a,t,n[c])}return n};tt.ZERO=Object.freeze(new tt(0,0,0));tt.ONE=Object.freeze(new tt(1,1,1));tt.UNIT_X=Object.freeze(new tt(1,0,0));tt.UNIT_Y=Object.freeze(new tt(0,1,0));tt.UNIT_Z=Object.freeze(new tt(0,0,1));tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.prototype.equalsEpsilon=function(e,t,n){return tt.equalsEpsilon(this,e,t,n)};tt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var m=tt;var SLt=_(T(),1);var iLt=_(T(),1);function Lt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}Lt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new Lt(e,t,n,i)};Lt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Lt(e.red,e.green,e.blue,e.alpha)};Lt.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 Lt(e.x,e.y,e.z,e.w)};Lt.packedLength=4;Lt.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};Lt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Lt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};Lt.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)Lt.pack(e[o],t,o*4);return t};Lt.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]=Lt.unpack(e,i,t[o])}return t};Lt.fromArray=Lt.unpack;Lt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};Lt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};Lt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};Lt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};Lt.clamp=function(e,t,n,i){let o=X.clamp(e.x,t.x,n.x),r=X.clamp(e.y,t.y,n.y),s=X.clamp(e.z,t.z,n.z),a=X.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};Lt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};Lt.magnitude=function(e){return Math.sqrt(Lt.magnitudeSquared(e))};var rN=new Lt;Lt.distance=function(e,t){return Lt.subtract(e,t,rN),Lt.magnitude(rN)};Lt.distanceSquared=function(e,t){return Lt.subtract(e,t,rN),Lt.magnitudeSquared(rN)};Lt.normalize=function(e,t){let n=Lt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};Lt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};Lt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};Lt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};Lt.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};Lt.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};Lt.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};Lt.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};Lt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};Lt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var Vq=new Lt;Lt.lerp=function(e,t,n,i){return Lt.multiplyByScalar(t,n,Vq),i=Lt.multiplyByScalar(e,1-n,i),Lt.add(Vq,i,i)};var f1e=new Lt;Lt.mostOrthogonalAxis=function(e,t){let n=Lt.normalize(e,f1e);return Lt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=Lt.clone(Lt.UNIT_X,t):t=Lt.clone(Lt.UNIT_W,t):n.z<=n.w?t=Lt.clone(Lt.UNIT_Z,t):t=Lt.clone(Lt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=Lt.clone(Lt.UNIT_Y,t):t=Lt.clone(Lt.UNIT_W,t):n.z<=n.w?t=Lt.clone(Lt.UNIT_Z,t):t=Lt.clone(Lt.UNIT_W,t),t};Lt.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};Lt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};Lt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&X.equalsEpsilon(e.x,t.x,n,i)&&X.equalsEpsilon(e.y,t.y,n,i)&&X.equalsEpsilon(e.z,t.z,n,i)&&X.equalsEpsilon(e.w,t.w,n,i)};Lt.ZERO=Object.freeze(new Lt(0,0,0,0));Lt.ONE=Object.freeze(new Lt(1,1,1,1));Lt.UNIT_X=Object.freeze(new Lt(1,0,0,0));Lt.UNIT_Y=Object.freeze(new Lt(0,1,0,0));Lt.UNIT_Z=Object.freeze(new Lt(0,0,1,0));Lt.UNIT_W=Object.freeze(new Lt(0,0,0,1));Lt.prototype.clone=function(e){return Lt.clone(this,e)};Lt.prototype.equals=function(e){return Lt.equals(this,e)};Lt.prototype.equalsEpsilon=function(e,t,n){return Lt.equalsEpsilon(this,e,t,n)};Lt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var B3=new Float32Array(1),tc=new Uint8Array(B3.buffer),p1e=new Uint32Array([287454020]),b1e=new Uint8Array(p1e.buffer),Lq=b1e[0]===68;Lt.packFloat=function(e,t){return l(t)||(t=new Lt),B3[0]=e,Lq?(t.x=tc[0],t.y=tc[1],t.z=tc[2],t.w=tc[3]):(t.x=tc[3],t.y=tc[2],t.z=tc[1],t.w=tc[0]),t};Lt.unpackFloat=function(e){return Lq?(tc[0]=e.x,tc[1]=e.y,tc[2]=e.z,tc[3]=e.w):(tc[0]=e.w,tc[1]=e.z,tc[2]=e.y,tc[3]=e.x),B3[0]};var re=Lt;var rLt=_(T(),1),Y3={};Y3.EMPTY_OBJECT=Object.freeze({});Y3.EMPTY_ARRAY=Object.freeze([]);var Y=Y3;var dLt=_(T(),1);function it(e,t,n,i,o,r,s,a,c){this[0]=e??0,this[1]=i??0,this[2]=s??0,this[3]=t??0,this[4]=o??0,this[5]=a??0,this[6]=n??0,this[7]=r??0,this[8]=c??0}it.packedLength=9;it.pack=function(e,t,n){return n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};it.unpack=function(e,t,n){return t=t??0,l(n)||(n=new it),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};it.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)it.pack(e[o],t,o*9);return t};it.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]=it.unpack(e,i,t[o])}return t};it.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new it(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};it.fromArray=it.unpack;it.fromColumnMajorArray=function(e,t){return it.clone(e,t)};it.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 it(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};it.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,d=e.z*e.z,u=e.z*e.w,h=e.w*e.w,p=n-s-d+h,g=2*(i-u),f=2*(o+c),y=2*(i+u),x=-n+s-d+h,S=2*(a-r),C=2*(o-c),V=2*(a+r),L=-n-s+d+h;return l(t)?(t[0]=p,t[1]=y,t[2]=C,t[3]=g,t[4]=x,t[5]=V,t[6]=f,t[7]=S,t[8]=L,t):new it(p,g,f,y,x,S,C,V,L)};it.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,d=-o*s+a*r*i,u=a*s+o*r*i,h=n*s,p=o*i+a*r*s,g=-a*i+o*r*s,f=-r,y=a*n,x=o*n;return l(t)?(t[0]=c,t[1]=h,t[2]=f,t[3]=d,t[4]=p,t[5]=y,t[6]=u,t[7]=g,t[8]=x,t):new it(c,d,u,h,p,g,f,y,x)};it.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 it(e.x,0,0,0,e.y,0,0,0,e.z)};it.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 it(e,0,0,0,e,0,0,0,e)};it.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 it(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};it.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 it(1,0,0,0,n,-i,0,i,n)};it.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 it(n,0,i,0,1,0,-i,0,n)};it.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 it(n,-i,0,i,n,0,0,0,1)};it.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};it.getElementIndex=function(e,t){return e*3+t};it.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};it.setColumn=function(e,t,n,i){i=it.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};it.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};it.setRow=function(e,t,n,i){return i=it.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var g1e=new m;it.setScale=function(e,t,n){let i=it.getScale(e,g1e),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var y1e=new m;it.setUniformScale=function(e,t,n){let i=it.getScale(e,y1e),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var z3=new m;it.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],z3)),t.y=m.magnitude(m.fromElements(e[3],e[4],e[5],z3)),t.z=m.magnitude(m.fromElements(e[6],e[7],e[8],z3)),t};var Rq=new m;it.getMaximumScale=function(e){return it.getScale(e,Rq),m.maximumComponent(Rq)};var x1e=new m;it.setRotation=function(e,t,n){let i=it.getScale(e,x1e);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 _1e=new m;it.getRotation=function(e,t){let n=it.getScale(e,_1e);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};it.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],d=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],u=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=d,n[7]=u,n[8]=h,n};it.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};it.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};it.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};it.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};it.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};it.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};it.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};it.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],d=e[5],u=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=d,t[8]=u,t};function T1e(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var H3=[1,0,0],K3=[2,2,1];function S1e(e){let t=0;for(let n=0;n<3;++n){let i=e[it.getElementIndex(K3[n],H3[n])];t+=2*i*i}return Math.sqrt(t)}function C1e(e,t){let n=X.EPSILON15,i=0,o=1;for(let d=0;d<3;++d){let u=Math.abs(e[it.getElementIndex(K3[d],H3[d])]);u>i&&(o=d,i=u)}let r=1,s=0,a=H3[o],c=K3[o];if(Math.abs(e[it.getElementIndex(c,a)])>n){let d=e[it.getElementIndex(c,c)],u=e[it.getElementIndex(a,a)],h=e[it.getElementIndex(c,a)],p=(d-u)/2/h,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=it.clone(it.IDENTITY,t),t[it.getElementIndex(a,a)]=t[it.getElementIndex(c,c)]=r,t[it.getElementIndex(c,a)]=s,t[it.getElementIndex(a,c)]=-s,t}var sN=new it,Zq=new it;it.computeEigenDecomposition=function(e,t){let n=X.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=it.clone(it.IDENTITY,t.unitary),a=t.diagonal=it.clone(e,t.diagonal),c=n*T1e(a);for(;r<i&&S1e(a)>c;)C1e(a,sN),it.transpose(sN,Zq),it.multiply(a,sN,a),it.multiply(Zq,a,a),it.multiply(s,sN,s),++o>2&&(++r,o=0);return t};it.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};it.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],d=e[8];return t*(r*d-c*s)+o*(c*i-n*d)+a*(n*s-r*i)};it.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],d=e[7],u=e[8],h=it.determinant(e);t[0]=s*u-d*a,t[1]=d*o-i*u,t[2]=i*a-s*o,t[3]=c*a-r*u,t[4]=n*u-c*o,t[5]=r*o-n*a,t[6]=r*d-c*s,t[7]=c*i-n*d,t[8]=n*s-r*i;let p=1/h;return it.multiplyByScalar(t,p,t)};var V1e=new it;it.inverseTranspose=function(e,t){return it.inverse(it.transpose(e,V1e),t)};it.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]};it.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};it.IDENTITY=Object.freeze(new it(1,0,0,0,1,0,0,0,1));it.ZERO=Object.freeze(new it(0,0,0,0,0,0,0,0,0));it.COLUMN0ROW0=0;it.COLUMN0ROW1=1;it.COLUMN0ROW2=2;it.COLUMN1ROW0=3;it.COLUMN1ROW1=4;it.COLUMN1ROW2=5;it.COLUMN2ROW0=6;it.COLUMN2ROW1=7;it.COLUMN2ROW2=8;Object.defineProperties(it.prototype,{length:{get:function(){return it.packedLength}}});it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
|
|
|
(${this[1]}, ${this[4]}, ${this[7]})
|
|
|
(${this[2]}, ${this[5]}, ${this[8]})`};var $=it;var hLt=_(T(),1);function QL(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(QL.prototype=Object.create(Error.prototype),QL.prototype.constructor=QL);QL.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
|
|
|
${this.stack.toString()}`),e};var ce=QL;function nt(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,y){this[0]=e??0,this[1]=o??0,this[2]=c??0,this[3]=p??0,this[4]=t??0,this[5]=r??0,this[6]=d??0,this[7]=g??0,this[8]=n??0,this[9]=s??0,this[10]=u??0,this[11]=f??0,this[12]=i??0,this[13]=a??0,this[14]=h??0,this[15]=y??0}nt.packedLength=16;nt.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};nt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new nt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};nt.packArray=function(e,t){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)nt.pack(e[o],t,o*16);return t};nt.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]=nt.unpack(e,i,t[o])}return t};nt.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 nt(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};nt.fromArray=nt.unpack;nt.fromColumnMajorArray=function(e,t){return nt.clone(e,t)};nt.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 nt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};nt.fromRotationTranslation=function(e,t,n){return t=t??m.ZERO,l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new nt(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};nt.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new nt);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,d=t.x*t.z,u=t.x*t.w,h=t.y*t.y,p=t.y*t.z,g=t.y*t.w,f=t.z*t.z,y=t.z*t.w,x=t.w*t.w,S=a-h-f+x,C=2*(c-y),V=2*(d+g),L=2*(c+y),Z=-a+h-f+x,E=2*(p-u),P=2*(d-g),W=2*(p+u),v=-a-h+f+x;return i[0]=S*o,i[1]=L*o,i[2]=P*o,i[3]=0,i[4]=C*r,i[5]=Z*r,i[6]=W*r,i[7]=0,i[8]=V*s,i[9]=E*s,i[10]=v*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};nt.fromTranslationRotationScale=function(e,t){return nt.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};nt.fromTranslation=function(e,t){return nt.fromRotationTranslation($.IDENTITY,e,t)};nt.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 nt(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};nt.fromUniformScale=function(e,t){return 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 nt(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};nt.fromRotation=function(e,t){return l(t)||(t=new nt),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var OS=new m,BS=new m,jL=new m;nt.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;m.normalize(i,OS),m.normalize(m.cross(OS,o,BS),BS),m.normalize(m.cross(BS,OS,jL),jL);let r=BS.x,s=BS.y,a=BS.z,c=OS.x,d=OS.y,u=OS.z,h=jL.x,p=jL.y,g=jL.z,f=n.x,y=n.y,x=n.z,S=r*-f+s*-y+a*-x,C=h*-f+p*-y+g*-x,V=c*f+d*y+u*x;return l(t)?(t[0]=r,t[1]=h,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-d,t[7]=0,t[8]=a,t[9]=g,t[10]=-u,t[11]=0,t[12]=S,t[13]=C,t[14]=V,t[15]=1,t):new nt(r,s,a,S,h,p,g,C,-c,-d,-u,V,0,0,0,1)};nt.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),d=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o};nt.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),d=1/(r-o),u=-(t+e)*a,h=-(i+n)*c,p=-(r+o)*d;return a*=2,c*=2,d*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=d,s[11]=0,s[12]=u,s[13]=h,s[14]=p,s[15]=1,s};nt.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),d=(t+e)/(t-e),u=(i+n)/(i-n),h=-(r+o)/(r-o),p=-1,g=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=d,s[9]=u,s[10]=h,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};nt.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),d=(i+n)/(i-n),u=-1,h=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=d,r[10]=u,r[11]=h,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};nt.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new nt),e=e??Y.EMPTY_OBJECT;let o=e.x??0,r=e.y??0,s=e.width??0,a=e.height??0;t=t??0,n=n??1;let c=s*.5,d=a*.5,u=(n-t)*.5,h=c,p=d,g=u,f=o+c,y=r+d,x=t+u,S=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=f,i[13]=y,i[14]=x,i[15]=S,i};nt.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-m.dot(i,e),o[13]=-m.dot(n,e),o[14]=m.dot(t,e),o[15]=1,o};nt.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]]};nt.getElementIndex=function(e,t){return e*4+t};nt.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};nt.setColumn=function(e,t,n,i){i=nt.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};nt.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};nt.setRow=function(e,t,n,i){return i=nt.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};nt.setTranslation=function(e,t,n){return 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 L1e=new m;nt.setScale=function(e,t,n){let i=nt.getScale(e,L1e),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var R1e=new m;nt.setUniformScale=function(e,t,n){let i=nt.getScale(e,R1e),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var J3=new m;nt.getScale=function(e,t){return t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],J3)),t.y=m.magnitude(m.fromElements(e[4],e[5],e[6],J3)),t.z=m.magnitude(m.fromElements(e[8],e[9],e[10],J3)),t};var Gq=new m;nt.getMaximumScale=function(e){return nt.getScale(e,Gq),m.maximumComponent(Gq)};var Z1e=new m;nt.setRotation=function(e,t,n){let i=nt.getScale(e,Z1e);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 G1e=new m;nt.getRotation=function(e,t){let n=nt.getScale(e,G1e);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};nt.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],d=e[6],u=e[7],h=e[8],p=e[9],g=e[10],f=e[11],y=e[12],x=e[13],S=e[14],C=e[15],V=t[0],L=t[1],Z=t[2],E=t[3],P=t[4],W=t[5],v=t[6],A=t[7],b=t[8],R=t[9],G=t[10],I=t[11],w=t[12],M=t[13],O=t[14],k=t[15],B=i*V+a*L+h*Z+y*E,N=o*V+c*L+p*Z+x*E,z=r*V+d*L+g*Z+S*E,K=s*V+u*L+f*Z+C*E,te=i*P+a*W+h*v+y*A,H=o*P+c*W+p*v+x*A,j=r*P+d*W+g*v+S*A,ee=s*P+u*W+f*v+C*A,pe=i*b+a*R+h*G+y*I,_e=o*b+c*R+p*G+x*I,ae=r*b+d*R+g*G+S*I,ye=s*b+u*R+f*G+C*I,Se=i*w+a*M+h*O+y*k,Ee=o*w+c*M+p*O+x*k,Ie=r*w+d*M+g*O+S*k,Fe=s*w+u*M+f*O+C*k;return n[0]=B,n[1]=N,n[2]=z,n[3]=K,n[4]=te,n[5]=H,n[6]=j,n[7]=ee,n[8]=pe,n[9]=_e,n[10]=ae,n[11]=ye,n[12]=Se,n[13]=Ee,n[14]=Ie,n[15]=Fe,n};nt.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};nt.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};nt.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],d=e[8],u=e[9],h=e[10],p=e[12],g=e[13],f=e[14],y=t[0],x=t[1],S=t[2],C=t[4],V=t[5],L=t[6],Z=t[8],E=t[9],P=t[10],W=t[12],v=t[13],A=t[14],b=i*y+s*x+d*S,R=o*y+a*x+u*S,G=r*y+c*x+h*S,I=i*C+s*V+d*L,w=o*C+a*V+u*L,M=r*C+c*V+h*L,O=i*Z+s*E+d*P,k=o*Z+a*E+u*P,B=r*Z+c*E+h*P,N=i*W+s*v+d*A+p,z=o*W+a*v+u*A+g,K=r*W+c*v+h*A+f;return n[0]=b,n[1]=R,n[2]=G,n[3]=0,n[4]=I,n[5]=w,n[6]=M,n[7]=0,n[8]=O,n[9]=k,n[10]=B,n[11]=0,n[12]=N,n[13]=z,n[14]=K,n[15]=1,n};nt.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],d=e[8],u=e[9],h=e[10],p=t[0],g=t[1],f=t[2],y=t[3],x=t[4],S=t[5],C=t[6],V=t[7],L=t[8],Z=i*p+s*g+d*f,E=o*p+a*g+u*f,P=r*p+c*g+h*f,W=i*y+s*x+d*S,v=o*y+a*x+u*S,A=r*y+c*x+h*S,b=i*C+s*V+d*L,R=o*C+a*V+u*L,G=r*C+c*V+h*L;return n[0]=Z,n[1]=E,n[2]=P,n[3]=0,n[4]=W,n[5]=v,n[6]=A,n[7]=0,n[8]=b,n[9]=R,n[10]=G,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};nt.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};nt.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?nt.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};nt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};nt.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,d=e[2]*i+e[6]*o+e[10]*r+e[14]*s,u=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=d,n.w=u,n};nt.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};nt.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};nt.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};nt.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};nt.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};nt.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};nt.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]};nt.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};nt.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};nt.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 E1e=new $,I1e=new $,X1e=new re,W1e=new re(0,0,0,1);nt.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],d=e[13],u=e[2],h=e[6],p=e[10],g=e[14],f=e[3],y=e[7],x=e[11],S=e[15],C=p*S,V=g*x,L=h*S,Z=g*y,E=h*x,P=p*y,W=u*S,v=g*f,A=u*x,b=p*f,R=u*y,G=h*f,I=C*a+Z*c+E*d-(V*a+L*c+P*d),w=V*s+W*c+b*d-(C*s+v*c+A*d),M=L*s+v*a+R*d-(Z*s+W*a+G*d),O=P*s+A*a+G*c-(E*s+b*a+R*c),k=V*i+L*o+P*r-(C*i+Z*o+E*r),B=C*n+v*o+A*r-(V*n+W*o+b*r),N=Z*n+W*i+G*r-(L*n+v*i+R*r),z=E*n+b*i+R*o-(P*n+A*i+G*o);C=o*d,V=r*c,L=i*d,Z=r*a,E=i*c,P=o*a,W=n*d,v=r*s,A=n*c,b=o*s,R=n*a,G=i*s;let K=C*y+Z*x+E*S-(V*y+L*x+P*S),te=V*f+W*x+b*S-(C*f+v*x+A*S),H=L*f+v*y+R*S-(Z*f+W*y+G*S),j=P*f+A*y+G*x-(E*f+b*y+R*x),ee=L*p+P*g+V*h-(E*g+C*h+Z*p),pe=A*g+C*u+v*p-(W*p+b*g+V*u),_e=W*h+G*g+Z*u-(R*g+L*u+v*h),ae=R*p+E*u+b*h-(A*h+G*p+P*u),ye=n*I+i*w+o*M+r*O;if(Math.abs(ye)<X.EPSILON21){if($.equalsEpsilon(nt.getMatrix3(e,E1e),I1e,X.EPSILON7)&&re.equals(nt.getRow(e,3,X1e),W1e))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 ce("matrix is not invertible because its determinate is zero.")}return ye=1/ye,t[0]=I*ye,t[1]=w*ye,t[2]=M*ye,t[3]=O*ye,t[4]=k*ye,t[5]=B*ye,t[6]=N*ye,t[7]=z*ye,t[8]=K*ye,t[9]=te*ye,t[10]=H*ye,t[11]=j*ye,t[12]=ee*ye,t[13]=pe*ye,t[14]=_e*ye,t[15]=ae*ye,t};nt.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],d=e[9],u=e[10],h=e[12],p=e[13],g=e[14],f=-n*h-i*p-o*g,y=-r*h-s*p-a*g,x=-c*h-d*p-u*g;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=d,t[7]=0,t[8]=o,t[9]=a,t[10]=u,t[11]=0,t[12]=f,t[13]=y,t[14]=x,t[15]=1,t};var P1e=new nt;nt.inverseTranspose=function(e,t){return nt.inverse(nt.transpose(e,P1e),t)};nt.IDENTITY=Object.freeze(new nt(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));nt.ZERO=Object.freeze(new nt(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));nt.COLUMN0ROW0=0;nt.COLUMN0ROW1=1;nt.COLUMN0ROW2=2;nt.COLUMN0ROW3=3;nt.COLUMN1ROW0=4;nt.COLUMN1ROW1=5;nt.COLUMN1ROW2=6;nt.COLUMN1ROW3=7;nt.COLUMN2ROW0=8;nt.COLUMN2ROW1=9;nt.COLUMN2ROW2=10;nt.COLUMN2ROW3=11;nt.COLUMN3ROW0=12;nt.COLUMN3ROW1=13;nt.COLUMN3ROW2=14;nt.COLUMN3ROW3=15;Object.defineProperties(nt.prototype,{length:{get:function(){return nt.packedLength}}});nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};nt.prototype.equalsEpsilon=function(e,t){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
|
|
|
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
|
|
|
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
|
|
|
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var F=nt;var VLt=_(T(),1),v1e={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},ie=Object.freeze(v1e);var w1e=new m;function Wt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var fa={};fa[ie.FLOAT]="float";fa[ie.FLOAT_VEC2]="vec2";fa[ie.FLOAT_VEC3]="vec3";fa[ie.FLOAT_VEC4]="vec4";fa[ie.INT]="int";fa[ie.INT_VEC2]="ivec2";fa[ie.INT_VEC3]="ivec3";fa[ie.INT_VEC4]="ivec4";fa[ie.BOOL]="bool";fa[ie.BOOL_VEC2]="bvec2";fa[ie.BOOL_VEC3]="bvec3";fa[ie.BOOL_VEC4]="bvec4";fa[ie.FLOAT_MAT2]="mat2";fa[ie.FLOAT_MAT3]="mat3";fa[ie.FLOAT_MAT4]="mat4";fa[ie.SAMPLER_2D]="sampler2D";fa[ie.SAMPLER_CUBE]="samplerCube";Wt.prototype.getDeclaration=function(e){let t=`uniform ${fa[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var F1e={czm_viewport:new Wt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Wt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Wt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Wt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Wt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Wt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Wt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Wt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Wt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Wt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Wt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Wt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Wt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Wt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Wt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Wt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,w1e)}}),czm_frameNumber:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Wt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Wt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Wt({size:1,datatype:ie.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Wt({size:1,datatype:ie.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Wt({size:9,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Wt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Wt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Wt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Wt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},bp=F1e;var JLt=_(T(),1);var XLt=_(T(),1);function A1e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Hn=A1e;var PLt=_(T(),1);function M1e(){return!0}function N1e(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=M1e}var me=N1e;var MLt=_(T(),1);var Os={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT};Os.getSizeInBytes=function(e){switch(e){case Os.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Os.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Os.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Os.fromSizeInBytes=function(e){switch(e){case 2:return Os.UNSIGNED_SHORT;case 4:return Os.UNSIGNED_INT;case 1:return Os.UNSIGNED_BYTE}};Os.validate=function(e){return l(e)&&(e===Os.UNSIGNED_BYTE||e===Os.UNSIGNED_SHORT||e===Os.UNSIGNED_INT)};Os.createTypedArray=function(e,t){return e>=X.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Os.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=X.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Os.fromTypedArray=function(e){if(e instanceof Uint8Array)return Os.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Os.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Os.UNSIGNED_INT};var Ne=Object.freeze(Os);var ULt=_(T(),1);var aN={STREAM_DRAW:ie.STREAM_DRAW,STATIC_DRAW:ie.STATIC_DRAW,DYNAMIC_DRAW:ie.DYNAMIC_DRAW,validate:function(e){return e===aN.STREAM_DRAW||e===aN.STATIC_DRAW||e===aN.DYNAMIC_DRAW}},ke=Object.freeze(aN);function mu(e){e=e??Y.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Hn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}mu.createVertexBuffer=function(e){return new mu({context:e.context,bufferTarget:ie.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};mu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ne.getSizeInBytes(n),o=new mu({context:t,bufferTarget:ie.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(mu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});mu.prototype._getBuffer=function(){return this._buffer};mu.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)};mu.prototype.copyFromBuffer=function(e,t,n,i){let o=ie.COPY_READ_BUFFER,r=ie.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};mu.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=ie.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};mu.prototype.isDestroyed=function(){return!1};mu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),me(this)};var Ct=mu;var mRt=_(T(),1);var cRt=_(T(),1);var nRt=_(T(),1);var qLt=_(T(),1);var W0,vr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Sl={};Object.defineProperties(Sl,{element:{get:function(){if(Sl.supportsFullscreen())return document[vr.fullscreenElement]}},changeEventName:{get:function(){if(Sl.supportsFullscreen())return vr.fullscreenchange}},errorEventName:{get:function(){if(Sl.supportsFullscreen())return vr.fullscreenerror}},enabled:{get:function(){if(Sl.supportsFullscreen())return document[vr.fullscreenEnabled]}},fullscreen:{get:function(){if(Sl.supportsFullscreen())return Sl.element!==null}}});Sl.supportsFullscreen=function(){if(l(W0))return W0;W0=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return vr.requestFullscreen="requestFullscreen",vr.exitFullscreen="exitFullscreen",vr.fullscreenEnabled="fullscreenEnabled",vr.fullscreenElement="fullscreenElement",vr.fullscreenchange="fullscreenchange",vr.fullscreenerror="fullscreenerror",W0=!0,W0;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(vr.requestFullscreen=n,W0=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(vr.requestFullscreen=n,W0=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?vr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(vr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?vr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(vr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?vr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(vr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),vr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),vr.fullscreenerror=n)}return W0};Sl.requestFullscreen=function(e,t){Sl.supportsFullscreen()&&e[vr.requestFullscreen]({vrDisplay:t})};Sl.exitFullscreen=function(){Sl.supportsFullscreen()&&document[vr.exitFullscreen]()};Sl._names=vr;var Sr=Sl;var nc;typeof navigator<"u"?nc=navigator:nc={};function ex(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var cN,Eq;function tB(){if(!l(cN)&&(cN=!1,!fN())){let e=/ Chrome\/([\.0-9]+)/.exec(nc.userAgent);e!==null&&(cN=!0,Eq=ex(e[1]))}return cN}function k1e(){return tB()&&Eq}var lN,Iq;function Xq(){if(!l(lN)&&(lN=!1,!tB()&&!fN()&&/ Safari\/[\.0-9]+/.test(nc.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(nc.userAgent);e!==null&&(lN=!0,Iq=ex(e[1]))}return lN}function U1e(){return Xq()&&Iq}var dN,$3;function Wq(){if(!l(dN)){dN=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(nc.userAgent);e!==null&&(dN=!0,$3=ex(e[1]),$3.isNightly=!!e[2])}return dN}function D1e(){return Wq()&&$3}var qL,eB;function Pq(){if(!l(qL)){qL=!1;let e;nc.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(nc.userAgent),e!==null&&(qL=!0,eB=ex(e[1]))):nc.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(nc.userAgent),e!==null&&(qL=!0,eB=ex(e[1])))}return qL}function O1e(){return Pq()&&eB}var uN,vq;function fN(){if(!l(uN)){uN=!1;let e=/ Edg\/([\.0-9]+)/.exec(nc.userAgent);e!==null&&(uN=!0,vq=ex(e[1]))}return uN}function B1e(){return fN()&&vq}var mN,nB;function pN(){if(!l(mN)){mN=!1;let e=/Firefox\/([\.0-9]+)/.exec(nc.userAgent);e!==null&&(mN=!0,nB=ex(e[1]))}return mN}var Q3;function Y1e(){return l(Q3)||(Q3=/Windows/i.test(nc.appVersion)),Q3}var j3;function z1e(){return l(j3)||(j3=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),j3}function H1e(){return pN()&&nB}var q3;function K1e(){return l(q3)||(q3=!pN()&&typeof PointerEvent<"u"&&(!l(nc.pointerEnabled)||nc.pointerEnabled)),q3}var wq,hN;function Fq(){if(!l(hN)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;hN=l(t)&&t!=="",hN&&(wq=t)}return hN}function J1e(){return Fq()?wq:void 0}function wc(){return wc._result}wc._promise=void 0;wc._result=void 0;wc.initialize=function(){return l(wc._promise)||(wc._promise=new Promise(e=>{let t=new Image;t.onload=function(){wc._result=t.width>0&&t.height>0,e(wc._result)},t.onerror=function(){wc._result=!1,e(wc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),wc._promise};Object.defineProperties(wc,{initialized:{get:function(){return l(wc._result)}}});var YS=[];typeof ArrayBuffer<"u"&&(YS.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&YS.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&YS.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&YS.push(BigInt64Array),typeof BigUint64Array<"u"&&YS.push(BigUint64Array));var hu={isChrome:tB,chromeVersion:k1e,isSafari:Xq,safariVersion:U1e,isWebkit:Wq,webkitVersion:D1e,isInternetExplorer:Pq,internetExplorerVersion:O1e,isEdge:fN,edgeVersion:B1e,isFirefox:pN,firefoxVersion:H1e,isWindows:Y1e,isIPadOrIOS:z1e,hardwareConcurrency:nc.hardwareConcurrency??3,supportsPointerEvents:K1e,supportsImageRenderingPixelated:Fq,supportsWebP:wc,imageRenderingValue:J1e,typedArrayTypes:YS};hu.supportsBasis=function(e){return hu.supportsWebAssembly()&&e.context.supportsBasis};hu.supportsFullscreen=function(){return Sr.supportsFullscreen()};hu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};hu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};hu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};hu.supportsBigInt=function(){return typeof BigInt<"u"};hu.supportsWebWorkers=function(){return typeof Worker<"u"};hu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};hu.supportsWebgl2=function(e){return e.context.webgl2};hu.supportsEsmWebWorkers=function(){return!pN()||parseInt(nB)>=114};var Ht=hu;function iB(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 oB,rB,gp;Ht.supportsTypedArrays()&&(oB=new ArrayBuffer(4),rB=new Uint32Array(oB),gp=new Uint8Array(oB));se.fromRgba=function(e,t){return rB[0]=e,se.fromBytes(gp[0],gp[1],gp[2],gp[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,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let d=2*n-c;r=iB(d,c,e+1/3),s=iB(d,c,e),a=iB(d,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new se(r,s,a,i)};se.fromRandom=function(e,t){e=e??Y.EMPTY_OBJECT;let n=e.red;if(!l(n)){let s=e.minimumRed??0,a=e.maximumRed??1;n=s+X.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;i=s+X.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;o=s+X.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;r=s+X.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new se(n,i,o,r)};var Q1e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,j1e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,q1e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,$1e=/^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=Q1e.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=j1e.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=q1e.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=$1e.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.prototype.toRgba=function(){return gp[0]=se.floatToByte(this.red),gp[1]=se.floatToByte(this.green),gp[2]=se.floatToByte(this.blue),gp[3]=se.floatToByte(this.alpha),rB[0]};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=X.lerp(e.red,t.red,n),i.green=X.lerp(e.green,t.green,n),i.blue=X.lerp(e.blue,t.blue,n),i.alpha=X.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 D=se;function bN(e){e=e??Y.EMPTY_OBJECT,this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}bN.ALL=Object.freeze(new bN({color:new D(0,0,0,0),depth:1,stencil:0}));bN.prototype.execute=function(e,t){e.clear(this,t)};var ii=bN;var yRt=_(T(),1);var fRt=_(T(),1),eVe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Ge=Object.freeze(eVe);function Aq(e){e=e??Y.EMPTY_OBJECT,this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=e.persists??!1,this.pass=Ge.COMPUTE,this.owner=e.owner}Aq.prototype.execute=function(e){e.execute(this)};var Fc=Aq;var hWt=_(T(),1);var vIt=_(T(),1);var SRt=_(T(),1);function Ut(e,t){this.x=e??0,this.y=t??0}Ut.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Ut(e,t)};Ut.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Ut(e.x,e.y)};Ut.fromCartesian3=Ut.clone;Ut.fromCartesian4=Ut.clone;Ut.packedLength=2;Ut.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n]=e.y,t};Ut.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ut),n.x=e[t++],n.y=e[t],n};Ut.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Ut.pack(e[o],t,o*2);return t};Ut.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Ut.unpack(e,i,t[o])}return t};Ut.fromArray=Ut.unpack;Ut.maximumComponent=function(e){return Math.max(e.x,e.y)};Ut.minimumComponent=function(e){return Math.min(e.x,e.y)};Ut.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Ut.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Ut.clamp=function(e,t,n,i){let o=X.clamp(e.x,t.x,n.x),r=X.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Ut.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Ut.magnitude=function(e){return Math.sqrt(Ut.magnitudeSquared(e))};var gN=new Ut;Ut.distance=function(e,t){return Ut.subtract(e,t,gN),Ut.magnitude(gN)};Ut.distanceSquared=function(e,t){return Ut.subtract(e,t,gN),Ut.magnitudeSquared(gN)};Ut.normalize=function(e,t){let n=Ut.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Ut.dot=function(e,t){return e.x*t.x+e.y*t.y};Ut.cross=function(e,t){return e.x*t.y-e.y*t.x};Ut.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Ut.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Ut.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Ut.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Ut.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Ut.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Ut.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Ut.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var Mq=new Ut;Ut.lerp=function(e,t,n,i){return Ut.multiplyByScalar(t,n,Mq),i=Ut.multiplyByScalar(e,1-n,i),Ut.add(Mq,i,i)};var Nq=new Ut,kq=new Ut;Ut.angleBetween=function(e,t){return Ut.normalize(e,Nq),Ut.normalize(t,kq),X.acosClamped(Ut.dot(Nq,kq))};var tVe=new Ut;Ut.mostOrthogonalAxis=function(e,t){let n=Ut.normalize(e,tVe);return Ut.abs(n,n),n.x<=n.y?t=Ut.clone(Ut.UNIT_X,t):t=Ut.clone(Ut.UNIT_Y,t),t};Ut.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Ut.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Ut.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&X.equalsEpsilon(e.x,t.x,n,i)&&X.equalsEpsilon(e.y,t.y,n,i)};Ut.ZERO=Object.freeze(new Ut(0,0));Ut.ONE=Object.freeze(new Ut(1,1));Ut.UNIT_X=Object.freeze(new Ut(1,0));Ut.UNIT_Y=Object.freeze(new Ut(0,1));Ut.prototype.clone=function(e){return Ut.clone(this,e)};Ut.prototype.equals=function(e){return Ut.equals(this,e)};Ut.prototype.equalsEpsilon=function(e,t,n){return Ut.equalsEpsilon(this,e,t,n)};Ut.prototype.toString=function(){return`(${this.x}, ${this.y})`};var U=Ut;var PRt=_(T(),1);var ZRt=_(T(),1);var nVe=new m,iVe=new m;function oVe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,d=t.y,u=t.z,h=r*r*c*c,p=s*s*d*d,g=a*a*u*u,f=h+p+g,y=Math.sqrt(1/f),x=m.multiplyByScalar(e,y,nVe);if(f<i)return isFinite(y)?m.clone(x,o):void 0;let S=n.x,C=n.y,V=n.z,L=iVe;L.x=x.x*S*2,L.y=x.y*C*2,L.z=x.z*V*2;let Z=(1-y)*m.magnitude(e)/(.5*m.magnitude(L)),E=0,P,W,v,A,b,R,G,I,w,M,O;do{Z-=E,v=1/(1+Z*S),A=1/(1+Z*C),b=1/(1+Z*V),R=v*v,G=A*A,I=b*b,w=R*v,M=G*A,O=I*b,P=h*R+p*G+g*I-1,W=h*w*S+p*M*C+g*O*V;let k=-2*W;E=P/k}while(Math.abs(P)>X.EPSILON12);return l(o)?(o.x=r*v,o.y=s*A,o.z=a*b,o):new m(r*v,s*A,a*b)}var tx=oVe;function Mo(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}Mo.fromRadians=function(e,t,n,i){return n=n??0,l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Mo(e,t,n)};Mo.fromDegrees=function(e,t,n,i){return e=X.toRadians(e),t=X.toRadians(t),Mo.fromRadians(e,t,n,i)};var rVe=new m,sVe=new m,aVe=new m;Mo._ellipsoidOneOverRadii=new m(1/6378137,1/6378137,1/6356752314245179e-9);Mo._ellipsoidOneOverRadiiSquared=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Mo._ellipsoidCenterToleranceSquared=X.EPSILON1;Mo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:Mo._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:Mo._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:Mo._ellipsoidCenterToleranceSquared,s=tx(e,i,o,r,sVe);if(!l(s))return;let a=m.multiplyComponents(s,o,rVe);a=m.normalize(a,a);let c=m.subtract(e,s,aVe),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),h=X.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=d,n.latitude=u,n.height=h,n):new Mo(d,u,h)};Mo.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Mo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Mo(e.longitude,e.latitude,e.height)};Mo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Mo.equalsEpsilon=function(e,t,n){return n=n??0,e===t||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};Mo.ZERO=Object.freeze(new Mo(0,0,0));Mo.prototype.clone=function(e){return Mo.clone(this,e)};Mo.prototype.equals=function(e){return Mo.equals(this,e)};Mo.prototype.equalsEpsilon=function(e,t){return Mo.equalsEpsilon(this,e,t)};Mo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=Mo;var URt=_(T(),1);function Dq(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=X.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function gi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Dq(this,e,t,n)}Object.defineProperties(gi.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}}});gi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new gi(n.x,n.y,n.z)};gi.fromCartesian3=function(e,t){return l(t)||(t=new gi),l(e)&&Dq(t,e.x,e.y,e.z),t};gi.WGS84=Object.freeze(new gi(6378137,6378137,6356752314245179e-9));gi.UNIT_SPHERE=Object.freeze(new gi(1,1,1));gi.MOON=Object.freeze(new gi(X.LUNAR_RADIUS,X.LUNAR_RADIUS,X.LUNAR_RADIUS));gi._default=gi.WGS84;Object.defineProperties(gi,{default:{get:function(){return gi._default},set:function(e){gi._default=e,m._ellipsoidRadiiSquared=e.radiiSquared,he._ellipsoidOneOverRadii=e.oneOverRadii,he._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});gi.prototype.clone=function(e){return gi.clone(this,e)};gi.packedLength=m.packedLength;gi.pack=function(e,t,n){return n=n??0,m.pack(e._radii,t,n),t};gi.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t);return gi.fromCartesian3(i,n)};gi.prototype.geocentricSurfaceNormal=m.normalize;gi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=r,t.y=s,t.z=a,m.normalize(t,t)};gi.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,X.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var cVe=new m,lVe=new m;gi.prototype.cartographicToCartesian=function(e,t){let n=cVe,i=lVe;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,o,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};gi.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 dVe=new m,uVe=new m,mVe=new m;gi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,uVe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,dVe),o=m.subtract(e,n,mVe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=X.sign(m.dot(o,e))*m.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new he(r,s,a)};gi.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};gi.prototype.scaleToGeodeticSurface=function(e,t){return tx(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};gi.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new m);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return m.multiplyByScalar(e,s,t)};gi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._oneOverRadii,t)};gi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new m),m.multiplyComponents(e,this._radii,t)};gi.prototype.equals=function(e){return this===e||l(e)&&m.equals(this._radii,e._radii)};gi.prototype.toString=function(){return this._radii.toString()};gi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=t??0;let i=this._squaredXOverSquaredZ;if(l(n)||(n=new m),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var hVe=new m;gi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new U);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,hVe),i=m.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return U.fromElements(1/i,1/r,t)};var fVe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],pVe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Uq(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*fVe[s];r+=pVe[s]*(n(i+a)+n(i-a))}return r*=o,r}gi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=X.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,d=s*a;return Uq(i,o,function(u){let h=Math.cos(u),p=Math.sin(u);return Math.cos(u)*Uq(t,n,function(g){let f=Math.cos(g),y=Math.sin(g);return Math.sqrt(d*p*p+c*(a*f*f+s*y*y)*h*h)})})};var ne=gi;var HRt=_(T(),1);function yN(e){this._ellipsoid=e??ne.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(yN.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});yN.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};yN.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Ii=yN;var JRt=_(T(),1),bVe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Jt=Object.freeze(bVe);var LIt=_(T(),1);var bIt=_(T(),1);var SEt=_(T(),1);var jRt=_(T(),1);function gVe(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Wo=gVe;var $Rt=_(T(),1);function yVe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var P0=yVe;var TZt=_(T(),1);var sZt=_(T(),1);var tZt=_(T(),1);function xVe(e){return e%4===0&&e%100!==0||e%400===0}var Sm=xVe;var Oq=[31,28,31,30,31,30,31,31,30,31,30,31];function _Ve(e,t,n,i,o,r,s,a){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,s=s??0,a=a??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function y(){To.typeOf.number.greaterThanOrEquals("Year",e,1),To.typeOf.number.lessThanOrEquals("Year",e,9999),To.typeOf.number.greaterThanOrEquals("Month",t,1),To.typeOf.number.lessThanOrEquals("Month",t,12),To.typeOf.number.greaterThanOrEquals("Day",n,1),To.typeOf.number.lessThanOrEquals("Day",n,31),To.typeOf.number.greaterThanOrEquals("Hour",i,0),To.typeOf.number.lessThanOrEquals("Hour",i,23),To.typeOf.number.greaterThanOrEquals("Minute",o,0),To.typeOf.number.lessThanOrEquals("Minute",o,59),To.typeOf.bool("IsLeapSecond",a),To.typeOf.number.greaterThanOrEquals("Second",r,0),To.typeOf.number.lessThanOrEquals("Second",r,a?60:59),To.typeOf.number.greaterThanOrEquals("Millisecond",s,0),To.typeOf.number.lessThan("Millisecond",s,1e3)}function x(){let S=t===2&&Sm(e)?Oq[t-1]+1:Oq[t-1];if(n>S)throw new fe("Month and Day represents invalid date")}}var yp=_Ve;var cZt=_(T(),1);function TVe(e,t){this.julianDate=e,this.offset=t}var Hi=TVe;var dZt=_(T(),1),SVe={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},Jn=Object.freeze(SVe);var mZt=_(T(),1),CVe={UTC:0,TAI:1},Kn=Object.freeze(CVe);var Yq=new yp,sB=[31,28,31,30,31,30,31,31,30,31,30,31],aB=29;function cB(e,t){return wt.compare(e.julianDate,t.julianDate)}var zS=new Hi;function _N(e){zS.julianDate=e;let t=wt.leapSeconds,n=Wo(t,zS,cB);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&wt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),wt.addSeconds(e,i,e)}function Bq(e,t){zS.julianDate=e;let n=wt.leapSeconds,i=Wo(n,zS,cB);if(i<0&&(i=~i),i===0)return wt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return wt.addSeconds(e,-n[i-1].offset,t);let o=wt.secondsDifference(n[i].julianDate,e);if(o===0)return wt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return wt.addSeconds(e,-n[--i].offset,t)}function v0(e,t,n){let i=t/Jn.SECONDS_PER_DAY|0;return e+=i,t-=Jn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Jn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function lB(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,d=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*Jn.SECONDS_PER_HOUR+o*Jn.SECONDS_PER_MINUTE+s*Jn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var VVe=/^(\d{4})$/,LVe=/^(\d{4})-(\d{2})$/,RVe=/^(\d{4})-?(\d{3})$/,ZVe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,GVe=/^(\d{4})-?(\d{2})-?(\d{2})$/,dB=/([Z+\-])?(\d{2})?:?(\d{2})?$/,EVe=/^(\d{2})(\.\d+)?/.source+dB.source,IVe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+dB.source,XVe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+dB.source;function wt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??Kn.UTC;let i=e|0;t=t+(e-i)*Jn.SECONDS_PER_DAY,v0(i,t,this),n===Kn.UTC&&_N(this)}wt.fromGregorianDate=function(e,t){let n=lB(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(v0(n[0],n[1],t),_N(t),t):new wt(n[0],n[1],Kn.UTC)};wt.fromDate=function(e,t){let n=lB(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(v0(n[0],n[1],t),_N(t),t):new wt(n[0],n[1],Kn.UTC)};wt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,d=0,u=n[0],h=n[1],p,g;if(n=u.match(GVe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=u.match(LVe),n!==null)i=+n[1],o=+n[2];else if(n=u.match(VVe),n!==null)i=+n[1];else{let S;if(n=u.match(RVe),n!==null)i=+n[1],S=+n[2],g=Sm(i);else if(n=u.match(ZVe),n!==null){i=+n[1];let C=+n[2],V=+n[3]||0,L=new Date(Date.UTC(i,0,4));S=C*7+V-L.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(S),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=Sm(i);let f;if(l(h)){n=h.match(XVe),n!==null?(s=+n[1],a=+n[2],c=+n[3],d=+(n[4]||0)*1e3,f=5):(n=h.match(IVe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,f=4):(n=h.match(EVe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,f=3)));let S=n[f],C=+n[f+1],V=+(n[f+2]||0);switch(S){case"+":s=s-C,a=a-V;break;case"-":s=s+C,a=a+V;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let y=c===60;for(y&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?aB:sB[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?aB:sB[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?aB:sB[o-1],r+=p;let x=lB(i,o,r,s,a,c,d);return l(t)?(v0(x[0],x[1],t),_N(t)):t=new wt(x[0],x[1],Kn.UTC),y&&wt.addSeconds(t,1,t),t};wt.now=function(e){return wt.fromDate(new Date,e)};var xN=new wt(0,0,Kn.TAI);wt.toGregorianDate=function(e,t){let n=!1,i=Bq(e,xN);l(i)||(wt.addSeconds(e,-1,xN),i=Bq(xN,xN),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;let h=d+2-12*s|0,p=100*(a-49)+c+s|0,g=r/Jn.SECONDS_PER_HOUR|0,f=r-g*Jn.SECONDS_PER_HOUR,y=f/Jn.SECONDS_PER_MINUTE|0;f=f-y*Jn.SECONDS_PER_MINUTE;let x=f|0,S=(f-x)/Jn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(x+=1),l(t)?(t.year=p,t.month=h,t.day=u,t.hour=g,t.minute=y,t.second=x,t.millisecond=S,t.isLeapSecond=n,t):new yp(p,h,u,g,y,x,S,n)};wt.toDate=function(e){let t=wt.toGregorianDate(e,Yq),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};wt.toIso8601=function(e,t){let n=wt.toGregorianDate(e,Yq),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,d=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&d===0&&(i=9999,o=12,r=31,s=24);let u;if(!l(t)&&d!==0){let h=d*.01;return u=h<1e-6?h.toFixed(20).replace(".","").replace(/0+$/,""):h.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`}return!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(u=(d*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`)};wt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new wt(e.dayNumber,e.secondsOfDay,Kn.TAI)};wt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};wt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};wt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(wt.secondsDifference(e,t))<=n};wt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Jn.SECONDS_PER_DAY};wt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Jn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};wt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Jn.SECONDS_PER_DAY;return n+i};wt.computeTaiMinusUtc=function(e){zS.julianDate=e;let t=wt.leapSeconds,n=Wo(t,zS,cB);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};wt.addSeconds=function(e,t,n){return v0(e.dayNumber,e.secondsOfDay+t,n)};wt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Jn.SECONDS_PER_MINUTE;return v0(e.dayNumber,i,n)};wt.addHours=function(e,t,n){let i=e.secondsOfDay+t*Jn.SECONDS_PER_HOUR;return v0(e.dayNumber,i,n)};wt.addDays=function(e,t,n){let i=e.dayNumber+t;return v0(i,e.secondsOfDay,n)};wt.lessThan=function(e,t){return wt.compare(e,t)<0};wt.lessThanOrEquals=function(e,t){return wt.compare(e,t)<=0};wt.greaterThan=function(e,t){return wt.compare(e,t)>0};wt.greaterThanOrEquals=function(e,t){return wt.compare(e,t)>=0};wt.prototype.clone=function(e){return wt.clone(this,e)};wt.prototype.equals=function(e){return wt.equals(this,e)};wt.prototype.equalsEpsilon=function(e,t){return wt.equalsEpsilon(this,e,t)};wt.prototype.toString=function(){return wt.toIso8601(this)};wt.leapSeconds=[new Hi(new wt(2441317,43210,Kn.TAI),10),new Hi(new wt(2441499,43211,Kn.TAI),11),new Hi(new wt(2441683,43212,Kn.TAI),12),new Hi(new wt(2442048,43213,Kn.TAI),13),new Hi(new wt(2442413,43214,Kn.TAI),14),new Hi(new wt(2442778,43215,Kn.TAI),15),new Hi(new wt(2443144,43216,Kn.TAI),16),new Hi(new wt(2443509,43217,Kn.TAI),17),new Hi(new wt(2443874,43218,Kn.TAI),18),new Hi(new wt(2444239,43219,Kn.TAI),19),new Hi(new wt(2444786,43220,Kn.TAI),20),new Hi(new wt(2445151,43221,Kn.TAI),21),new Hi(new wt(2445516,43222,Kn.TAI),22),new Hi(new wt(2446247,43223,Kn.TAI),23),new Hi(new wt(2447161,43224,Kn.TAI),24),new Hi(new wt(2447892,43225,Kn.TAI),25),new Hi(new wt(2448257,43226,Kn.TAI),26),new Hi(new wt(2448804,43227,Kn.TAI),27),new Hi(new wt(2449169,43228,Kn.TAI),28),new Hi(new wt(2449534,43229,Kn.TAI),29),new Hi(new wt(2450083,43230,Kn.TAI),30),new Hi(new wt(2450630,43231,Kn.TAI),31),new Hi(new wt(2451179,43232,Kn.TAI),32),new Hi(new wt(2453736,43233,Kn.TAI),33),new Hi(new wt(2454832,43234,Kn.TAI),34),new Hi(new wt(2456109,43235,Kn.TAI),35),new Hi(new wt(2457204,43236,Kn.TAI),36),new Hi(new wt(2457754,43237,Kn.TAI),37)];var q=wt;var dEt=_(T(),1),d$=_(cd(),1);var ZZt=_(T(),1);function WVe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var $L=WVe;var EZt=_(T(),1);function qq(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=qq(o,t)),n[i]=o}return n}var Be=qq;var WZt=_(T(),1);function $q(e,t,n){n=n??!1;let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=$q(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Rt=$q;var vZt=_(T(),1);function PVe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Cl=PVe;var AZt=_(T(),1),e$=_(cd(),1);function uB(e,t){let n;return typeof document<"u"&&(n=document),uB._implementation(e,t,n)}uB._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new e$.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Qh=uB;var NZt=_(T(),1),t$=_(cd(),1);function vVe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new t$.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var eR=vVe;var UZt=_(T(),1),n$=_(cd(),1);function wVe(e){let t=new n$.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 nx=wVe;var BZt=_(T(),1);var i$={};function FVe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=i$[t];l(i)||(i={},i$[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 Cm=FVe;var zZt=_(T(),1);var AVe=/^blob:/i;function MVe(e){return AVe.test(e)}var ix=MVe;var JZt=_(T(),1);var jh;function NVe(e){l(jh)||(jh=document.createElement("a")),jh.href=window.location.href;let t=jh.host,n=jh.protocol;return jh.href=e,jh.href=jh.href,n!==jh.protocol||t!==jh.host}var w0=NVe;var jZt=_(T(),1);var kVe=/^data:/i;function UVe(e){return kVe.test(e)}var xp=UVe;var $Zt=_(T(),1);function DVe(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 ox=DVe;var tGt=_(T(),1);function OVe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var rx=OVe;var oGt=_(T(),1);function BVe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var ld=BVe;var fGt=_(T(),1);var sGt=_(T(),1),YVe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},$n=Object.freeze(YVe);var cGt=_(T(),1),zVe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},hs=Object.freeze(zVe);function VN(e){e=e??Y.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??hs.OTHER,this.serverKey=e.serverKey,this.state=$n.UNISSUED,this.deferred=void 0,this.cancelled=!1}VN.prototype.cancel=function(){this.cancelled=!0};VN.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=$n.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new VN(this)};var Ho=VN;var _Gt=_(T(),1);var bGt=_(T(),1);function HVe(e){let t={};if(!e)return t;let n=e.split(`\r
|
|
|
`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var tR=HVe;function o$(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=tR(this.responseHeaders))}o$.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var qh=o$;var wGt=_(T(),1),LN=_(cd(),1);var CGt=_(T(),1);function nR(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(nR.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});nR.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};nR.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function KVe(e,t){return t-e}nR.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];l(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(KVe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var be=nR;var RGt=_(T(),1);function sx(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(sx.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 mB(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}sx.prototype.reserve=function(e){e=e??this._length,this._array.length=e};sx.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(mB(i,o,e),e=o):r=!1}};sx.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};sx.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)mB(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};sx.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return mB(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var iR=sx;function JVe(e,t){return e.priority-t.priority}var oo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},JS=20,ic=new iR({comparator:JVe});ic.maximumLength=JS;ic.reserve(JS);var $h=[],_p={},QVe=typeof document<"u"?new LN.default(document.location.href):new LN.default,RN=new be;function Ko(){}Ko.maximumRequests=50;Ko.maximumRequestsPerServer=18;Ko.requestsByServer={};Ko.throttleRequests=!0;Ko.debugShowStatistics=!1;Ko.requestCompletedEvent=RN;Object.defineProperties(Ko,{statistics:{get:function(){return oo}},priorityHeapLength:{get:function(){return JS},set:function(e){if(e<JS)for(;ic.length>e;){let t=ic.pop();ax(t)}JS=e,ic.maximumLength=e,ic.reserve(e)}}});function r$(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Ko.serverHasOpenSlots=function(e,t){t=t??1;let n=Ko.requestsByServer[e]??Ko.maximumRequestsPerServer;return _p[e]+t<=n};Ko.heapHasOpenSlots=function(e){return ic.length+e<=JS};function s$(e){return e.state===$n.UNISSUED&&(e.state=$n.ISSUED,e.deferred=Cl()),e.deferred.promise}function jVe(e){return function(t){if(e.state===$n.CANCELLED)return;let n=e.deferred;--oo.numberOfActiveRequests,--_p[e.serverKey],RN.raiseEvent(),e.state=$n.RECEIVED,e.deferred=void 0,n.resolve(t)}}function qVe(e){return function(t){e.state!==$n.CANCELLED&&(++oo.numberOfFailedRequests,--oo.numberOfActiveRequests,--_p[e.serverKey],RN.raiseEvent(t),e.state=$n.FAILED,e.deferred.reject(t))}}function a$(e){let t=s$(e);return e.state=$n.ACTIVE,$h.push(e),++oo.numberOfActiveRequests,++oo.numberOfActiveRequestsEver,++_p[e.serverKey],e.requestFunction().then(jVe(e)).catch(qVe(e)),t}function ax(e){let t=e.state===$n.ACTIVE;if(e.state=$n.CANCELLED,++oo.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--oo.numberOfActiveRequests,--_p[e.serverKey],++oo.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Ko.update=function(){let e,t,n=0,i=$h.length;for(e=0;e<i;++e){if(t=$h[e],t.cancelled&&ax(t),t.state!==$n.ACTIVE){++n;continue}n>0&&($h[e-n]=t)}$h.length-=n;let o=ic.internalArray,r=ic.length;for(e=0;e<r;++e)r$(o[e]);ic.resort();let s=Math.max(Ko.maximumRequests-$h.length,0),a=0;for(;a<s&&ic.length>0;){if(t=ic.pop(),t.cancelled){ax(t);continue}if(t.throttleByServer&&!Ko.serverHasOpenSlots(t.serverKey)){ax(t);continue}a$(t),++a}$Ve()};Ko.getServerKey=function(e){let t=new LN.default(e);t.scheme()===""&&(t=t.absoluteTo(QVe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=_p[n];return l(i)||(_p[n]=0),n};Ko.request=function(e){if(xp(e.url)||ix(e.url))return RN.raiseEvent(),e.state=$n.RECEIVED,e.requestFunction();if(++oo.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Ko.getServerKey(e.url)),Ko.throttleRequests&&e.throttleByServer&&!Ko.serverHasOpenSlots(e.serverKey))return;if(!Ko.throttleRequests||!e.throttle)return a$(e);if($h.length>=Ko.maximumRequests)return;r$(e);let t=ic.insert(e);if(l(t)){if(t===e)return;ax(t)}return s$(e)};function $Ve(){Ko.debugShowStatistics&&(oo.numberOfActiveRequests===0&&oo.lastNumberOfActiveRequests>0&&(oo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${oo.numberOfAttemptedRequests}`),oo.numberOfAttemptedRequests=0),oo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${oo.numberOfCancelledRequests}`),oo.numberOfCancelledRequests=0),oo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${oo.numberOfCancelledActiveRequests}`),oo.numberOfCancelledActiveRequests=0),oo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${oo.numberOfFailedRequests}`),oo.numberOfFailedRequests=0)),oo.lastNumberOfActiveRequests=oo.numberOfActiveRequests)}Ko.clearForSpecs=function(){for(;ic.length>0;){let t=ic.pop();ax(t)}let e=$h.length;for(let t=0;t<e;++t)ax($h[t]);$h.length=0,_p={},oo.numberOfAttemptedRequests=0,oo.numberOfActiveRequests=0,oo.numberOfCancelledRequests=0,oo.numberOfCancelledActiveRequests=0,oo.numberOfFailedRequests=0,oo.numberOfActiveRequestsEver=0,oo.lastNumberOfActiveRequests=0};Ko.numberOfActiveRequestsByServer=function(e){return _p[e]};Ko.requestHeap=ic;var oc=Ko;var MGt=_(T(),1),c$=_(cd(),1);var oR={},QS={};oR.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(QS[n])||(QS[n]=!0)};oR.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(QS[n])&&delete QS[n]};function eLe(e){let t=new c$.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}}oR.contains=function(e){let t=eLe(e);return!!(l(t)&&l(QS[t]))};oR.clear=function(){QS={}};var jS=oR;var u$=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function Pt(e){e=e??Y.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=ef(e.templateValues,{}),this._queryParameters=ef(e.queryParameters,{}),this.headers=ef(e.headers,{}),this.request=e.request??new Ho,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 ef(e,t){return l(e)?Be(e):t}Pt.createIfNeeded=function(e){return e instanceof Pt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Pt({url:e})};var qS;Pt.supportsImageBitmapOptions=function(){return l(qS)?qS:typeof createImageBitmap!="function"?(qS=Promise.resolve(!1),qS):(qS=Pt.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=Cm(t[0]),i=Cm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),qS)};Object.defineProperties(Pt,{isBlobSupported:{get:function(){return u$}}});Object.defineProperties(Pt.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 nx(this._url)}},isDataUri:{get:function(){return xp(this._url)}},isBlobUri:{get:function(){return ix(this._url)}},isCrossOriginUrl:{get:function(){return w0(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Pt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Pt.prototype.parseUrl=function(e,t,n,i){let o=new d$.default(e),r=tLe(o.query());this._queryParameters=t?GN(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Qh(i))),this._url=o.toString()};function tLe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:ld(e)}function GN(e,t,n){if(!n)return Rt(e,t);let i=Be(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Pt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${nLe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function nLe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${rx(e)}`}Pt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=GN(this._queryParameters,e,!1):this._queryParameters=GN(e,this._queryParameters,!1)};Pt.prototype.appendQueryParameters=function(e){this._queryParameters=GN(e,this._queryParameters,!0)};Pt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Rt(this._templateValues,e):this._templateValues=Rt(e,this._templateValues)};Pt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Rt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Rt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Rt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Pt.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})};Pt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Be(this._queryParameters),e._templateValues=Be(this._templateValues),e.headers=Be(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Pt({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})};Pt.prototype.getBaseUri=function(e){return eR(this.getUrlComponent(e),e)};Pt.prototype.appendForwardSlash=function(){this._url=$L(this._url)};Pt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Pt.fetchArrayBuffer=function(e){return new Pt(e).fetchArrayBuffer()};Pt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Pt.fetchBlob=function(e){return new Pt(e).fetchBlob()};Pt.prototype.fetchImage=function(e){e=e??Y.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(fB(this.request),!u$||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return hB({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return Pt.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return Pt.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(u);return c=new Pt({url:h}),hB({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(l(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return l(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};function hB(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Cl();return Pt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=oc.request(r);if(l(s))return s.catch(function(a){return r.state!==$n.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=$n.UNISSUED,r.deferred=void 0,hB({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Pt.fetchImage=function(e){return new Pt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Pt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Pt.fetchText=function(e){return new Pt(e).fetchText()};Pt.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)})};Pt.fetchJson=function(e){return new Pt(e).fetchJson()};Pt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Pt.fetchXML=function(e){return new Pt(e).fetchXML()};Pt.prototype.fetchJsonp=function(e){e=e??"callback",fB(this.request);let t;do t=`loadJsonp${X.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return m$(this,e,t)};function m$(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=Cl();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Pt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=oc.request(o);if(l(s))return s.catch(function(a){return o.state!==$n.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=$n.UNISSUED,o.deferred=void 0,m$(e,t,n)):Promise.reject(a)})})}Pt.fetchJsonp=function(e){return new Pt(e).fetchJsonp(e.callbackParameterName)};Pt.prototype._makeRequest=function(e){let t=this;fB(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=Rt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=Cl(),h=Pt._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(h)&&l(h.abort)&&(n.cancelFunction=function(){h.abort()}),u.promise};let o=oc.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!==$n.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=$n.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function fB(e){if(e.state===$n.ISSUED||e.state===$n.ACTIVE)throw new ce("The Resource is already being fetched.");e.state=$n.UNISSUED,e.deferred=void 0}var iLe=/^data:(.*?)(;base64)?,(.*)$/;function ZN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function l$(e,t){let n=ZN(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 oLe(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return ZN(i,o);case"arraybuffer":return l$(i,o);case"blob":return r=l$(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(ZN(i,o),n);case"json":return JSON.parse(ZN(i,o));default:}}Pt.prototype.fetch=function(e){return e=ef(e,{}),e.method="GET",this._makeRequest(e)};Pt.fetch=function(e){return new Pt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Pt.prototype.delete=function(e){return e=ef(e,{}),e.method="DELETE",this._makeRequest(e)};Pt.delete=function(e){return new Pt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Pt.prototype.head=function(e){return e=ef(e,{}),e.method="HEAD",this._makeRequest(e)};Pt.head=function(e){return new Pt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Pt.prototype.options=function(e){return e=ef(e,{}),e.method="OPTIONS",this._makeRequest(e)};Pt.options=function(e){return new Pt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Pt.prototype.post=function(e,t){return To.defined("data",e),t=ef(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Pt.post=function(e){return new Pt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Pt.prototype.put=function(e,t){return To.defined("data",e),t=ef(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Pt.put=function(e){return new Pt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Pt.prototype.patch=function(e,t){return To.defined("data",e),t=ef(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Pt.patch=function(e){return new Pt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Pt._Implementations={};Pt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(jS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Pt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;Pt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){Pt._Implementations.loadImageElement(s,t,n);return}let c="blob",d="GET",u=Cl(),h=Pt._Implementations.loadWithXhr(s,c,d,void 0,void 0,u,void 0,void 0,void 0);return l(h)&&l(h.abort)&&(e.cancelFunction=function(){h.abort()}),u.promise.then(function(p){if(!l(p)){n.reject(new ce(`Successfully retrieved ${s} but it contained no content.`));return}return Pt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Pt.createImageBitmapFromBlob=function(e,t){return To.defined("options",t),To.typeOf.bool("options.flipY",t.flipY),To.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),To.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function rLe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new qh(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new qh)})}var sLe=typeof XMLHttpRequest>"u";Pt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=iLe.exec(e);if(a!==null){r.resolve(oLe(a,t));return}if(sLe){rLe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(jS.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);l(t)&&(c.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new qh(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,h=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};g.forEach(function(y){let x=y.split(": "),S=x.shift();f[S]=x.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve(void 0);else if(l(u)&&(!l(t)||h===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(h===""||h==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(h===""||h==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new ce("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new qh)},c.send(i),c};Pt._Implementations.loadAndExecuteScript=function(e,t,n){return ox(e,t).catch(function(i){n.reject(i)})};Pt._DefaultImplementations={};Pt._DefaultImplementations.createImage=Pt._Implementations.createImage;Pt._DefaultImplementations.loadWithXhr=Pt._Implementations.loadWithXhr;Pt._DefaultImplementations.loadAndExecuteScript=Pt._Implementations.loadAndExecuteScript;Pt.DEFAULT=Object.freeze(new Pt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Re=Pt;function sR(e){e=e??Y.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=e.addNewLeapSeconds??!0,l(e.data)?h$(this,e.data):h$(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}sR.fromUrl=async function(e,t){t=t??Y.EMPTY_OBJECT;let n=Re.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ce(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new sR({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};sR.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 P0(0,0,0,0,0),t}});sR.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new P0(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],d=q.lessThanOrEquals(a,e),u=!l(c),h=u||q.greaterThanOrEquals(c,e);if(d&&h)return o=i,!u&&c.equals(e)&&++o,r=o+1,p$(this,n,this._samples,e,o,r,t),t}let s=Wo(n,e,q.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,p$(this,n,this._samples,e,o,r,t),t};function aLe(e,t){return q.compare(e.julianDate,t)}function h$(e,t){if(!l(t.columnNames))throw new ce("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new ce("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new ce("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let d=e._samples=t.samples,u=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let h,p=e._addNewLeapSeconds;for(let g=0,f=d.length;g<f;g+=e._columnCount){let y=d[g+n],x=d[g+c],S=y+Jn.MODIFIED_JULIAN_DATE_DIFFERENCE,C=new q(S,x,Kn.TAI);if(u.push(C),p){if(x!==h&&l(h)){let V=q.leapSeconds,L=Wo(V,C,aLe);if(L<0){let Z=new Hi(C,x);V.splice(~L,0,Z)}}h=x}}}function f$(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 rR(e,t,n){return t+e*(n-t)}function p$(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],d=t[r];if(c.equals(d)||i.equals(c))return f$(e,n,o,a,s),s;if(i.equals(d))return f$(e,n,r,a,s),s;let u=q.secondsDifference(i,c)/q.secondsDifference(d,c),h=o*a,p=r*a,g=n[h+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],y=f-g;if(y>.5||y<-.5){let x=n[h+e._taiMinusUtcSecondsColumn],S=n[p+e._taiMinusUtcSecondsColumn];x!==S&&(d.equals(i)?g=f:f-=S-x)}return s.xPoleWander=rR(u,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=rR(u,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=rR(u,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=rR(u,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=rR(u,g,f),s}var aR=sR;var REt=_(T(),1);function rc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}rc.fromQuaternion=function(e,t){l(t)||(t=new rc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-X.asinClamped(n),t};rc.fromDegrees=function(e,t,n,i){return l(i)||(i=new rc),i.heading=e*X.RADIANS_PER_DEGREE,i.pitch=t*X.RADIANS_PER_DEGREE,i.roll=n*X.RADIANS_PER_DEGREE,i};rc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new rc(e.heading,e.pitch,e.roll)};rc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};rc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&X.equalsEpsilon(e.heading,t.heading,n,i)&&X.equalsEpsilon(e.pitch,t.pitch,n,i)&&X.equalsEpsilon(e.roll,t.roll,n,i)};rc.prototype.clone=function(e){return rc.clone(this,e)};rc.prototype.equals=function(e){return rc.equals(this,e)};rc.prototype.equalsEpsilon=function(e,t,n){return rc.equalsEpsilon(this,e,t,n)};rc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Xa=rc;var OEt=_(T(),1);var XEt=_(T(),1);var b$={};var g$=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function cLe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=g$.exec(i);if(o!==null)return o[1]}}var EN;function y$(e){return typeof document>"u"?e:(l(EN)||(EN=document.createElement("a")),EN.href=e,EN.href)}var cx;function x$(){if(l(cx))return cx;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(b$?.url)?e=Qh(".",b$.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(eN.toUrl)?e=Qh("..",lx("Core/buildModuleUrl.js")):e=cLe(),cx=new Re({url:y$(e)}),cx.appendForwardSlash(),cx}function lLe(e){return y$(eN.toUrl(`../${e}`))}function _$(e){return x$().getDerivedResource({url:e}).url}var IN;function lx(e){return l(IN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(eN.toUrl)?IN=lLe:IN=_$),IN(e)}lx._cesiumScriptRegex=g$;lx._buildModuleUrlFromBaseUrl=_$;lx._clearBaseResource=function(){cx=void 0};lx.setBaseUrl=function(e){cx=Re.DEFAULT.getDerivedResource({url:e})};lx.getCesiumBaseUrl=x$;var sn=lx;var vEt=_(T(),1);function dLe(e,t,n){this.x=e,this.y=t,this.s=n}var dx=dLe;function gB(e){e=e??Y.EMPTY_OBJECT,this._xysFileUrlTemplate=Re.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new q(this._sampleZeroJulianEphemerisDate,0,Kn.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=e.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var uLe=new q(0,0,Kn.TAI);function pB(e,t,n){let i=uLe;return i.dayNumber=t,i.secondsOfDay=n,q.daysDifference(i,e._sampleZeroDateTT)}gB.prototype.preload=function(e,t,n,i){let o=pB(this,e,t),r=pB(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let h=c;h<=d;++h)u.push(bB(this,h));return Promise.all(u)};gB.prototype.computeXysRadians=function(e,t,n){let i=pB(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,d=this._samples;if(l(d[s*3])||(bB(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(bB(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new dx(0,0,0);let u=i-s*this._stepSizeDays,h=this._work,p=this._denominators,g=this._coef,f=this._xTable,y,x;for(y=0;y<=r;++y)h[y]=u-f[y];for(y=0;y<=r;++y){for(g[y]=1,x=0;x<=r;++x)x!==y&&(g[y]*=h[x]);g[y]*=p[y];let S=(s+y)*3;n.x+=g[y]*d[S++],n.y+=g[y]*d[S++],n.s+=g[y]*d[S]}return n};function bB(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 Re({url:sn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let d=0,u=a.length;d<u;++d)s[c+d]=a[d]});return e._chunkDownloadsInProgress[t]=o,o}var cR=gB;var QEt=_(T(),1);function rt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var lR=new m;rt.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);lR=m.normalize(e,lR);let r=lR.x*o,s=lR.y*o,a=lR.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new rt(r,s,a,c)};var mLe=[1,2,0],hLe=new Array(3);rt.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],d=e[$.COLUMN2ROW2],u=a+c+d;if(u>0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let h=mLe,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let g=h[p],f=h[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(f,f)]+1);let y=hLe;y[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(f,g)]-e[$.getElementIndex(g,f)])*n,y[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,y[f]=(e[$.getElementIndex(f,p)]+e[$.getElementIndex(p,f)])*n,i=-y[0],o=-y[1],r=-y[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new rt(i,o,r,s)};var T$=new rt,S$=new rt,yB=new rt,C$=new rt;rt.fromHeadingPitchRoll=function(e,t){return C$=rt.fromAxisAngle(m.UNIT_X,e.roll,T$),yB=rt.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=rt.multiply(yB,C$,yB),S$=rt.fromAxisAngle(m.UNIT_Z,-e.heading,T$),rt.multiply(S$,t,t)};var XN=new m,xB=new m,Vm=new rt,V$=new rt,WN=new rt;rt.packedLength=4;rt.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};rt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new rt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};rt.packedInterpolationLength=3;rt.convertPackedArrayForInterpolation=function(e,t,n,i){rt.unpack(e,n*4,WN),rt.conjugate(WN,WN);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;rt.unpack(e,(t+o)*4,Vm),rt.multiply(Vm,WN,Vm),Vm.w<0&&rt.negate(Vm,Vm),rt.computeAxis(Vm,XN);let a=rt.computeAngle(Vm);l(i)||(i=[]),i[s]=XN.x*a,i[s+1]=XN.y*a,i[s+2]=XN.z*a}};rt.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new rt),m.fromArray(e,0,xB);let r=m.magnitude(xB);return rt.unpack(t,i*4,V$),r===0?rt.clone(rt.IDENTITY,Vm):rt.fromAxisAngle(xB,r,Vm),rt.multiply(Vm,V$,o)};rt.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 rt(e.x,e.y,e.z,e.w)};rt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};rt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};rt.magnitude=function(e){return Math.sqrt(rt.magnitudeSquared(e))};rt.normalize=function(e,t){let n=1/rt.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};rt.inverse=function(e,t){let n=rt.magnitudeSquared(e);return t=rt.conjugate(e,t),rt.multiplyByScalar(t,1/n,t)};rt.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};rt.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};rt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};rt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};rt.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,d=t.z,u=t.w,h=s*a+i*u+o*d-r*c,p=s*c-i*d+o*u+r*a,g=s*d+i*c-o*a+r*u,f=s*u-i*a-o*c-r*d;return n.x=h,n.y=p,n.z=g,n.w=f,n};rt.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};rt.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};rt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<X.EPSILON6||Math.abs(n+1)<X.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};rt.computeAngle=function(e){return Math.abs(e.w-1)<X.EPSILON6?0:2*Math.acos(e.w)};var _B=new rt;rt.lerp=function(e,t,n,i){return _B=rt.multiplyByScalar(t,n,_B),i=rt.multiplyByScalar(e,1-n,i),rt.add(_B,i,i)};var L$=new rt,TB=new rt,SB=new rt;rt.slerp=function(e,t,n,i){let o=rt.dot(e,t),r=t;if(o<0&&(o=-o,r=L$=rt.negate(t,L$)),1-o<X.EPSILON6)return rt.lerp(e,r,n,i);let s=Math.acos(o);return TB=rt.multiplyByScalar(e,Math.sin((1-n)*s),TB),SB=rt.multiplyByScalar(r,Math.sin(n*s),SB),i=rt.add(TB,SB,i),rt.multiplyByScalar(i,1/Math.sin(s),i)};rt.log=function(e,t){let n=X.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),m.multiplyByScalar(e,i,t)};rt.exp=function(e,t){let n=m.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var fLe=new m,pLe=new m,dR=new rt,$S=new rt;rt.computeInnerQuadrangle=function(e,t,n,i){let o=rt.conjugate(t,dR);rt.multiply(o,n,$S);let r=rt.log($S,fLe);rt.multiply(o,e,$S);let s=rt.log($S,pLe);return m.add(r,s,r),m.multiplyByScalar(r,.25,r),m.negate(r,r),rt.exp(r,dR),rt.multiply(t,dR,i)};rt.squad=function(e,t,n,i,o,r){let s=rt.slerp(e,t,o,dR),a=rt.slerp(n,i,o,$S);return rt.slerp(s,a,2*o*(1-o),r)};var bLe=new rt,R$=1.9011074535173003,PN=Ht.supportsTypedArrays()?new Float32Array(8):[],vN=Ht.supportsTypedArrays()?new Float32Array(8):[],Tp=Ht.supportsTypedArrays()?new Float32Array(8):[],Sp=Ht.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;PN[e]=1/(t*n),vN[e]=t/n}PN[7]=R$/(8*17);vN[7]=R$*8/17;rt.fastSlerp=function(e,t,n,i){let o=rt.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,d=a*a;for(let g=7;g>=0;--g)Tp[g]=(PN[g]*c-vN[g])*s,Sp[g]=(PN[g]*d-vN[g])*s;let u=r*n*(1+Tp[0]*(1+Tp[1]*(1+Tp[2]*(1+Tp[3]*(1+Tp[4]*(1+Tp[5]*(1+Tp[6]*(1+Tp[7])))))))),h=a*(1+Sp[0]*(1+Sp[1]*(1+Sp[2]*(1+Sp[3]*(1+Sp[4]*(1+Sp[5]*(1+Sp[6]*(1+Sp[7])))))))),p=rt.multiplyByScalar(e,h,bLe);return rt.multiplyByScalar(t,u,i),rt.add(p,i,i)};rt.fastSquad=function(e,t,n,i,o,r){let s=rt.fastSlerp(e,t,o,dR),a=rt.fastSlerp(n,i,o,$S);return rt.fastSlerp(s,a,2*o*(1-o),r)};rt.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};rt.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};rt.ZERO=Object.freeze(new rt(0,0,0,0));rt.IDENTITY=Object.freeze(new rt(0,0,0,1));rt.prototype.clone=function(e){return rt.clone(this,e)};rt.prototype.equals=function(e){return rt.equals(this,e)};rt.prototype.equalsEpsilon=function(e,t){return rt.equalsEpsilon(this,e,t)};rt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var we=rt;var mi={},CB={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"}},eC={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},VB={},Vl={east:new m,north:new m,up:new m,west:new m,south:new m,down:new m},F0=new m,A0=new m,M0=new m;mi.localFrameToFixedFrameGenerator=function(e,t){if(!CB.hasOwnProperty(e)||!CB[e].hasOwnProperty(t))throw new fe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=CB[e][t],i,o=e+t;return l(VB[o])?i=VB[o]:(i=function(r,s,a){if(l(a)||(a=new F),m.equalsEpsilon(r,m.ZERO,X.EPSILON14))m.unpack(eC[e],0,F0),m.unpack(eC[t],0,A0),m.unpack(eC[n],0,M0);else if(X.equalsEpsilon(r.x,0,X.EPSILON14)&&X.equalsEpsilon(r.y,0,X.EPSILON14)){let c=X.sign(r.z);m.unpack(eC[e],0,F0),e!=="east"&&e!=="west"&&m.multiplyByScalar(F0,c,F0),m.unpack(eC[t],0,A0),t!=="east"&&t!=="west"&&m.multiplyByScalar(A0,c,A0),m.unpack(eC[n],0,M0),n!=="east"&&n!=="west"&&m.multiplyByScalar(M0,c,M0)}else{s=s??ne.default,s.geodeticSurfaceNormal(r,Vl.up);let c=Vl.up,d=Vl.east;d.x=-r.y,d.y=r.x,d.z=0,m.normalize(d,Vl.east),m.cross(c,d,Vl.north),m.multiplyByScalar(Vl.up,-1,Vl.down),m.multiplyByScalar(Vl.east,-1,Vl.west),m.multiplyByScalar(Vl.north,-1,Vl.south),F0=Vl[e],A0=Vl[t],M0=Vl[n]}return a[0]=F0.x,a[1]=F0.y,a[2]=F0.z,a[3]=0,a[4]=A0.x,a[5]=A0.y,a[6]=A0.z,a[7]=0,a[8]=M0.x,a[9]=M0.y,a[10]=M0.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},VB[o]=i),i};mi.eastNorthUpToFixedFrame=mi.localFrameToFixedFrameGenerator("east","north");mi.northEastDownToFixedFrame=mi.localFrameToFixedFrameGenerator("north","east");mi.northUpEastToFixedFrame=mi.localFrameToFixedFrameGenerator("north","up");mi.northWestUpToFixedFrame=mi.localFrameToFixedFrameGenerator("north","west");var gLe=new we,yLe=new m(1,1,1),xLe=new F;mi.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??mi.eastNorthUpToFixedFrame;let r=we.fromHeadingPitchRoll(t,gLe),s=F.fromTranslationQuaternionRotationScale(m.ZERO,r,yLe,xLe);return o=i(e,n,o),F.multiply(o,s,o)};var _Le=new F,TLe=new $;mi.headingPitchRollQuaternion=function(e,t,n,i,o){let r=mi.headingPitchRollToFixedFrame(e,t,n,i,_Le),s=F.getMatrix3(r,TLe);return we.fromRotationMatrix(s,o)};var SLe=new m(1,1,1),CLe=new m,Z$=new F,VLe=new F,LLe=new $,RLe=new we;mi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ne.default,n=n??mi.eastNorthUpToFixedFrame,l(i)||(i=new Xa);let o=F.getTranslation(e,CLe);if(m.equals(o,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=F.inverseTransformation(n(o,t,Z$),Z$),s=F.setScale(e,SLe,VLe);s=F.setTranslation(s,m.ZERO,s),r=F.multiply(r,s,r);let a=we.fromRotationMatrix(F.getMatrix3(r,LLe),RLe);return a=we.normalize(a,a),Xa.fromQuaternion(a,i)};var ZLe=6*3600+41*60+50.54841,GLe=8640184812866e-6,ELe=.093104,ILe=-62e-7,XLe=11772758384668e-32,WLe=72921158553e-15,PLe=X.TWO_PI/86400,wN=new q;mi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=mi.computeIcrfToFixedMatrix(e,t);return l(n)||(n=mi.computeTemeToPseudoFixedMatrix(e,t)),n};mi.computeTemeToPseudoFixedMatrix=function(e,t){wN=q.addSeconds(e,-q.computeTaiMinusUtc(e),wN);let n=wN.dayNumber,i=wN.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/Jn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Jn.DAYS_PER_JULIAN_CENTURY;let a=(ZLe+o*(GLe+o*(ELe+o*ILe)))*PLe%X.TWO_PI,c=WLe+XLe*(n-24515455e-1),d=(i+Jn.SECONDS_PER_DAY*.5)%Jn.SECONDS_PER_DAY,u=a+c*d,h=Math.cos(u),p=Math.sin(u);return l(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(h,p,0,-p,h,0,0,0,1)};mi.iau2006XysData=new cR;mi.earthOrientationParameters=aR.NONE;var ZB=32.184,vLe=2451545;mi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+ZB,i=e.stop.dayNumber,o=e.stop.secondsOfDay+ZB;return mi.iau2006XysData.preload(t,n,i,o)};mi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=mi.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var wLe=32.184,FLe=2451545,FN=new Xa,ALe=new $,MLe=new q;mi.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=q.addSeconds(e,wLe,MLe),i=q.totalDays(n)-FLe,o=X.toRadians(12.112)-X.toRadians(.052992)*i,r=X.toRadians(24.224)-X.toRadians(.105984)*i,s=X.toRadians(227.645)+X.toRadians(13.012)*i,a=X.toRadians(261.105)+X.toRadians(13.340716)*i,c=X.toRadians(358)+X.toRadians(.9856)*i;return FN.pitch=X.toRadians(180)-X.toRadians(3.878)*Math.sin(o)-X.toRadians(.12)*Math.sin(r)+X.toRadians(.07)*Math.sin(s)-X.toRadians(.017)*Math.sin(a),FN.roll=X.toRadians(66.53-90)+X.toRadians(1.543)*Math.cos(o)+X.toRadians(.24)*Math.cos(r)-X.toRadians(.028)*Math.cos(s)+X.toRadians(.007)*Math.cos(a),FN.heading=X.toRadians(244.375-90)+X.toRadians(13.17635831)*i+X.toRadians(3.558)*Math.sin(o)+X.toRadians(.121)*Math.sin(r)-X.toRadians(.064)*Math.sin(s)+X.toRadians(.016)*Math.sin(a)+X.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(FN,ALe)};mi.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=mi.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var NLe=new dx(0,0,0),kLe=new P0(0,0,0,0,0,0),LB=new $,RB=new $;mi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=mi.earthOrientationParameters.compute(e,kLe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+ZB,r=mi.iau2006XysData.computeXysRadians(i,o,NLe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=LB;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);let u=$.fromRotationZ(-r.s,RB),h=$.multiply(d,u,LB),p=e.dayNumber,g=e.secondsOfDay-q.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,y=g/Jn.SECONDS_PER_DAY,x=.779057273264+y+.00273781191135448*(f+y);x=x%1*X.TWO_PI;let S=$.fromRotationZ(x,RB),C=$.multiply(h,S,LB),V=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Z=Math.sin(n.xPoleWander),E=Math.sin(n.yPoleWander),P=i-vLe+o/Jn.SECONDS_PER_DAY;P/=36525;let W=-47e-6*P*X.RADIANS_PER_DEGREE/3600,v=Math.cos(W),A=Math.sin(W),b=RB;return b[0]=V*v,b[1]=V*A,b[2]=Z,b[3]=-L*A+E*Z*v,b[4]=L*v+E*Z*A,b[5]=-E*V,b[6]=-E*A-L*Z*v,b[7]=E*v-L*Z*A,b[8]=L*V,$.multiply(C,b,t)};var ULe=new re;mi.pointToWindowCoordinates=function(e,t,n,i){return i=mi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};mi.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let o=ULe;return F.multiplyByVector(e,re.fromElements(n.x,n.y,n.z,1,o),o),re.multiplyByScalar(o,1/o.w,o),F.multiplyByVector(t,o,o),U.fromCartesian4(o,i)};var DLe=new m,OLe=new m,BLe=new m;mi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??ne.default).geodeticSurfaceNormal(e,DLe),r=m.cross(t,o,OLe);m.equalsEpsilon(r,m.ZERO,X.EPSILON6)&&(r=m.clone(m.UNIT_X,r));let s=m.cross(r,t,BLe);return m.normalize(s,s),m.cross(t,s,r),m.negate(r,r),m.normalize(r,r),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var G$=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),E$=new he,GB=new m,YLe=new m,zLe=new $,EB=new F,I$=new F;mi.basisTo2D=function(e,t,n){let i=F.getTranslation(t,YLe),o=e.ellipsoid,r;if(m.equals(i,m.ZERO))r=m.clone(m.ZERO,GB);else{let u=o.cartesianToCartographic(i,E$);r=e.project(u,GB),m.fromElements(r.z,r.x,r.y,r)}let s=mi.eastNorthUpToFixedFrame(i,o,EB),a=F.inverseTransformation(s,I$),c=F.getMatrix3(t,zLe),d=F.multiplyByMatrix3(a,c,n);return F.multiply(G$,d,n),F.setTranslation(n,r,n),n};mi.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=mi.eastNorthUpToFixedFrame(t,i,EB),r=F.inverseTransformation(o,I$),s=i.cartesianToCartographic(t,E$),a=e.project(s,GB);m.fromElements(a.z,a.x,a.y,a);let c=F.fromTranslation(a,EB);return F.multiply(G$,r,n),F.multiply(c,n,n),n};var Ft=mi;function In(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(In.prototype,{width:{get:function(){return In.computeWidth(this)}},height:{get:function(){return In.computeHeight(this)}}});In.packedLength=4;In.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};In.unpack=function(e,t,n){return t=t??0,l(n)||(n=new In),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};In.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=X.TWO_PI),t-n};In.computeHeight=function(e){return e.north-e.south};In.fromDegrees=function(e,t,n,i,o){return e=X.toRadians(e??0),t=X.toRadians(t??0),n=X.toRadians(n??0),i=X.toRadians(i??0),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new In(e,t,n,i)};In.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 In(e,t,n,i)};In.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,d=e.length;c<d;c++){let u=e[c];n=Math.min(n,u.longitude),i=Math.max(i,u.longitude),s=Math.min(s,u.latitude),a=Math.max(a,u.latitude);let h=u.longitude>=0?u.longitude:u.longitude+X.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>X.PI&&(i=i-X.TWO_PI),n>X.PI&&(n=n-X.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new In(n,s,i,a)};In.fromCartesianArray=function(e,t,n){t=t??ne.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let d=0,u=e.length;d<u;d++){let h=t.cartesianToCartographic(e[d]);i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),a=Math.min(a,h.latitude),c=Math.max(c,h.latitude);let p=h.longitude>=0?h.longitude:h.longitude+X.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>X.PI&&(o=o-X.TWO_PI),i>X.PI&&(i=i-X.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new In(i,a,o,c)};var HLe=new m,KLe=new m,JLe=new m,QLe=new m,jLe=new m,IB=new Array(5);for(let e=0;e<IB.length;++e)IB[e]=new m;In.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=ne.default),l(n)||(n=new In),m.equals(i,m.ZERO))return In.clone(In.MAX_VALUE,n),n;let r=Ft.eastNorthUpToFixedFrame(i,t,HLe),s=F.multiplyByPointAsVector(r,m.UNIT_X,KLe);m.normalize(s,s);let a=F.multiplyByPointAsVector(r,m.UNIT_Y,JLe);m.normalize(a,a),m.multiplyByScalar(a,o,a),m.multiplyByScalar(s,o,s);let c=m.negate(a,jLe),d=m.negate(s,QLe),u=IB,h=u[0];return m.add(i,a,h),h=u[1],m.add(i,d,h),h=u[2],m.add(i,c,h),h=u[3],m.add(i,s,h),u[4]=i,In.fromCartesianArray(u,t,n)};In.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 In(e.west,e.south,e.east,e.north)};In.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};In.prototype.clone=function(e){return In.clone(this,e)};In.prototype.equals=function(e){return In.equals(this,e)};In.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};In.prototype.equalsEpsilon=function(e,t){return In.equalsEpsilon(this,e,t)};In._validate=function(e){};In.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};In.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};In.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};In.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};In.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=X.TWO_PI);let o=X.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new he(o,r)};In.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=X.TWO_PI:r<s&&i>0&&(r+=X.TWO_PI),i<o&&s<0?s+=X.TWO_PI:r<s&&o<0&&(o+=X.TWO_PI);let a=X.negativePiToPi(Math.max(o,s)),c=X.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let d=Math.max(e.south,t.south),u=Math.min(e.north,t.north);if(!(d>=u))return l(n)?(n.west=a,n.south=d,n.east=c,n.north=u,n):new In(a,d,c,u)};In.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new In(i,o,r,s)};In.union=function(e,t,n){l(n)||(n=new In);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=X.TWO_PI:r<s&&i>0&&(r+=X.TWO_PI),i<o&&s<0?s+=X.TWO_PI:r<s&&o<0&&(o+=X.TWO_PI);let a=X.negativePiToPi(Math.min(o,s)),c=X.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};In.expand=function(e,t,n){return l(n)||(n=new In),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};In.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=X.TWO_PI,n<0&&(n+=X.TWO_PI)),(n>o||X.equalsEpsilon(n,o,X.EPSILON14))&&(n<r||X.equalsEpsilon(n,r,X.EPSILON14))&&i>=e.south&&i<=e.north};var qLe=new he;In.subsample=function(e,t,n,i){t=t??ne.default,n=n??0,l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,d=qLe;d.height=n,d.longitude=c,d.latitude=r,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.latitude=s,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,r<0?d.latitude=r:s>0?d.latitude=s:d.latitude=0;for(let u=1;u<8;++u)d.longitude=-Math.PI+u*X.PI_OVER_TWO,In.contains(e,d)&&(i[o]=t.cartographicToCartesian(d,i[o]),o++);return d.latitude===0&&(d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++),i.length=o,i};In.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new In),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=X.TWO_PI+e.east-e.west;r.west=X.negativePiToPi(e.west+t*a),r.east=X.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};In.MAX_VALUE=Object.freeze(new In(-Math.PI,-X.PI_OVER_TWO,Math.PI,X.PI_OVER_TWO));var le=In;function wr(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}wr.packedLength=4;wr.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};wr.unpack=function(e,t,n){return t=t??0,l(n)||(n=new wr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};wr.fromPoints=function(e,t){if(l(t)||(t=new wr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],d=c.x,u=c.y;i=Math.min(d,i),r=Math.max(d,r),o=Math.min(u,o),s=Math.max(u,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var X$=new Ii,$Le=new he,eRe=new he;wr.fromRectangle=function(e,t,n){if(l(n)||(n=new wr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;X$._ellipsoid=ne.default,t=t??X$;let i=t.project(le.southwest(e,$Le)),o=t.project(le.northeast(e,eRe));return U.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};wr.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 wr(e.x,e.y,e.width,e.height)};wr.union=function(e,t,n){l(n)||(n=new wr);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};wr.expand=function(e,t,n){n=wr.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};wr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?Jt.OUTSIDE:Jt.INTERSECTING};wr.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};wr.prototype.clone=function(e){return wr.clone(this,e)};wr.prototype.intersect=function(e){return wr.intersect(this,e)};wr.prototype.equals=function(e){return wr.equals(this,e)};var ze=wr;var AIt=_(T(),1);var Wa={POINTS:ie.POINTS,LINES:ie.LINES,LINE_LOOP:ie.LINE_LOOP,LINE_STRIP:ie.LINE_STRIP,TRIANGLES:ie.TRIANGLES,TRIANGLE_STRIP:ie.TRIANGLE_STRIP,TRIANGLE_FAN:ie.TRIANGLE_FAN};Wa.isLines=function(e){return e===Wa.LINES||e===Wa.LINE_LOOP||e===Wa.LINE_STRIP};Wa.isTriangles=function(e){return e===Wa.TRIANGLES||e===Wa.TRIANGLE_STRIP||e===Wa.TRIANGLE_FAN};Wa.validate=function(e){return e===Wa.POINTS||e===Wa.LINES||e===Wa.LINE_LOOP||e===Wa.LINE_STRIP||e===Wa.TRIANGLES||e===Wa.TRIANGLE_STRIP||e===Wa.TRIANGLE_FAN};var Ae=Object.freeze(Wa);var NIt=_(T(),1),ux=`in vec4 position;
|
|
|
in vec2 textureCoordinates;
|
|
|
|
|
|
out vec2 v_textureCoordinates;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
gl_Position = position;
|
|
|
v_textureCoordinates = textureCoordinates;
|
|
|
}
|
|
|
`;var BIt=_(T(),1);var Cr={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 uR(e){e=e??Y.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??Ae.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 sc(e,t){return(e._flags&t)===t}function N0(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(uR.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 sc(this,Cr.CULL)},set:function(e){sc(this,Cr.CULL)!==e&&(N0(this,Cr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return sc(this,Cr.OCCLUDE)},set:function(e){sc(this,Cr.OCCLUDE)!==e&&(N0(this,Cr.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 sc(this,Cr.CAST_SHADOWS)},set:function(e){sc(this,Cr.CAST_SHADOWS)!==e&&(N0(this,Cr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return sc(this,Cr.RECEIVE_SHADOWS)},set:function(e){sc(this,Cr.RECEIVE_SHADOWS)!==e&&(N0(this,Cr.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 sc(this,Cr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){sc(this,Cr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(N0(this,Cr.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 sc(this,Cr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){sc(this,Cr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(N0(this,Cr.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 sc(this,Cr.PICK_ONLY)},set:function(e){sc(this,Cr.PICK_ONLY)!==e&&(N0(this,Cr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return sc(this,Cr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){sc(this,Cr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(N0(this,Cr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});uR.shallowClone=function(e,t){if(l(e))return l(t)||(t=new uR),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};uR.prototype.execute=function(e,t){e.draw(this,t)};var $e=uR;var rXt=_(T(),1);var jIt=_(T(),1);var HIt=_(T(),1);var hi={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,HALF_FLOAT:ie.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ie.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ie.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ie.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ie.UNSIGNED_SHORT_5_6_5};hi.toWebGLConstant=function(e,t){switch(e){case hi.UNSIGNED_BYTE:return ie.UNSIGNED_BYTE;case hi.UNSIGNED_SHORT:return ie.UNSIGNED_SHORT;case hi.UNSIGNED_INT:return ie.UNSIGNED_INT;case hi.FLOAT:return ie.FLOAT;case hi.HALF_FLOAT:return t.webgl2?ie.HALF_FLOAT:ie.HALF_FLOAT_OES;case hi.UNSIGNED_INT_24_8:return ie.UNSIGNED_INT_24_8;case hi.UNSIGNED_SHORT_4_4_4_4:return ie.UNSIGNED_SHORT_4_4_4_4;case hi.UNSIGNED_SHORT_5_5_5_1:return ie.UNSIGNED_SHORT_5_5_5_1;case hi.UNSIGNED_SHORT_5_6_5:return hi.UNSIGNED_SHORT_5_6_5}};hi.isPacked=function(e){return e===hi.UNSIGNED_INT_24_8||e===hi.UNSIGNED_SHORT_4_4_4_4||e===hi.UNSIGNED_SHORT_5_5_5_1||e===hi.UNSIGNED_SHORT_5_6_5};hi.sizeInBytes=function(e){switch(e){case hi.UNSIGNED_BYTE:return 1;case hi.UNSIGNED_SHORT:case hi.UNSIGNED_SHORT_4_4_4_4:case hi.UNSIGNED_SHORT_5_5_5_1:case hi.UNSIGNED_SHORT_5_6_5:case hi.HALF_FLOAT:return 2;case hi.UNSIGNED_INT:case hi.FLOAT:case hi.UNSIGNED_INT_24_8:return 4}};hi.validate=function(e){return e===hi.UNSIGNED_BYTE||e===hi.UNSIGNED_SHORT||e===hi.UNSIGNED_INT||e===hi.FLOAT||e===hi.HALF_FLOAT||e===hi.UNSIGNED_INT_24_8||e===hi.UNSIGNED_SHORT_4_4_4_4||e===hi.UNSIGNED_SHORT_5_5_5_1||e===hi.UNSIGNED_SHORT_5_6_5};hi.getTypedArrayConstructor=function(e){let t=hi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===hi.FLOAT?Float32Array:Uint32Array};var je=Object.freeze(hi);var st={DEPTH_COMPONENT:ie.DEPTH_COMPONENT,DEPTH_STENCIL:ie.DEPTH_STENCIL,ALPHA:ie.ALPHA,RED:ie.RED,R:ie.RED,RG:ie.RG,RGB:ie.RGB,RGBA:ie.RGBA,LUMINANCE:ie.LUMINANCE,LUMINANCE_ALPHA:ie.LUMINANCE_ALPHA,RGB_DXT1:ie.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ie.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ie.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ie.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ie.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ie.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ie.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ie.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ie.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ie.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ie.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ie.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ie.COMPRESSED_RGBA_BPTC_UNORM};st.componentsLength=function(e){switch(e){case st.RGB:return 3;case st.RGBA:return 4;case st.LUMINANCE_ALPHA:case st.RG:return 2;case st.ALPHA:case st.RED:case st.LUMINANCE:return 1;case st.R:return 4;default:return 1}};st.validate=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL||e===st.ALPHA||e===st.RED||e===st.RG||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA||e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7||e===st.R};st.isColorFormat=function(e){return e===st.RED||e===st.ALPHA||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA||e===st.R};st.isDepthFormat=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL};st.isCompressedFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isDXTFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5};st.isPVRTCFormat=function(e){return e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1};st.isASTCFormat=function(e){return e===st.RGBA_ASTC};st.isETC1Format=function(e){return e===st.RGB_ETC1};st.isETC2Format=function(e){return e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC};st.isBC7Format=function(e){return e===st.RGBA_BC7};st.compressedTextureSizeInBytes=function(e,t,n){switch(e){case st.RGB_DXT1:case st.RGBA_DXT1:case st.RGB_ETC1:case st.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case st.RGBA_DXT3:case st.RGBA_DXT5:case st.RGBA_ASTC:case st.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case st.RGB_PVRTC_4BPPV1:case st.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case st.RGB_PVRTC_2BPPV1:case st.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case st.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};st.textureSizeInBytes=function(e,t,n,i){let o=st.componentsLength(e);return je.isPacked(t)&&(o=1),o*je.sizeInBytes(t)*n*i};st.alignmentInBytes=function(e,t,n){let i=st.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};st.createTypedArray=function(e,t,n,i){let o=je.getTypedArrayConstructor(t),r=st.componentsLength(e)*n*i;return new o(r)};st.flipY=function(e,t,n,i,o){if(o===1)return e;let r=st.createTypedArray(t,n,i,o),s=st.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let d=c*i*s,u=(o-c-1)*i*s;for(let h=0;h<a;++h)r[u+h]=e[d+h]}return r};st.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===st.DEPTH_STENCIL)return ie.DEPTH24_STENCIL8;if(e===st.DEPTH_COMPONENT){if(t===je.UNSIGNED_SHORT)return ie.DEPTH_COMPONENT16;if(t===je.UNSIGNED_INT)return ie.DEPTH_COMPONENT24}if(t===je.FLOAT)switch(e){case st.RGBA:return ie.RGBA32F;case st.RGB:return ie.RGB32F;case st.RG:return ie.RG32F;case st.RED:case st.R:return ie.R32F}if(t===je.HALF_FLOAT)switch(e){case st.RGBA:return ie.RGBA16F;case st.RGB:return ie.RGB16F;case st.RG:return ie.RG16F;case st.RED:case st.R:return ie.R16F}return e};var ot=Object.freeze(st);var $It=_(T(),1),Vr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Vr,{maximumCombinedTextureImageUnits:{get:function(){return Vr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Vr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Vr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Vr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Vr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Vr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Vr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Vr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Vr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Vr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Vr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Vr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Vr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Vr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Vr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Vr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Vr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Vr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Vr._maximumColorAttachments}},maximumSamples:{get:function(){return Vr._maximumSamples}},highpFloatSupported:{get:function(){return Vr._highpFloatSupported}},highpIntSupported:{get:function(){return Vr._highpIntSupported}}});var Dt=Vr;function XB(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function AN(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Lm(e){e=e??Y.EMPTY_OBJECT;let n=e.context._gl,i=Dt.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;XB(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;AN(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;XB(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;AN(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;AN(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;XB(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;AN(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(Lm.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)}}});Lm.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Lm.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Lm.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Lm.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Lm.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Lm.prototype.getColorTexture=function(e){return this._colorTextures[e]};Lm.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Lm.prototype.isDestroyed=function(){return!1};Lm.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),me(this)};var Fr=Lm;var yXt=_(T(),1);var cXt=_(T(),1);var MN={CLOCKWISE:ie.CW,COUNTER_CLOCKWISE:ie.CCW};MN.validate=function(e){return e===MN.CLOCKWISE||e===MN.COUNTER_CLOCKWISE};var fs=Object.freeze(MN);var dXt=_(T(),1);function W$(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=W$(e[t]));return Object.freeze(e)}var WB=W$;function nf(e){let t=e??Y.EMPTY_OBJECT,n=t.cull??Y.EMPTY_OBJECT,i=t.polygonOffset??Y.EMPTY_OBJECT,o=t.scissorTest??Y.EMPTY_OBJECT,r=o.rectangle??Y.EMPTY_OBJECT,s=t.depthRange??Y.EMPTY_OBJECT,a=t.depthTest??Y.EMPTY_OBJECT,c=t.colorMask??Y.EMPTY_OBJECT,d=t.blending??Y.EMPTY_OBJECT,u=d.color??Y.EMPTY_OBJECT,h=t.stencilTest??Y.EMPTY_OBJECT,p=h.frontOperation??Y.EMPTY_OBJECT,g=h.backOperation??Y.EMPTY_OBJECT,f=t.sampleCoverage??Y.EMPTY_OBJECT,y=t.viewport;this.frontFace=t.frontFace??fs.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??ie.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:ze.clone(r)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??ie.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:d.enabled??!1,color:new D(u.red??0,u.green??0,u.blue??0,u.alpha??0),equationRgb:d.equationRgb??ie.FUNC_ADD,equationAlpha:d.equationAlpha??ie.FUNC_ADD,functionSourceRgb:d.functionSourceRgb??ie.ONE,functionSourceAlpha:d.functionSourceAlpha??ie.ONE,functionDestinationRgb:d.functionDestinationRgb??ie.ZERO,functionDestinationAlpha:d.functionDestinationAlpha??ie.ZERO},this.stencilTest={enabled:h.enabled??!1,frontFunction:h.frontFunction??ie.ALWAYS,backFunction:h.backFunction??ie.ALWAYS,reference:h.reference??0,mask:h.mask??-1,frontOperation:{fail:p.fail??ie.KEEP,zFail:p.zFail??ie.KEEP,zPass:p.zPass??ie.KEEP},backOperation:{fail:g.fail??ie.KEEP,zFail:g.zFail??ie.KEEP,zPass:g.zPass??ie.KEEP}},this.sampleCoverage={enabled:f.enabled??!1,value:f.value??1,invert:f.invert??!1},this.viewport=l(y)?new ze(y.x,y.y,y.width,y.height):void 0,this.id=0,this._applyFunctions=[]}var tRe=0,tf={};nf.fromCache=function(e){let t=JSON.stringify(e),n=tf[t];if(l(n))return++n.referenceCount,n.state;let i=new nf(e),o=JSON.stringify(i);return n=tf[o],l(n)||(i.id=tRe++,n={referenceCount:0,state:i},tf[o]=n),++n.referenceCount,tf[t]={referenceCount:1,state:n.state},n.state};nf.removeFromCache=function(e){let t=new nf(e),n=JSON.stringify(t),i=tf[n],o=JSON.stringify(e),r=tf[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete tf[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete tf[n]};nf.getCache=function(){return tf};nf.clearCache=function(){tf={}};function mx(e,t,n){n?e.enable(t):e.disable(t)}function P$(e,t){e.frontFace(t.frontFace)}function v$(e,t){let n=t.cull,i=n.enabled;mx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function w$(e,t){e.lineWidth(t.lineWidth)}function F$(e,t){let n=t.polygonOffset,i=n.enabled;mx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function A$(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(mx(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 M$(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function N$(e,t){let n=t.depthTest,i=n.enabled;mx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function k$(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function U$(e,t){e.depthMask(t.depthMask)}function D$(e,t){e.stencilMask(t.stencilMask)}function nRe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function O$(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;mx(e,e.BLEND,o),o&&(nRe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function B$(e,t){let n=t.stencilTest,i=n.enabled;if(mx(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,d=c.fail,u=c.zFail,h=c.zPass;e.stencilOpSeparate(e.FRONT,d,u,h);let p=n.backOperation,g=p.fail,f=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,f,y)}}function Y$(e,t){let n=t.sampleCoverage,i=n.enabled;mx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var iRe=new ze;function z$(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=iRe,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)}nf.apply=function(e,t,n){P$(e,t),v$(e,t),w$(e,t),F$(e,t),M$(e,t),N$(e,t),k$(e,t),U$(e,t),D$(e,t),B$(e,t),Y$(e,t),A$(e,t,n),O$(e,t,n),z$(e,t,n)};function oRe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(P$),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(v$),e.lineWidth!==t.lineWidth&&n.push(w$),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(F$),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(M$),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(N$),(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(k$),e.depthMask!==t.depthMask&&n.push(U$),e.stencilMask!==t.stencilMask&&n.push(D$),(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(B$),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Y$),n}nf.partialApply=function(e,t,n,i,o,r){if(t!==n){let u=n._applyFunctions[t.id];l(u)||(u=oRe(t,n),n._applyFunctions[t.id]=u);let h=u.length;for(let p=0;p<h;++p)u[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&A$(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,d=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==d||d&&t.blending!==n.blending)&&O$(e,n,o),(t!==n||i!==o||i.context!==o.context)&&z$(e,n,o)};nf.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:ze.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:D.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?ze.clone(e.viewport):void 0}};var Ue=nf;var eWt=_(T(),1);var PXt=_(T(),1);var SXt=_(T(),1);function jt(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}jt.packedLength=4;jt.pack=function(e,t,n){return n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};jt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new jt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};jt.packArray=function(e,t){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)jt.pack(e[o],t,o*4);return t};jt.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]=jt.unpack(e,i,t[o])}return t};jt.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 jt(e[0],e[2],e[1],e[3])};jt.fromArray=jt.unpack;jt.fromColumnMajorArray=function(e,t){return jt.clone(e,t)};jt.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 jt(e[0],e[1],e[2],e[3])};jt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new jt(e.x,0,0,e.y)};jt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new jt(e,0,0,e)};jt.fromRotation=function(e,t){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 jt(n,-i,i,n)};jt.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]]};jt.getElementIndex=function(e,t){return e*2+t};jt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};jt.setColumn=function(e,t,n,i){i=jt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};jt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};jt.setRow=function(e,t,n,i){return i=jt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var rRe=new U;jt.setScale=function(e,t,n){let i=jt.getScale(e,rRe),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 sRe=new U;jt.setUniformScale=function(e,t,n){let i=jt.getScale(e,sRe),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 H$=new U;jt.getScale=function(e,t){return t.x=U.magnitude(U.fromElements(e[0],e[1],H$)),t.y=U.magnitude(U.fromElements(e[2],e[3],H$)),t};var K$=new U;jt.getMaximumScale=function(e){return jt.getScale(e,K$),U.maximumComponent(K$)};var aRe=new U;jt.setRotation=function(e,t,n){let i=jt.getScale(e,aRe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var cRe=new U;jt.getRotation=function(e,t){let n=jt.getScale(e,cRe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};jt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};jt.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};jt.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};jt.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};jt.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};jt.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};jt.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};jt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};jt.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};jt.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};jt.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]};jt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};jt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||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};jt.IDENTITY=Object.freeze(new jt(1,0,0,1));jt.ZERO=Object.freeze(new jt(0,0,0,0));jt.COLUMN0ROW0=0;jt.COLUMN0ROW1=1;jt.COLUMN1ROW0=2;jt.COLUMN1ROW1=3;Object.defineProperties(jt.prototype,{length:{get:function(){return jt.packedLength}}});jt.prototype.clone=function(e){return jt.clone(this,e)};jt.prototype.equals=function(e){return jt.equals(this,e)};jt.prototype.equalsEpsilon=function(e,t){return jt.equalsEpsilon(this,e,t)};jt.prototype.toString=function(){return`(${this[0]}, ${this[2]})
|
|
|
(${this[1]}, ${this[3]})`};var Xi=jt;function lRe(e,t,n,i){switch(t.type){case e.FLOAT:return new J$(e,t,n,i);case e.FLOAT_VEC2:return new Q$(e,t,n,i);case e.FLOAT_VEC3:return new j$(e,t,n,i);case e.FLOAT_VEC4:return new q$(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:case e.SAMPLER_3D:case e.SAMPLER_2D_ARRAY:return new PB(e,t,n,i);case e.INT:case e.BOOL:return new $$(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new eee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new tee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new nee(e,t,n,i);case e.FLOAT_MAT2:return new iee(e,t,n,i);case e.FLOAT_MAT3:return new oee(e,t,n,i);case e.FLOAT_MAT4:return new ree(e,t,n,i);default:throw new ce(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function J$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}J$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Q$(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}Q$.prototype.set=function(){let e=this.value;U.equals(e,this._value)||(U.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function j$(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}j$.prototype.set=function(){let e=this.value;e&&(l(e.red)?D.equals(e,this._value)||(this._value=D.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(m.equals(e,this._value)||(this._value=m.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))))};function q$(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}q$.prototype.set=function(){let e=this.value;l(e.red)?D.equals(e,this._value)||(this._value=D.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(re.equals(e,this._value)||(this._value=re.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function PB(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}PB.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;t&&e.bindTexture(t._target,t._texture)};PB.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function $$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}$$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function eee(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}eee.prototype.set=function(){let e=this.value;U.equals(e,this._value)||(U.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function tee(e,t,n,i){this.name=n,this.value=void 0,this._value=new m,this._gl=e,this._location=i}tee.prototype.set=function(){let e=this.value;m.equals(e,this._value)||(m.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function nee(e,t,n,i){this.name=n,this.value=void 0,this._value=new re,this._gl=e,this._location=i}nee.prototype.set=function(){let e=this.value;re.equals(e,this._value)||(re.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var dRe=new Float32Array(4);function iee(e,t,n,i){this.name=n,this.value=void 0,this._value=new Xi,this._gl=e,this._location=i}iee.prototype.set=function(){if(!Xi.equalsArray(this.value,this._value,0)){Xi.clone(this.value,this._value);let e=Xi.toArray(this.value,dRe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var uRe=new Float32Array(9);function oee(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}oee.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,uRe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var mRe=new Float32Array(16);function ree(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}ree.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,mRe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var mR=lRe;var BXt=_(T(),1);function hRe(e,t,n,i){switch(t.type){case e.FLOAT:return new see(e,t,n,i);case e.FLOAT_VEC2:return new aee(e,t,n,i);case e.FLOAT_VEC3:return new cee(e,t,n,i);case e.FLOAT_VEC4:return new lee(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new vB(e,t,n,i);case e.INT:case e.BOOL:return new dee(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new uee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new mee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new hee(e,t,n,i);case e.FLOAT_MAT2:return new fee(e,t,n,i);case e.FLOAT_MAT3:return new pee(e,t,n,i);case e.FLOAT_MAT4:return new bee(e,t,n,i);default:throw new ce(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function see(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]}see.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 aee(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]}aee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];U.equalsArray(s,n,o)||(U.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function cee(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]}cee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):l(s.x)&&(m.equalsArray(s,n,o)||(m.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function lee(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]}lee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?D.equalsArray(s,n,o)||(D.pack(s,n,o),i=!0):l(s.x)&&(re.equalsArray(s,n,o)||(re.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function vB(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}vB.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))}};vB.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 dee(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]}dee.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 uee(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]}uee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];U.equalsArray(s,n,o)||(U.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function mee(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]}mee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];m.equalsArray(s,n,o)||(m.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function hee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}hee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];re.equalsArray(s,n,o)||(re.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function fee(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]}fee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];Xi.equalsArray(s,n,o)||(Xi.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function pee(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]}pee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];$.equalsArray(s,n,o)||($.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function bee(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]}bee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];F.equalsArray(s,n,o)||(F.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var hR=hRe;var fRe=0;function Cp(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=pRe(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=fRe++}Cp.fromCache=function(e){return e=e??Y.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};Cp.replaceCache=function(e){return e=e??Y.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Cp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return NN(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return NN(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return NN(this),this._uniformsByName}}});function gee(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function pRe(e,t){let n={};if(!Dt.highpFloatSupported||!Dt.highpIntSupported){let i,o,r,s,a=gee(e),c=gee(t),d=a.length,u=c.length;for(i=0;i<d;i++)for(o=0;o<u;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let h=new RegExp(`${r}\\b`,"g");t=t.replace(h,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var of="[Cesium WebGL] ";function bRe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${of}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${of}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${of}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let d,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${of}Shader program link log: ${c}`),h(o,"vertex"),h(r,"fragment"),d=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${of}Vertex shader compile log: ${c}`),console.error(`${of} Vertex shader source:
|
|
|
${n}`),d=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${of}Fragment shader compile log: ${c}`),console.error(`${of} Fragment shader source:
|
|
|
${i}`),d=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ce(d);function h(p,g){if(!l(u))return;let f=u.getTranslatedShaderSource(p);if(f===""){console.error(`${of}${g} shader translation failed.`);return}console.error(`${of}Translated ${g} shaderSource:
|
|
|
${f}`)}}function gRe(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function yRe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",d=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(d.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let u=e.getUniformLocation(t,d);if(u!==null){let h=mR(e,a,d,u);n[d]=h,i.push(h),h._setSampler&&o.push(h)}}else{let u,h,p,g,f=d.indexOf("[");if(f>=0){if(u=n[d.slice(0,f)],!l(u))continue;h=u._locations,h.length<=1&&(p=u.value,g=e.getUniformLocation(t,d),g!==null&&(h.push(g),p.push(e.getUniform(t,g))))}else{h=[];for(let y=0;y<a.size;++y)g=e.getUniformLocation(t,`${d}[${y}]`),g!==null&&h.push(g);u=hR(e,a,d,h),n[d]=u,i.push(u),u._setSampler&&o.push(u)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function xRe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];l(a)&&(r.name=a,s=a);let c=bp[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function _Re(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 NN(e){l(e._program)||yee(e)}function yee(e){let t=e._program,n=e._gl,i=bRe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=yRe(n,i),s=xRe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=gRe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=_Re(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,d,u){let h=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{yee(e),d(e._program)}catch(f){e._vertexShaderText=h,e._fragmentShaderText=p;let x=/(?:Compile|Link) error: ([^]*)/.exec(f.message);u(x?x[1]:f.message)}})}Cp.prototype._bind=function(){NN(this),this._gl.useProgram(this._program)};Cp.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};Cp.prototype.isDestroyed=function(){return!1};Cp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Cp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),me(this)};var nn=Cp;function kN(e){this._context=e}var fR,TRe=new $e({primitiveType:Ae.TRIANGLES}),SRe=new ii({color:new D(0,0,0,0)});function CRe(e,t){return new Fr({context:e,colorTextures:[t],destroyAttachments:!1})}function VRe(e,t){return nn.fromCache({context:e,vertexShaderSource:ux,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function LRe(e,t){return(!l(fR)||fR.viewport.width!==e||fR.viewport.height!==t)&&(fR=Ue.fromCache({viewport:new ze(0,0,e,t)})),fR}kN.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:VRe(o,e.fragmentShaderSource),a=CRe(o,t),c=LRe(n,i),d=e.uniformMap,u=SRe;u.framebuffer=a,u.renderState=c,u.execute(o);let h=TRe;h.vertexArray=r,h.renderState=c,h.shaderProgram=s,h.uniformMap=d,h.framebuffer=a,h.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};kN.prototype.isDestroyed=function(){return!1};kN.prototype.destroy=function(){return me(this)};var pR=kN;var bOt=_(T(),1);var gWt=_(T(),1);var Gn={BYTE:ie.BYTE,UNSIGNED_BYTE:ie.UNSIGNED_BYTE,SHORT:ie.SHORT,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,INT:ie.INT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,DOUBLE:ie.DOUBLE};Gn.getSizeInBytes=function(e){switch(e){case Gn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Gn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Gn.INT:return Int32Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Gn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Gn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Gn.fromTypedArray=function(e){if(e instanceof Int8Array)return Gn.BYTE;if(e instanceof Uint8Array)return Gn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Gn.SHORT;if(e instanceof Uint16Array)return Gn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Gn.INT;if(e instanceof Uint32Array)return Gn.UNSIGNED_INT;if(e instanceof Float32Array)return Gn.FLOAT;if(e instanceof Float64Array)return Gn.DOUBLE};Gn.validate=function(e){return l(e)&&(e===Gn.BYTE||e===Gn.UNSIGNED_BYTE||e===Gn.SHORT||e===Gn.UNSIGNED_SHORT||e===Gn.INT||e===Gn.UNSIGNED_INT||e===Gn.FLOAT||e===Gn.DOUBLE)};Gn.createTypedArray=function(e,t){switch(e){case Gn.BYTE:return new Int8Array(t);case Gn.UNSIGNED_BYTE:return new Uint8Array(t);case Gn.SHORT:return new Int16Array(t);case Gn.UNSIGNED_SHORT:return new Uint16Array(t);case Gn.INT:return new Int32Array(t);case Gn.UNSIGNED_INT:return new Uint32Array(t);case Gn.FLOAT:return new Float32Array(t);case Gn.DOUBLE:return new Float64Array(t)}};Gn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/Gn.getSizeInBytes(e),e){case Gn.BYTE:return new Int8Array(t,n,i);case Gn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Gn.SHORT:return new Int16Array(t,n,i);case Gn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Gn.INT:return new Int32Array(t,n,i);case Gn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Gn.FLOAT:return new Float32Array(t,n,i);case Gn.DOUBLE:return new Float64Array(t,n,i)}};Gn.fromName=function(e){switch(e){case"BYTE":return Gn.BYTE;case"UNSIGNED_BYTE":return Gn.UNSIGNED_BYTE;case"SHORT":return Gn.SHORT;case"UNSIGNED_SHORT":return Gn.UNSIGNED_SHORT;case"INT":return Gn.INT;case"UNSIGNED_INT":return Gn.UNSIGNED_INT;case"FLOAT":return Gn.FLOAT;case"DOUBLE":return Gn.DOUBLE}};var Q=Object.freeze(Gn);var vWt=_(T(),1);var xWt=_(T(),1),RRe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},fu=Object.freeze(RRe);function wB(e){e=e??Y.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Ae.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??fu.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}wB.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 ZRe=new he,GRe=new m,xee=new F,ERe=[new he,new he,new he],IRe=[new U,new U,new U],XRe=[new U,new U,new U],WRe=new m,PRe=new we,vRe=new F,wRe=new Xi;wB._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=le.center(i,ZRe),s=he.toCartesian(r,n,GRe),a=Ft.eastNorthUpToFixedFrame(s,n,xee),c=F.inverse(a,xee),d=IRe,u=ERe;u[0].longitude=i.west,u[0].latitude=i.south,u[1].longitude=i.west,u[1].latitude=i.north,u[2].longitude=i.east,u[2].latitude=i.south;let h=WRe;for(o=0;o<3;o++)he.toCartesian(u[o],n,h),h=F.multiplyByPointAsVector(c,h,h),d[o].x=h.x,d[o].y=h.y;let p=we.fromAxisAngle(m.UNIT_Z,-t,PRe),g=$.fromQuaternion(p,vRe),f=e.length,y=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(o=0;o<f;o++)h=F.multiplyByPointAsVector(c,e[o],h),h=$.multiplyByVector(g,h,h),y=Math.min(y,h.x),x=Math.min(x,h.y),S=Math.max(S,h.x),C=Math.max(C,h.y);let V=Xi.fromRotation(t,wRe),L=XRe;L[0].x=y,L[0].y=x,L[1].x=y,L[1].y=C,L[2].x=S,L[2].y=x;let Z=d[0],E=d[2].x-Z.x,P=d[1].y-Z.y;for(o=0;o<3;o++){let R=L[o];Xi.multiplyByVector(V,R,R),R.x=(R.x-Z.x)/E,R.y=(R.y-Z.y)/P}let W=L[0],v=L[1],A=L[2],b=new Array(6);return U.pack(W,b),U.pack(v,b,2),U.pack(A,b,4),b};var ht=wB;var AWt=_(T(),1);function FRe(e){e=e??Y.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Ze=FRe;var aPt=_(T(),1);var iPt=_(T(),1);var kWt=_(T(),1);function tC(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(tC.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}}});tC.clone=function(e){if(l(e))return new tC(e._format,e._datatype,e._width,e._height,e._buffer)};tC.prototype.clone=function(){return tC.clone(this)};var bR=tC;var jWt=_(T(),1),_ee=_(cd(),1);function Tee(){if(!l(pa._canTransferArrayBuffer)){let e=MB("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return pa._canTransferArrayBuffer=!1,pa._canTransferArrayBuffer}pa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),pa._canTransferArrayBuffer=s}})}return pa._canTransferArrayBuffer}var AB=new be;function FB(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 MB(e){let t=new _ee.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(w0(e))s=e;else if(!n){let a=sn(`${pa._workerModulePrefix}/${i}.js`);w0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=FB(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=`
|
|
|
importScripts("${FB(CESIUM_WORKERS)}");
|
|
|
CesiumWorkers["${i}"]();
|
|
|
`;return r=FB(a),new Worker(r,o)}if(r=e,n||(r=sn(`${pa._workerModulePrefix+i}.js`)),!Ht.supportsEsmWebWorkers())throw new ce("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function ARe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ht.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new ce(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=sn(t.fallbackModulePath),n}n.wasmBinaryFile=sn(t.wasmBinaryFile);let i=await Re.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function pa(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var MRe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new ce(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new fe(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),AB.raiseEvent(s),i(s)}else AB.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},NRe=[];async function kRe(e,t,n){let i=await Promise.resolve(Tee());l(n)?i||(n.length=0):n=NRe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",MRe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:sn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function URe(e,t,n){++e._activeTasks;try{let i=await kRe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}pa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=MB(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return URe(this,e,t)};pa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=MB(this._workerPath),i=await ARe(this,e),o=await Promise.resolve(Tee()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,d)=>{n.onmessage=function({data:u}){l(u)?c(u.result):d(new ce("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};pa.prototype.isDestroyed=function(){return!1};pa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),me(this)};pa.taskCompletedEvent=AB;pa._defaultWorkerModulePrefix="Workers/";pa._workerModulePrefix=pa._defaultWorkerModulePrefix;pa._canTransferArrayBuffer=void 0;var yi=pa;function Vp(){}Vp._transcodeTaskProcessor=new yi("transcodeKTX2",Number.POSITIVE_INFINITY);Vp._readyPromise=void 0;function DRe(){let e=Vp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return Vp._transcodeTaskProcessor;throw new ce("KTX2 transcoder could not be initialized.")});Vp._readyPromise=e}Vp.transcode=function(e,t){return l(Vp._readyPromise)||DRe(),Vp._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;r<i;r++){let s=n[r];for(let a=0;a<o.length;a++){let c=s[o[a]];s[o[a]]=new bR(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 gR=Vp;var See;Cee.setKTX2SupportedFormats=function(e,t,n,i,o,r){See={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function Cee(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Re.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return gR.transcode(n,See)})}var Ll=Cee;var Lwt=_(T(),1);var BPt=_(T(),1);var SPt=_(T(),1);var lPt=_(T(),1);function ORe(e,t){this.start=e??0,this.stop=t??0}var Pa=ORe;function gn(e,t){this.center=m.clone(e??m.ZERO),this.radius=t??0}var UB=new m,DB=new m,OB=new m,BB=new m,YB=new m,zB=new m,HB=new m,ba=new m,KB=new m,JB=new m,QB=new m,jB=new m,BRe=4/3*X.PI;gn.fromPoints=function(e,t){if(l(t)||(t=new gn),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],HB),i=m.clone(n,UB),o=m.clone(n,DB),r=m.clone(n,OB),s=m.clone(n,BB),a=m.clone(n,YB),c=m.clone(n,zB),d=e.length,u;for(u=1;u<d;u++){m.clone(e[u],n);let W=n.x,v=n.y,A=n.z;W<i.x&&m.clone(n,i),W>s.x&&m.clone(n,s),v<o.y&&m.clone(n,o),v>a.y&&m.clone(n,a),A<r.z&&m.clone(n,r),A>c.z&&m.clone(n,c)}let h=m.magnitudeSquared(m.subtract(s,i,ba)),p=m.magnitudeSquared(m.subtract(a,o,ba)),g=m.magnitudeSquared(m.subtract(c,r,ba)),f=i,y=s,x=h;p>x&&(x=p,f=o,y=a),g>x&&(x=g,f=r,y=c);let S=KB;S.x=(f.x+y.x)*.5,S.y=(f.y+y.y)*.5,S.z=(f.z+y.z)*.5;let C=m.magnitudeSquared(m.subtract(y,S,ba)),V=Math.sqrt(C),L=JB;L.x=i.x,L.y=o.y,L.z=r.z;let Z=QB;Z.x=s.x,Z.y=a.y,Z.z=c.z;let E=m.midpoint(L,Z,jB),P=0;for(u=0;u<d;u++){m.clone(e[u],n);let W=m.magnitude(m.subtract(n,E,ba));W>P&&(P=W);let v=m.magnitudeSquared(m.subtract(n,S,ba));if(v>C){let A=Math.sqrt(v);V=(V+A)*.5,C=V*V;let b=A-V;S.x=(V*S.x+b*n.x)/A,S.y=(V*S.y+b*n.y)/A,S.z=(V*S.z+b*n.z)/A}}return V<P?(m.clone(S,t.center),t.radius=V):(m.clone(E,t.center),t.radius=P),t};var Vee=new Ii,YRe=new m,zRe=new m,NB=new he,kB=new he;gn.fromRectangle2D=function(e,t,n){return gn.fromRectangleWithHeights2D(e,t,0,0,n)};gn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new gn),!l(e))return o.center=m.clone(m.ZERO,o.center),o.radius=0,o;Vee._ellipsoid=ne.default,t=t??Vee,le.southwest(e,NB),NB.height=n,le.northeast(e,kB),kB.height=i;let r=t.project(NB,YRe),s=t.project(kB,zRe),a=s.x-r.x,c=s.y-r.y,d=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+d*d)*.5;let u=o.center;return u.x=r.x+a*.5,u.y=r.y+c*.5,u.z=r.z+d*.5,o};var HRe=[];gn.fromRectangle3D=function(e,t,n,i){if(t=t??ne.default,n=n??0,l(i)||(i=new gn),!l(e))return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;let o=le.subsample(e,t,n,HRe);return gn.fromPoints(o,i)};gn.fromVertices=function(e,t,n,i){if(l(i)||(i=new gn),!l(e)||e.length===0)return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;t=t??m.ZERO,n=n??3;let o=HB;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=m.clone(o,UB),s=m.clone(o,DB),a=m.clone(o,OB),c=m.clone(o,BB),d=m.clone(o,YB),u=m.clone(o,zB),h=e.length,p;for(p=0;p<h;p+=n){let A=e[p]+t.x,b=e[p+1]+t.y,R=e[p+2]+t.z;o.x=A,o.y=b,o.z=R,A<r.x&&m.clone(o,r),A>c.x&&m.clone(o,c),b<s.y&&m.clone(o,s),b>d.y&&m.clone(o,d),R<a.z&&m.clone(o,a),R>u.z&&m.clone(o,u)}let g=m.magnitudeSquared(m.subtract(c,r,ba)),f=m.magnitudeSquared(m.subtract(d,s,ba)),y=m.magnitudeSquared(m.subtract(u,a,ba)),x=r,S=c,C=g;f>C&&(C=f,x=s,S=d),y>C&&(C=y,x=a,S=u);let V=KB;V.x=(x.x+S.x)*.5,V.y=(x.y+S.y)*.5,V.z=(x.z+S.z)*.5;let L=m.magnitudeSquared(m.subtract(S,V,ba)),Z=Math.sqrt(L),E=JB;E.x=r.x,E.y=s.y,E.z=a.z;let P=QB;P.x=c.x,P.y=d.y,P.z=u.z;let W=m.midpoint(E,P,jB),v=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 A=m.magnitude(m.subtract(o,W,ba));A>v&&(v=A);let b=m.magnitudeSquared(m.subtract(o,V,ba));if(b>L){let R=Math.sqrt(b);Z=(Z+R)*.5,L=Z*Z;let G=R-Z;V.x=(Z*V.x+G*o.x)/R,V.y=(Z*V.y+G*o.y)/R,V.z=(Z*V.z+G*o.z)/R}}return Z<v?(m.clone(V,i.center),i.radius=Z):(m.clone(W,i.center),i.radius=v),i};gn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new gn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=m.clone(m.ZERO,n.center),n.radius=0,n;let i=HB;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=m.clone(i,UB),r=m.clone(i,DB),s=m.clone(i,OB),a=m.clone(i,BB),c=m.clone(i,YB),d=m.clone(i,zB),u=e.length,h;for(h=0;h<u;h+=3){let v=e[h]+t[h],A=e[h+1]+t[h+1],b=e[h+2]+t[h+2];i.x=v,i.y=A,i.z=b,v<o.x&&m.clone(i,o),v>a.x&&m.clone(i,a),A<r.y&&m.clone(i,r),A>c.y&&m.clone(i,c),b<s.z&&m.clone(i,s),b>d.z&&m.clone(i,d)}let p=m.magnitudeSquared(m.subtract(a,o,ba)),g=m.magnitudeSquared(m.subtract(c,r,ba)),f=m.magnitudeSquared(m.subtract(d,s,ba)),y=o,x=a,S=p;g>S&&(S=g,y=r,x=c),f>S&&(S=f,y=s,x=d);let C=KB;C.x=(y.x+x.x)*.5,C.y=(y.y+x.y)*.5,C.z=(y.z+x.z)*.5;let V=m.magnitudeSquared(m.subtract(x,C,ba)),L=Math.sqrt(V),Z=JB;Z.x=o.x,Z.y=r.y,Z.z=s.z;let E=QB;E.x=a.x,E.y=c.y,E.z=d.z;let P=m.midpoint(Z,E,jB),W=0;for(h=0;h<u;h+=3){i.x=e[h]+t[h],i.y=e[h+1]+t[h+1],i.z=e[h+2]+t[h+2];let v=m.magnitude(m.subtract(i,P,ba));v>W&&(W=v);let A=m.magnitudeSquared(m.subtract(i,C,ba));if(A>V){let b=Math.sqrt(A);L=(L+b)*.5,V=L*L;let R=b-L;C.x=(L*C.x+R*i.x)/b,C.y=(L*C.y+R*i.y)/b,C.z=(L*C.z+R*i.z)/b}}return L<W?(m.clone(C,n.center),n.radius=L):(m.clone(P,n.center),n.radius=W),n};gn.fromCornerPoints=function(e,t,n){l(n)||(n=new gn);let i=m.midpoint(e,t,n.center);return n.radius=m.distance(i,t),n};gn.fromEllipsoid=function(e,t){return l(t)||(t=new gn),m.clone(m.ZERO,t.center),t.radius=e.maximumRadius,t};var KRe=new m;gn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new gn),!l(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return gn.clone(e[0],t);if(n===2)return gn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=gn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,m.distance(r,a.center,KRe)+a.radius)}return t.radius=s,t};var JRe=new m,QRe=new m,jRe=new m;gn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new gn);let n=e.halfAxes,i=$.getColumn(n,0,JRe),o=$.getColumn(n,1,QRe),r=$.getColumn(n,2,jRe);return m.add(i,o,i),m.add(i,r,i),t.center=m.clone(e.center,t.center),t.radius=m.magnitude(i),t};var qRe=new m,$Re=new m;gn.fromTransformation=function(e,t){l(t)||(t=new gn);let n=F.getTranslation(e,qRe),i=F.getScale(e,$Re),o=.5*m.magnitude(i);return t.center=m.clone(n,t.center),t.radius=o,t};gn.clone=function(e,t){if(l(e))return l(t)?(t.center=m.clone(e.center,t.center),t.radius=e.radius,t):new gn(e.center,e.radius)};gn.packedLength=4;gn.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};gn.unpack=function(e,t,n){t=t??0,l(n)||(n=new gn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var eZe=new m,tZe=new m;gn.union=function(e,t,n){l(n)||(n=new gn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=m.subtract(r,i,eZe),c=m.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let d=(o+c+s)*.5,u=m.multiplyByScalar(a,(-o+d)/c,tZe);return m.add(u,i,u),m.clone(u,n.center),n.radius=d,n};var nZe=new m;gn.expand=function(e,t,n){n=gn.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,nZe));return i>n.radius&&(n.radius=i),n};gn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=m.dot(o,n)+t.distance;return r<-i?Jt.OUTSIDE:r<i?Jt.INTERSECTING:Jt.INSIDE};gn.transform=function(e,t,n){return l(n)||(n=new gn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var iZe=new m;gn.distanceSquaredTo=function(e,t){let n=m.subtract(e.center,t,iZe),i=m.magnitude(n)-e.radius;return i<=0?0:i*i};gn.transformWithoutScale=function(e,t,n){return l(n)||(n=new gn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var oZe=new m;gn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Pa);let o=m.subtract(e.center,t,oZe),r=m.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var Lee=new m,rZe=new m,sZe=new m,aZe=new m,cZe=new m,lZe=new he,Zee=new Array(8);for(let e=0;e<8;++e)Zee[e]=new m;var Ree=new Ii;gn.projectTo2D=function(e,t,n){Ree._ellipsoid=ne.default,t=t??Ree;let i=t.ellipsoid,o=e.center,r=e.radius,s;m.equals(o,m.ZERO)?s=m.clone(m.UNIT_X,Lee):s=i.geodeticSurfaceNormal(o,Lee);let a=m.cross(m.UNIT_Z,s,rZe);m.normalize(a,a);let c=m.cross(s,a,sZe);m.normalize(c,c),m.multiplyByScalar(s,r,s),m.multiplyByScalar(c,r,c),m.multiplyByScalar(a,r,a);let d=m.negate(c,cZe),u=m.negate(a,aZe),h=Zee,p=h[0];m.add(s,c,p),m.add(p,a,p),p=h[1],m.add(s,c,p),m.add(p,u,p),p=h[2],m.add(s,d,p),m.add(p,u,p),p=h[3],m.add(s,d,p),m.add(p,a,p),m.negate(s,s),p=h[4],m.add(s,c,p),m.add(p,a,p),p=h[5],m.add(s,c,p),m.add(p,u,p),p=h[6],m.add(s,d,p),m.add(p,u,p),p=h[7],m.add(s,d,p),m.add(p,a,p);let g=h.length;for(let S=0;S<g;++S){let C=h[S];m.add(o,C,C);let V=i.cartesianToCartographic(C,lZe);t.project(V,C)}n=gn.fromPoints(h,n),o=n.center;let f=o.x,y=o.y,x=o.z;return o.x=x,o.y=f,o.z=y,n};gn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};gn.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&e.radius===t.radius};gn.prototype.intersectPlane=function(e){return gn.intersectPlane(this,e)};gn.prototype.distanceSquaredTo=function(e){return gn.distanceSquaredTo(this,e)};gn.prototype.computePlaneDistances=function(e,t,n){return gn.computePlaneDistances(this,e,t,n)};gn.prototype.isOccluded=function(e){return gn.isOccluded(this,e)};gn.prototype.equals=function(e){return gn.equals(this,e)};gn.prototype.clone=function(e){return gn.clone(this,e)};gn.prototype.volume=function(){let e=this.radius;return BRe*e*e*e};var de=gn;var LPt=_(T(),1);function dZe(e){e=e??Y.EMPTY_OBJECT,this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var pn=dZe;var ZPt=_(T(),1),uZe={NONE:0,TOP:1,ALL:2},ln=Object.freeze(uZe);var XPt=_(T(),1);function ps(e){e=e??Y.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}ps.POSITION_ONLY=Object.freeze(new ps({position:!0}));ps.POSITION_AND_NORMAL=Object.freeze(new ps({position:!0,normal:!0}));ps.POSITION_NORMAL_AND_ST=Object.freeze(new ps({position:!0,normal:!0,st:!0}));ps.POSITION_AND_ST=Object.freeze(new ps({position:!0,st:!0}));ps.POSITION_AND_COLOR=Object.freeze(new ps({position:!0,color:!0}));ps.ALL=Object.freeze(new ps({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ps.DEFAULT=ps.POSITION_NORMAL_AND_ST;ps.packedLength=6;ps.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};ps.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ps),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};ps.clone=function(e,t){if(l(e))return l(t)||(t=new ps),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 Xe=ps;var mZe=new m;function dd(e){e=e??Y.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??Xe.DEFAULT;this._minimum=m.clone(t),this._maximum=m.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}dd.fromDimensions=function(e){e=e??Y.EMPTY_OBJECT;let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new dd({minimum:m.negate(n,new m),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};dd.fromAxisAlignedBoundingBox=function(e){return new dd({minimum:e.minimum,maximum:e.maximum})};dd.packedLength=2*m.packedLength+Xe.packedLength+1;dd.pack=function(e,t,n){return n=n??0,m.pack(e._minimum,t,n),m.pack(e._maximum,t,n+m.packedLength),Xe.pack(e._vertexFormat,t,n+2*m.packedLength),t[n+2*m.packedLength+Xe.packedLength]=e._offsetAttribute??-1,t};var Eee=new m,Iee=new m,Xee=new Xe,Gee={minimum:Eee,maximum:Iee,vertexFormat:Xee,offsetAttribute:void 0};dd.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,Eee),o=m.unpack(e,t+m.packedLength,Iee),r=Xe.unpack(e,t+2*m.packedLength,Xee),s=e[t+2*m.packedLength+Xe.packedLength];return l(n)?(n._minimum=m.clone(i,n._minimum),n._maximum=m.clone(o,n._maximum),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Gee.offsetAttribute=s===-1?void 0:s,new dd(Gee))};dd.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(m.equals(t,n))return;let o=new pn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let d=new Float32Array(72);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=1,d[9]=0,d[10]=0,d[11]=1,d[12]=0,d[13]=0,d[14]=-1,d[15]=0,d[16]=0,d[17]=-1,d[18]=0,d[19]=0,d[20]=-1,d[21]=0,d[22]=0,d[23]=-1,d[24]=1,d[25]=0,d[26]=0,d[27]=1,d[28]=0,d[29]=0,d[30]=1,d[31]=0,d[32]=0,d[33]=1,d[34]=0,d[35]=0,d[36]=-1,d[37]=0,d[38]=0,d[39]=-1,d[40]=0,d[41]=0,d[42]=-1,d[43]=0,d[44]=0,d[45]=-1,d[46]=0,d[47]=0,d[48]=0,d[49]=1,d[50]=0,d[51]=0,d[52]=1,d[53]=0,d[54]=0,d[55]=1,d[56]=0,d[57]=0,d[58]=1,d[59]=0,d[60]=0,d[61]=-1,d[62]=0,d[63]=0,d[64]=-1,d[65]=0,d[66]=0,d[67]=-1,d[68]=0,d[69]=0,d[70]=-1,d[71]=0,o.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}if(i.st){let d=new Float32Array(48);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=1,d[5]=1,d[6]=0,d[7]=1,d[8]=1,d[9]=0,d[10]=0,d[11]=0,d[12]=0,d[13]=1,d[14]=1,d[15]=1,d[16]=0,d[17]=0,d[18]=1,d[19]=0,d[20]=1,d[21]=1,d[22]=0,d[23]=1,d[24]=1,d[25]=0,d[26]=0,d[27]=0,d[28]=0,d[29]=1,d[30]=1,d[31]=1,d[32]=1,d[33]=0,d[34]=0,d[35]=0,d[36]=0,d[37]=1,d[38]=1,d[39]=1,d[40]=0,d[41]=0,d[42]=1,d[43]=0,d[44]=1,d[45]=1,d[46]=0,d[47]=1,o.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:d})}if(i.tangent){let d=new Float32Array(72);d[0]=1,d[1]=0,d[2]=0,d[3]=1,d[4]=0,d[5]=0,d[6]=1,d[7]=0,d[8]=0,d[9]=1,d[10]=0,d[11]=0,d[12]=-1,d[13]=0,d[14]=0,d[15]=-1,d[16]=0,d[17]=0,d[18]=-1,d[19]=0,d[20]=0,d[21]=-1,d[22]=0,d[23]=0,d[24]=0,d[25]=1,d[26]=0,d[27]=0,d[28]=1,d[29]=0,d[30]=0,d[31]=1,d[32]=0,d[33]=0,d[34]=1,d[35]=0,d[36]=0,d[37]=-1,d[38]=0,d[39]=0,d[40]=-1,d[41]=0,d[42]=0,d[43]=-1,d[44]=0,d[45]=0,d[46]=-1,d[47]=0,d[48]=-1,d[49]=0,d[50]=0,d[51]=-1,d[52]=0,d[53]=0,d[54]=-1,d[55]=0,d[56]=0,d[57]=-1,d[58]=0,d[59]=0,d[60]=1,d[61]=0,d[62]=0,d[63]=1,d[64]=0,d[65]=0,d[66]=1,d[67]=0,d[68]=0,d[69]=1,d[70]=0,d[71]=0,o.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}if(i.bitangent){let d=new Float32Array(72);d[0]=0,d[1]=1,d[2]=0,d[3]=0,d[4]=1,d[5]=0,d[6]=0,d[7]=1,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=1,d[14]=0,d[15]=0,d[16]=1,d[17]=0,d[18]=0,d[19]=1,d[20]=0,d[21]=0,d[22]=1,d[23]=0,d[24]=0,d[25]=0,d[26]=1,d[27]=0,d[28]=0,d[29]=1,d[30]=0,d[31]=0,d[32]=1,d[33]=0,d[34]=0,d[35]=1,d[36]=0,d[37]=0,d[38]=1,d[39]=0,d[40]=0,d[41]=1,d[42]=0,d[43]=0,d[44]=1,d[45]=0,d[46]=0,d[47]=1,d[48]=0,d[49]=0,d[50]=1,d[51]=0,d[52]=0,d[53]=1,d[54]=0,d[55]=0,d[56]=1,d[57]=0,d[58]=0,d[59]=1,d[60]=0,d[61]=0,d[62]=1,d[63]=0,d[64]=0,d[65]=1,d[66]=0,d[67]=0,d[68]=1,d[69]=0,d[70]=0,d[71]=1,o.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=m.subtract(n,t,mZe),c=m.magnitude(a)*.5;if(l(e._offsetAttribute)){let d=s.length,u=e._offsetAttribute===ln.NONE?0:1,h=new Uint8Array(d/3).fill(u);o.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new ht({attributes:o,indices:r,primitiveType:Ae.TRIANGLES,boundingSphere:new de(m.ZERO,c),offsetAttribute:e._offsetAttribute})};var qB;dd.getUnitBox=function(){return l(qB)||(qB=dd.createGeometry(dd.fromDimensions({dimensions:new m(1,1,1),vertexFormat:Xe.POSITION_ONLY}))),qB};var va=dd;var Cvt=_(T(),1);var s2t=_(T(),1);var qPt=_(T(),1);var ro={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};ro.getMathType=function(e){switch(e){case ro.SCALAR:return Number;case ro.VEC2:return U;case ro.VEC3:return m;case ro.VEC4:return re;case ro.MAT2:return Xi;case ro.MAT3:return $;case ro.MAT4:return F}};ro.getNumberOfComponents=function(e){switch(e){case ro.SCALAR:return 1;case ro.VEC2:return 2;case ro.VEC3:return 3;case ro.VEC4:case ro.MAT2:return 4;case ro.MAT3:return 9;case ro.MAT4:return 16}};ro.getAttributeLocationCount=function(e){switch(e){case ro.SCALAR:case ro.VEC2:case ro.VEC3:case ro.VEC4:return 1;case ro.MAT2:return 2;case ro.MAT3:return 3;case ro.MAT4:return 4}};ro.getGlslType=function(e){switch(e){case ro.SCALAR:return"float";case ro.VEC2:return"vec2";case ro.VEC3:return"vec3";case ro.VEC4:return"vec4";case ro.MAT2:return"mat2";case ro.MAT3:return"mat3";case ro.MAT4:return"mat4"}};var an=Object.freeze(ro);var Wee=1/256,Pee=256,So={};So.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))*X.signNotZero(i),n.y=(1-Math.abs(i))*X.signNotZero(o)}return n.x=X.toSNorm(n.x,t),n.y=X.toSNorm(n.y,t),n};So.octEncode=function(e,t){return So.octEncodeInRange(e,255,t)};var yR=new U,vee=new Uint8Array(1);function UN(e){return vee[0]=e,vee[0]}So.octEncodeToCartesian4=function(e,t){return So.octEncodeInRange(e,65535,yR),t.x=UN(yR.x*Wee),t.y=UN(yR.x),t.z=UN(yR.y*Wee),t.w=UN(yR.y),t};So.octDecodeInRange=function(e,t,n,i){if(i.x=X.fromSNorm(e,n),i.y=X.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))*X.signNotZero(o),i.y=(1-Math.abs(o))*X.signNotZero(i.y)}return m.normalize(i,i)};So.octDecode=function(e,t,n){return So.octDecodeInRange(e,t,255,n)};So.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*Pee+i,a=o*Pee+r;return So.octDecodeInRange(s,a,65535,t)};So.octPackFloat=function(e){return 256*e.x+e.y};var eY=new U;So.octEncodeFloat=function(e){return So.octEncode(e,eY),So.octPackFloat(eY)};So.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return So.octDecode(i,o,t)};So.octPack=function(e,t,n,i){let o=So.octEncodeFloat(e),r=So.octEncodeFloat(t),s=So.octEncode(n,eY);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};So.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;So.octDecodeFloat(s,t),So.octDecodeFloat(c,n),So.octDecode(r,a,i)};So.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};So.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 $B(e){return e>>1^-(e&1)}So.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=$B(e[a]),r+=$B(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=$B(n[a]),n[a]=s)};So.dequantize=function(e,t,n,i){let o=an.getNumberOfComponents(n),r;switch(t){case Q.BYTE:r=127;break;case Q.UNSIGNED_BYTE:r=255;break;case Q.SHORT:r=32767;break;case Q.UNSIGNED_SHORT:r=65535;break;case Q.INT:r=2147483647;break;case Q.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let d=a*o+c;s[d]=Math.max(e[d]/r,-1)}return s};So.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],d=c>>11,u=c>>5&o,h=c&i,p=3*a;t[p]=d*r,t[p+1]=u*s,t[p+2]=h*r}return t};var Fn=So;var m2t=_(T(),1);var wee=new m,Fee=new m,Aee=new m;function hZe(e,t,n,i,o){l(o)||(o=new m);let r,s,a,c,d,u,h,p;if(l(t.z)){if(m.equalsEpsilon(e,t,X.EPSILON14))return m.clone(m.UNIT_X,o);if(m.equalsEpsilon(e,n,X.EPSILON14))return m.clone(m.UNIT_Y,o);if(m.equalsEpsilon(e,i,X.EPSILON14))return m.clone(m.UNIT_Z,o);r=m.subtract(n,t,wee),s=m.subtract(i,t,Fee),a=m.subtract(e,t,Aee),c=m.dot(r,r),d=m.dot(r,s),u=m.dot(r,a),h=m.dot(s,s),p=m.dot(s,a)}else{if(U.equalsEpsilon(e,t,X.EPSILON14))return m.clone(m.UNIT_X,o);if(U.equalsEpsilon(e,n,X.EPSILON14))return m.clone(m.UNIT_Y,o);if(U.equalsEpsilon(e,i,X.EPSILON14))return m.clone(m.UNIT_Z,o);r=U.subtract(n,t,wee),s=U.subtract(i,t,Fee),a=U.subtract(e,t,Aee),c=U.dot(r,r),d=U.dot(r,s),u=U.dot(r,a),h=U.dot(s,s),p=U.dot(s,a)}o.y=h*u-d*p,o.z=c*p-d*u;let g=c*h-d*d;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var hx=hZe;var b2t=_(T(),1);function rf(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}rf.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 Lp={high:0,low:0};rf.fromCartesian=function(e,t){l(t)||(t=new rf);let n=t.high,i=t.low;return rf.encode(e.x,Lp),n.x=Lp.high,i.x=Lp.low,rf.encode(e.y,Lp),n.y=Lp.high,i.y=Lp.low,rf.encode(e.z,Lp),n.z=Lp.high,i.z=Lp.low,t};var tY=new rf;rf.writeElements=function(e,t,n){rf.fromCartesian(e,tY);let i=tY.high,o=tY.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 Yn=rf;var D2t=_(T(),1);var x2t=_(T(),1);var nY={};nY.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Mee(e,t,n){let i=e+t;return X.sign(e)!==X.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}nY.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),d=Math.abs(e);if(c<d&&c/d<X.EPSILON14)return[0,0];if(c>d&&d/c<X.EPSILON14)return[];if(i=-n/e,i<0)return[];let u=Math.sqrt(i);return[-u,u]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=Mee(o,-r,X.EPSILON14);if(s<0)return[];let a=-.5*Mee(t,X.sign(t)*Math.sqrt(s),X.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Ac=nY;var Z2t=_(T(),1);var S2t=_(T(),1);var oY={};oY.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function iY(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,d=r*a,u=r*r,h=s*s,p=o*s-u,g=o*a-r*s,f=r*a-h,y=4*p*f-g*g,x,S;if(y<0){let z,K,te;u*d>=c*h?(z=o,K=p,te=-2*r*p+o*g):(z=a,K=f,te=-a*g+2*s*f);let j=-(te<0?-1:1)*Math.abs(z)*Math.sqrt(-y);S=-te+j;let ee=S/2,pe=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),_e=S===j?-pe:-K/pe;return x=K<=0?pe+_e:-te/(pe*pe+_e*_e+K),u*d>=c*h?[(x-r)/o]:[-a/(x+s)]}let C=p,V=-2*r*p+o*g,L=f,Z=-a*g+2*s*f,E=Math.sqrt(y),P=Math.sqrt(3)/2,W=Math.abs(Math.atan2(o*E,-V)/3);x=2*Math.sqrt(-C);let v=Math.cos(W);S=x*v;let A=x*(-v/2-P*Math.sin(W)),b=S+A>2*r?S-r:A-r,R=o,G=b/R;W=Math.abs(Math.atan2(a*E,-Z)/3),x=2*Math.sqrt(-L),v=Math.cos(W),S=x*v,A=x*(-v/2-P*Math.sin(W));let I=-a,w=S+A<2*s?S+s:A+s,M=I/w,O=R*w,k=-b*w-R*I,B=b*I,N=(s*k-r*B)/(-r*k+s*O);return G<=N?G<=M?N<=M?[G,N,M]:[G,M,N]:[M,G,N]:G<=M?[N,G,M]:N<=M?[N,M,G]:[M,N,G]}oY.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Ac.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Ac.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return iY(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):iY(e,t,0,i);if(i===0)return o=Ac.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 iY(e,t,n,i)};var fx=oY;var rY={};rY.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,d=n*n,u=d*n,h=i*i,p=h*i,g=o*o,f=g*o;return a*d*h-4*c*p-4*e*u*h+18*e*t*n*p-27*r*h*h+256*s*f+o*(18*c*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*h+144*r*n*h)+g*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function Rm(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=fx.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let d=-e/4,u=c[c.length-1];if(Math.abs(u)<X.EPSILON14){let h=Ac.computeRealRoots(1,r,a);if(h.length===2){let p=h[0],g=h[1],f;if(p>=0&&g>=0){let y=Math.sqrt(p),x=Math.sqrt(g);return[d-x,d-y,d+y,d+x]}else{if(p>=0&&g<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}}return[]}else if(u>0){let h=Math.sqrt(u),p=(r+u-s/h)/2,g=(r+u+s/h)/2,f=Ac.computeRealRoots(1,h,p),y=Ac.computeRealRoots(1,-h,g);return f.length!==0?(f[0]+=d,f[1]+=d,y.length!==0?(y[0]+=d,y[1]+=d,f[1]<=y[0]?[f[0],f[1],y[0],y[1]]:y[1]<=f[0]?[y[0],y[1],f[0],f[1]]:f[0]>=y[0]&&f[1]<=y[1]?[y[0],f[0],f[1],y[1]]:y[0]>=f[0]&&y[1]<=f[1]?[f[0],y[0],y[1],f[1]]:f[0]>y[0]&&f[0]<y[1]?[y[0],f[0],y[1],f[1]]:[f[0],y[0],f[1],y[1]]):f):y.length!==0?(y[0]+=d,y[1]+=d,y):[]}}return[]}function xR(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,d=s*i-n*t*e+o,u=fx.computeRealRoots(1,a,c,d);if(u.length>0){let h=u[0],p=t-h,g=p*p,f=e/2,y=p/2,x=g-4*i,S=g+4*Math.abs(i),C=s-4*h,V=s+4*Math.abs(h),L,Z;if(h<0||x*V<C*S){let R=Math.sqrt(C);L=R/2,Z=R===0?0:(e*y-n)/R}else{let R=Math.sqrt(x);L=R===0?0:(e*y-n)/R,Z=R/2}let E,P;f===0&&L===0?(E=0,P=0):X.sign(f)===X.sign(L)?(E=f+L,P=h/E):(P=f-L,E=h/P);let W,v;y===0&&Z===0?(W=0,v=0):X.sign(y)===X.sign(Z)?(W=y+Z,v=i/W):(v=y-Z,W=i/v);let A=Ac.computeRealRoots(1,E,W),b=Ac.computeRealRoots(1,P,v);if(A.length!==0)return b.length!==0?A[1]<=b[0]?[A[0],A[1],b[0],b[1]]:b[1]<=A[0]?[b[0],b[1],A[0],A[1]]:A[0]>=b[0]&&A[1]<=b[1]?[b[0],A[0],A[1],b[1]]:b[0]>=A[0]&&b[1]<=A[1]?[A[0],b[0],b[1],A[1]]:A[0]>b[0]&&A[0]<b[1]?[b[0],A[0],b[1],A[1]]:[A[0],b[0],A[1],b[1]]:A;if(b.length!==0)return b}return[]}rY.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<X.EPSILON15)return fx.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,d=r<0?1:0;switch(d+=s<0?d+1:d,d+=a<0?d+1:d,d+=c<0?d+1:d,d){case 0:return Rm(r,s,a,c);case 1:return xR(r,s,a,c);case 2:return xR(r,s,a,c);case 3:return Rm(r,s,a,c);case 4:return Rm(r,s,a,c);case 5:return xR(r,s,a,c);case 6:return Rm(r,s,a,c);case 7:return Rm(r,s,a,c);case 8:return xR(r,s,a,c);case 9:return Rm(r,s,a,c);case 10:return Rm(r,s,a,c);case 11:return xR(r,s,a,c);case 12:return Rm(r,s,a,c);case 13:return Rm(r,s,a,c);case 14:return Rm(r,s,a,c);case 15:return Rm(r,s,a,c);default:return}};var _R=rY;var X2t=_(T(),1);function DN(e,t){t=m.clone(t??m.ZERO),m.equals(t,m.ZERO)||m.normalize(t,t),this.origin=m.clone(e??m.ZERO),this.direction=t}DN.clone=function(e,t){if(l(e))return l(t)?(t.origin=m.clone(e.origin),t.direction=m.clone(e.direction),t):new DN(e.origin,e.direction)};DN.getPoint=function(e,t,n){return l(n)||(n=new m),n=m.multiplyByScalar(e.direction,t,n),m.add(e.origin,n,n)};var yn=DN;var No={};No.rayPlane=function(e,t,n){l(n)||(n=new m);let i=e.origin,o=e.direction,r=t.normal,s=m.dot(r,o);if(Math.abs(s)<X.EPSILON15)return;let a=(-t.distance-m.dot(r,i))/s;if(!(a<0))return n=m.multiplyByScalar(o,a,n),m.add(i,n,n)};var fZe=new m,pZe=new m,zee=new m,Nee=new m,kee=new m;No.rayTriangleParametric=function(e,t,n,i,o){o=o??!1;let r=e.origin,s=e.direction,a=m.subtract(n,t,fZe),c=m.subtract(i,t,pZe),d=m.cross(s,c,zee),u=m.dot(a,d),h,p,g,f,y;if(o){if(u<X.EPSILON6||(h=m.subtract(r,t,Nee),g=m.dot(h,d),g<0||g>u)||(p=m.cross(h,a,kee),f=m.dot(s,p),f<0||g+f>u))return;y=m.dot(c,p)/u}else{if(Math.abs(u)<X.EPSILON6)return;let x=1/u;if(h=m.subtract(r,t,Nee),g=m.dot(h,d)*x,g<0||g>1||(p=m.cross(h,a,kee),f=m.dot(s,p)*x,f<0||g+f>1))return;y=m.dot(c,p)*x}return y};No.rayTriangle=function(e,t,n,i,o,r){let s=No.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new m),m.multiplyByScalar(e.direction,s,r),m.add(e.origin,r,r)};var bZe=new yn;No.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=bZe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=No.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function gZe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,d=(-t-a)*s;return c<d?(i.root0=c,i.root1=d):(i.root0=d,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var yZe={root0:0,root1:0};function Hee(e,t,n){l(n)||(n=new Pa);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=m.subtract(i,r,zee),c=m.dot(o,o),d=2*m.dot(o,a),u=m.magnitudeSquared(a)-s,h=gZe(c,d,u,yZe);if(l(h))return n.start=h.root0,n.stop=h.root1,n}No.raySphere=function(e,t,n){if(n=Hee(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var xZe=new yn;No.lineSegmentSphere=function(e,t,n,i){let o=xZe;m.clone(e,o.origin);let r=m.subtract(t,e,o.direction),s=m.magnitude(r);if(m.normalize(r,r),i=Hee(o,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var _Ze=new m,TZe=new m;No.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,_Ze),o=m.multiplyComponents(n,e.direction,TZe),r=m.magnitudeSquared(i),s=m.dot(i,o),a,c,d,u,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=m.magnitudeSquared(o),d=c*a,p<d)return;if(p>d){u=s*s-d,h=-s+Math.sqrt(u);let f=h/c,y=a/h;return f<y?new Pa(f,y):{start:y,stop:f}}let g=Math.sqrt(a/c);return new Pa(g,g)}else if(r<1)return a=r-1,c=m.magnitudeSquared(o),d=c*a,u=s*s-d,h=-s+Math.sqrt(u),new Pa(0,h/c);if(s<0)return c=m.magnitudeSquared(o),new Pa(0,-s/c)};function px(e,t,n){let i=e+t;return X.sign(e)!==X.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}No.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=o*(i*px(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],X.EPSILON15)+t.y),d=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*s+i*t.x+n,u=s*px(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],X.EPSILON15),h=o*(i*px(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(h===0&&u===0){if(p=Ac.computeRealRoots(a,c,d),p.length===0)return g;let W=p[0],v=Math.sqrt(Math.max(1-W*W,0));if(g.push(new m(i,o*W,o*-v)),g.push(new m(i,o*W,o*v)),p.length===2){let A=p[1],b=Math.sqrt(Math.max(1-A*A,0));g.push(new m(i,o*A,o*-b)),g.push(new m(i,o*A,o*b))}return g}let f=h*h,y=u*u,x=a*a,S=h*u,C=x+y,V=2*(c*a+S),L=2*d*a+c*c-y+f,Z=2*(d*c-S),E=d*d-f;if(C===0&&V===0&&L===0&&Z===0)return g;p=_R.computeRealRoots(C,V,L,Z,E);let P=p.length;if(P===0)return g;for(let W=0;W<P;++W){let v=p[W],A=v*v,b=Math.max(1-A,0),R=Math.sqrt(b),G;X.sign(a)===X.sign(d)?G=px(a*A+d,c*v,X.EPSILON12):X.sign(d)===X.sign(c*v)?G=px(a*A,c*v+d,X.EPSILON12):G=px(a*A+c*v,d,X.EPSILON12);let I=px(u*v,h,X.EPSILON15),w=G*I;w<0?g.push(new m(i,o*v,o*R)):w>0?g.push(new m(i,o*v,o*-R)):R!==0?(g.push(new m(i,o*v,o*-R)),g.push(new m(i,o*v,o*R)),++W):g.push(new m(i,o*v,o*R))}return g};var sY=new m,Uee=new m,Dee=new m,ON=new m,SZe=new m,CZe=new $,VZe=new $,LZe=new $,RZe=new $,ZZe=new $,Oee=new $,Bee=new $,Yee=new m,GZe=new m,EZe=new he;No.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let E=t.geodeticSurfaceNormal(n,sY);if(m.dot(i,E)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,sY),s=m.normalize(r,r),a=m.mostOrthogonalAxis(r,ON),c=m.normalize(m.cross(a,s,Uee),Uee),d=m.normalize(m.cross(s,c,Dee),Dee),u=CZe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=c.x,u[4]=c.y,u[5]=c.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let h=$.transpose(u,VZe),p=$.fromScale(t.radii,LZe),g=$.fromScale(t.oneOverRadii,RZe),f=ZZe;f[0]=0,f[1]=-i.z,f[2]=i.y,f[3]=i.z,f[4]=0,f[5]=-i.x,f[6]=-i.y,f[7]=i.x,f[8]=0;let y=$.multiply($.multiply(h,g,Oee),f,Oee),x=$.multiply($.multiply(y,p,Bee),u,Bee),S=$.multiplyByVector(y,n,SZe),C=No.quadraticVectorExpression(x,m.negate(S,sY),0,0,1),V,L,Z=C.length;if(Z>0){let E=m.clone(m.ZERO,GZe),P=Number.NEGATIVE_INFINITY;for(let v=0;v<Z;++v){V=$.multiplyByVector(p,$.multiplyByVector(u,C[v],Yee),Yee);let A=m.normalize(m.subtract(V,n,ON),ON),b=m.dot(A,i);b>P&&(P=b,E=m.clone(V,E))}let W=t.cartesianToCartographic(E,EZe);return P=X.clamp(P,0,1),L=m.magnitude(m.subtract(E,n,ON))*Math.sqrt(1-P*P),L=o?-L:L,W.height=L,t.cartographicToCartesian(W,new m)}};var IZe=new m;No.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let o=m.subtract(t,e,IZe),r=n.normal,s=m.dot(r,o);if(Math.abs(s)<X.EPSILON6)return;let a=m.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return m.multiplyByScalar(o,c,i),m.add(e,i,i),i};No.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=m.dot(o,e)+r<0,a=m.dot(o,t)+r<0,c=m.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=c?1:0;let u,h;if((d===1||d===2)&&(u=new m,h=new m),d===1){if(s)return No.lineSegmentPlane(e,t,i,u),No.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,u,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return No.lineSegmentPlane(t,n,i,u),No.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,u,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return No.lineSegmentPlane(n,e,i,u),No.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,u,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!c)return No.lineSegmentPlane(e,n,i,u),No.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,u,h],indices:[0,1,4,0,4,3,2,3,4]}}else return No.lineSegmentPlane(n,t,i,u),No.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,u,h],indices:[2,0,4,2,4,3,1,3,4]};else return No.lineSegmentPlane(t,e,i,u),No.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,u,h],indices:[1,2,4,1,4,3,0,3,4]}};var ei=No;var K2t=_(T(),1);function Bs(e,t){this.normal=m.clone(e),this.distance=t}Bs.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new Bs(t,i)};var XZe=new m;Bs.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,XZe),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new Bs(n,i)};Bs.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var WZe=new m;Bs.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=Bs.getPointDistance(e,t),o=m.multiplyByScalar(e.normal,i,WZe);return m.subtract(t,o,n)};var PZe=new F,vZe=new re,wZe=new m;Bs.transform=function(e,t,n){let i=e.normal,o=e.distance,r=F.inverseTranspose(t,PZe),s=re.fromElements(i.x,i.y,i.z,o,vZe);s=F.multiplyByVector(r,s,s);let a=m.fromCartesian4(s,wZe);return s=re.divideByScalar(s,m.magnitude(a),s),Bs.fromCartesian4(s,n)};Bs.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new Bs(e.normal,e.distance)};Bs.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};Bs.ORIGIN_XY_PLANE=Object.freeze(new Bs(m.UNIT_Z,0));Bs.ORIGIN_YZ_PLANE=Object.freeze(new Bs(m.UNIT_X,0));Bs.ORIGIN_ZX_PLANE=Object.freeze(new Bs(m.UNIT_Y,0));var dn=Bs;var q2t=_(T(),1);var aY={};aY.calculateACMR=function(e){e=e??Y.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};aY.tipsify=function(e){e=e??Y.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(b,R,G,I){for(;R.length>=1;){let w=R[R.length-1];if(R.splice(R.length-1,1),b[w].numLiveTriangles>0)return w}for(;o<I;){if(b[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(b,R,G,I,w,M,O){let k=-1,B,N=-1,z=0;for(;z<G.length;){let K=G[z];I[K].numLiveTriangles&&(B=0,w-I[K].timeStamp+2*I[K].numLiveTriangles<=R&&(B=w-I[K].timeStamp),(B>N||N===-1)&&(N=B,k=K)),++z}return k===-1?r(I,M,b,O):k}let a=t.length,c=0,d=0,u=t[d],h=a;if(l(n))c=n+1;else{for(;d<h;)u>c&&(c=u),++d,u=t[d];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};d=0;let f=0;for(;d<h;)p[t[d]].vertexTriangles.push(f),++p[t[d]].numLiveTriangles,p[t[d+1]].vertexTriangles.push(f),++p[t[d+1]].numLiveTriangles,p[t[d+2]].vertexTriangles.push(f),++p[t[d+2]].numLiveTriangles,++f,d+=3;let y=0,x=i+1;o=1;let S=[],C=[],V,L,Z=0,E=[],P=a/3,W=[];for(g=0;g<P;g++)W[g]=!1;let v,A;for(;y!==-1;){S=[],L=p[y],A=L.vertexTriangles.length;for(let b=0;b<A;++b)if(f=L.vertexTriangles[b],!W[f]){W[f]=!0,d=f+f+f;for(let R=0;R<3;++R)v=t[d],S.push(v),C.push(v),E[Z]=v,++Z,V=p[v],--V.numLiveTriangles,x-V.timeStamp>i&&(V.timeStamp=x,++x),++d}y=s(t,i,S,p,x,C,c)}return E};var TR=aY;var Mc={};function QN(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function FZe(e){let t=e.length,n=t/3*6,i=Ne.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)QN(i,o,e[r],e[r+1],e[r+2]);return i}function AZe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ne.createTypedArray(t,n);QN(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)QN(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function MZe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ne.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)QN(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Mc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Ae.TRIANGLES:e.indices=FZe(t);break;case Ae.TRIANGLE_STRIP:e.indices=AZe(t);break;case Ae.TRIANGLE_FAN:e.indices=MZe(t);break}e.primitiveType=Ae.LINES}return e};Mc.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let u=0;u<r;u+=3)s[a++]=i[u],s[a++]=i[u+1],s[a++]=i[u+2],s[a++]=i[u]+o[u]*n,s[a++]=i[u+1]+o[u+1]*n,s[a++]=i[u+2]+o[u+2]*n;let c,d=e.boundingSphere;return l(d)&&(c=new de(d.center,d.radius+n)),new ht({attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Ae.LINES,boundingSphere:c})};Mc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];l(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=o++);return i};Mc.reorderForPreVertexCache=function(e){let t=ht.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Ne.createTypedArray(t,r),a=0,c=0,d=0,u;for(;a<r;)u=i[o[a]],u!==-1?s[c]=u:(u=o[a],i[u]=d,s[c]=d,++d),++a,++c;e.indices=s;let h=e.attributes;for(let p in h)if(h.hasOwnProperty(p)&&l(h[p])&&l(h[p].values)){let g=h[p],f=g.values,y=0,x=g.componentsPerAttribute,S=Q.createTypedArray(g.componentDatatype,d*x);for(;y<t;){let C=i[y];if(C!==-1)for(let V=0;V<x;V++)S[x*C+V]=f[x*y+V];++y}g.values=S}}return e};Mc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Ae.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=TR.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Kee(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 Ze({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function NZe(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])}}Mc.fitToUnsignedShortIndices=function(e){let t=[],n=ht.computeNumberOfVertices(e);if(l(e.indices)&&n>=X.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Kee(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===Ae.TRIANGLES?d=3:e.primitiveType===Ae.LINES?d=2:e.primitiveType===Ae.POINTS&&(d=1);for(let u=0;u<c;u+=d){for(let h=0;h<d;++h){let p=a[u+h],g=i[p];l(g)||(g=r++,i[p]=g,NZe(s,e.attributes,p)),o.push(g)}r+d>=X.SIXTY_FOUR_KILOBYTES&&(t.push(new ht({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Kee(e.attributes))}o.length!==0&&t.push(new ht({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Jee=new m,kZe=new he;Mc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Ii;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),d=0;for(let u=0;u<a.length;u+=3){let h=m.fromArray(a,u,Jee),p=s.cartesianToCartographic(h,kZe),g=o.project(p,Jee);c[d++]=g.x,c[d++]=g.y,c[d++]=g.z}return e.attributes[n]=r,e.attributes[i]=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var cY={high:0,low:0};Mc.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let u=0;u<s;++u)Yn.encode(r[u],cY),a[u]=cY.high,c[u]=cY.low;let d=o.componentsPerAttribute;return e.attributes[n]=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:d,values:a}),e.attributes[i]=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var Gm=new m;function lY(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)m.unpack(n,o,Gm),F.multiplyByPoint(e,Gm,Gm),m.pack(Gm,n,o)}}function dY(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)m.unpack(n,o,Gm),$.multiplyByVector(e,Gm,Gm),Gm=m.normalize(Gm,Gm),m.pack(Gm,n,o)}}var BN=new F,YN=new $;Mc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;lY(t,n.position),lY(t,n.prevPosition),lY(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(F.inverse(t,BN),F.transpose(BN,BN),F.getMatrix3(BN,YN),dY(YN,n.normal),dY(YN,n.tangent),dY(YN,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=de.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function UZe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let d=1;d<n;++d){let u=e[d][t].attributes[r];if(!l(u)||s.componentDatatype!==u.componentDatatype||s.componentsPerAttribute!==u.componentsPerAttribute||s.normalize!==u.normalize){c=!1;break}a+=u.values.length}c&&(i[r]=new Ze({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Q.createTypedArray(s.componentDatatype,a)}))}return i}var DZe=new m;function uY(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),d=e[0][t].primitiveType,u=UZe(e,t),h,p,g;for(i in u)if(u.hasOwnProperty(i))for(h=u[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,g=p.length,r=0;r<g;++r)h[s++]=p[r];let f;if(c){let C=0;for(o=0;o<n;++o)C+=e[o][t].indices.length;let V=ht.computeNumberOfVertices(new ht({attributes:u,primitiveType:Ae.POINTS})),L=Ne.createTypedArray(V,C),Z=0,E=0;for(o=0;o<n;++o){let P=e[o][t].indices,W=P.length;for(s=0;s<W;++s)L[Z++]=E+P[s];E+=ht.computeNumberOfVertices(e[o][t])}f=L}let y=new m,x=0,S;for(o=0;o<n;++o){if(S=e[o][t].boundingSphere,!l(S)){y=void 0;break}m.add(S.center,y,y)}if(l(y))for(m.divideByScalar(y,n,y),o=0;o<n;++o){S=e[o][t].boundingSphere;let C=m.magnitude(m.subtract(S.center,y,DZe))+S.radius;C>x&&(x=C)}return new ht({attributes:u,indices:f,primitiveType:d,boundingSphere:l(y)?new de(y,x):void 0})}Mc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(uY(t,"geometry")),n.length>0&&(o.push(uY(n,"westHemisphereGeometry")),o.push(uY(n,"eastHemisphereGeometry"))),o};var pu=new m,SR=new m,nC=new m,iC=new m;Mc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),d;for(d=0;d<o;d++)s[d]={indexOffset:0,count:0,currentCount:0};let u=0;for(d=0;d<r;d+=3){let f=t[d],y=t[d+1],x=t[d+2],S=f*3,C=y*3,V=x*3;SR.x=i[S],SR.y=i[S+1],SR.z=i[S+2],nC.x=i[C],nC.y=i[C+1],nC.z=i[C+2],iC.x=i[V],iC.y=i[V+1],iC.z=i[V+2],s[f].count++,s[y].count++,s[x].count++,m.subtract(nC,SR,nC),m.subtract(iC,SR,iC),a[u]=m.cross(nC,iC,new m),u++}let h=0;for(d=0;d<o;d++)s[d].indexOffset+=h,h+=s[d].count;u=0;let p;for(d=0;d<r;d+=3){p=s[t[d]];let f=p.indexOffset+p.currentCount;c[f]=u,p.currentCount++,p=s[t[d+1]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,p=s[t[d+2]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,u++}let g=new Float32Array(o*3);for(d=0;d<o;d++){let f=d*3;if(p=s[d],m.clone(m.ZERO,pu),p.count>0){for(u=0;u<p.count;u++)m.add(pu,a[c[p.indexOffset+u]],pu);m.equalsEpsilon(m.ZERO,pu,X.EPSILON10)&&m.clone(a[c[p.indexOffset]],pu)}m.equalsEpsilon(m.ZERO,pu,X.EPSILON10)&&(pu.z=1),m.normalize(pu,pu),g[f]=pu.x,g[f+1]=pu.y,g[f+2]=pu.z}return e.attributes.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g}),e};var OZe=new m,Qee=new m,BZe=new m;Mc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),d;for(d=0;d<c.length;d++)c[d]=0;let u,h,p;for(d=0;d<a;d+=3){let y=n[d],x=n[d+1],S=n[d+2];u=y*3,h=x*3,p=S*3;let C=y*2,V=x*2,L=S*2,Z=i[u],E=i[u+1],P=i[u+2],W=r[C],v=r[C+1],A=r[V+1]-v,b=r[L+1]-v,R=1/((r[V]-W)*b-(r[L]-W)*A),G=(b*(i[h]-Z)-A*(i[p]-Z))*R,I=(b*(i[h+1]-E)-A*(i[p+1]-E))*R,w=(b*(i[h+2]-P)-A*(i[p+2]-P))*R;c[u]+=G,c[u+1]+=I,c[u+2]+=w,c[h]+=G,c[h+1]+=I,c[h+2]+=w,c[p]+=G,c[p+1]+=I,c[p+2]+=w}let g=new Float32Array(s*3),f=new Float32Array(s*3);for(d=0;d<s;d++){u=d*3,h=u+1,p=u+2;let y=m.fromArray(o,u,OZe),x=m.fromArray(c,u,BZe),S=m.dot(y,x);m.multiplyByScalar(y,S,Qee),m.normalize(m.subtract(x,Qee,x),x),g[u]=x.x,g[h]=x.y,g[p]=x.z,m.normalize(m.cross(y,x,x),x),f[u]=x.x,f[h]=x.y,f[p]=x.z}return e.attributes.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f}),e};var CR=new U,Zm=new m,jee=new m,qee=new m,zN=new U;Mc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let E=t.values;i=E.length/3;let P=new Float32Array(i*2),W=0;for(n=0;n<i;++n){if(m.fromArray(E,n*3,Zm),m.equals(Zm,m.ZERO)){W+=2;continue}zN=Fn.octEncodeInRange(Zm,65535,zN),P[W++]=zN.x,P[W++]=zN.y}return e.attributes.compressedAttributes=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:P}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,d=e.attributes.bitangent,u=l(c),h=l(d),p,g,f,y;s&&(p=o.values),a&&(g=r.values),u&&(f=c.values),h&&(y=d.values),i=(s?p.length:g.length)/(s?3:2);let C=i,V=a&&s?2:1;V+=u||h?1:0,C*=V;let L=new Float32Array(C),Z=0;for(n=0;n<i;++n){a&&(U.fromArray(g,n*2,CR),L[Z++]=Fn.compressTextureCoordinates(CR));let E=n*3;s&&l(f)&&l(y)?(m.fromArray(p,E,Zm),m.fromArray(f,E,jee),m.fromArray(y,E,qee),Fn.octPack(Zm,jee,qee,CR),L[Z++]=CR.x,L[Z++]=CR.y):(s&&(m.fromArray(p,E,Zm),L[Z++]=Fn.octEncodeFloat(Zm)),u&&(m.fromArray(f,E,Zm),L[Z++]=Fn.octEncodeFloat(Zm)),h&&(m.fromArray(y,E,Zm),L[Z++]=Fn.octEncodeFloat(Zm)))}return e.attributes.compressedAttributes=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:V,values:L}),s&&delete e.attributes.normal,a&&delete e.attributes.st,h&&delete e.attributes.bitangent,u&&delete e.attributes.tangent,e};function YZe(e){if(l(e.indices))return e;let t=ht.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function zZe(e){let t=ht.computeNumberOfVertices(e),n=Ne.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=Ae.TRIANGLES,e}function HZe(e){let t=ht.computeNumberOfVertices(e),n=Ne.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=Ae.TRIANGLES,e}function KZe(e){if(l(e.indices))return e;let t=ht.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function JZe(e){let t=ht.computeNumberOfVertices(e),n=Ne.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=Ae.LINES,e}function QZe(e){let t=ht.computeNumberOfVertices(e),n=Ne.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=Ae.LINES,e}function jZe(e){switch(e.primitiveType){case Ae.TRIANGLE_FAN:return zZe(e);case Ae.TRIANGLE_STRIP:return HZe(e);case Ae.TRIANGLES:return YZe(e);case Ae.LINE_STRIP:return JZe(e);case Ae.LINE_LOOP:return QZe(e);case Ae.LINES:return KZe(e)}return e}function k0(e,t){Math.abs(e.y)<X.EPSILON6&&(t?e.y=-X.EPSILON6:e.y=X.EPSILON6)}function qZe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){k0(e,e.y<0),k0(t,t.y<0),k0(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=X.sign(e.y):s=X.sign(n.y):o>r?s=X.sign(t.y):s=X.sign(n.y);let a=s<0;k0(e,a),k0(t,a),k0(n,a)}var $ee=new m;function bu(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,$ee),e.y/(e.y-t.y),$ee),n),m.clone(n,i),k0(n,!0),k0(i,!1)}var bx=new m,gx=new m,yx=new m,xx=new m,mY={positions:new Array(7),indices:new Array(3*3)};function $Ze(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;qZe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=mY.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(bu(e,t,bx,yx),bu(e,n,gx,xx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(bu(t,n,bx,yx),bu(t,e,gx,xx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(bu(n,e,bx,yx),bu(n,t,gx,xx),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(bu(n,e,bx,yx),bu(n,t,gx,xx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(bu(t,n,bx,yx),bu(t,e,gx,xx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(bu(e,t,bx,yx),bu(e,n,gx,xx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=mY.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=bx,c[4]=gx,c[5]=yx,c[6]=xx,c.length=7),mY}function ete(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=Q.createTypedArray(r.componentDatatype,r.values)}let i=ht.computeNumberOfVertices(e);return e.indices=Ne.createTypedArray(i,e.indices),t&&(e.boundingSphere=de.fromVertices(n.position.values)),e}function rC(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 Ze({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ht({attributes:n,indices:[],primitiveType:e.primitiveType})}function bY(e,t,n){let i=l(e.geometry.boundingSphere);t=ete(t,i),n=ete(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 gY(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,h,p){let g=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),y=e.fromArray(d,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(y,c.z,y);let x=e.add(g,f,g);e.add(x,y,x),p&&e.normalize(x,x),e.pack(x,u,h*t)}}var eGe=gY(re,4),JN=gY(m,3),ste=gY(U,2),tGe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,d=o[n]*i.z;r[s]=a+c+d>X.EPSILON6?1:0},VR=new m,hY=new m,fY=new m,nGe=new m;function HN(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,y){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&g===0)return;let x=m.fromArray(o,e*3,VR),S=m.fromArray(o,t*3,hY),C=m.fromArray(o,n*3,fY),V=hx(i,x,S,C,nGe);if(l(V)){if(l(r)&&JN(e,t,n,V,r,h.normal.values,y,!0),l(d)){let L=m.fromArray(d,e*3,VR),Z=m.fromArray(d,t*3,hY),E=m.fromArray(d,n*3,fY);m.multiplyByScalar(L,V.x,L),m.multiplyByScalar(Z,V.y,Z),m.multiplyByScalar(E,V.z,E);let P;!m.equals(L,m.ZERO)||!m.equals(Z,m.ZERO)||!m.equals(E,m.ZERO)?(P=m.add(L,Z,L),m.add(P,E,P),m.normalize(P,P)):(P=VR,P.x=0,P.y=0,P.z=0),m.pack(P,h.extrudeDirection.values,y*3)}if(l(u)&&tGe(e,t,n,V,u,h.applyOffset.values,y),l(s)&&JN(e,t,n,V,s,h.tangent.values,y,!0),l(a)&&JN(e,t,n,V,a,h.bitangent.values,y,!0),l(c)&&ste(e,t,n,V,c,h.st.values,y),g>0)for(let L=0;L<g;L++){let Z=p[L];iGe(e,t,n,V,y,f[Z],h[Z])}}}function iGe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,d=s.values;switch(a){case 4:eGe(e,t,n,i,c,d,o,!1);break;case 3:JN(e,t,n,i,c,d,o,!1);break;case 2:ste(e,t,n,i,c,d,o,!1);break;default:d[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function sf(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var oGe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function tte(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,d=l(n.applyOffset)?n.applyOffset.values:void 0,u=t.indices,h=[];for(let P in n)n.hasOwnProperty(P)&&!oGe[P]&&l(n[P])&&h.push(P);let p=h.length,g=rC(t),f=rC(t),y,x,S,C,V,L=[];L.length=i.length/3;let Z=[];for(Z.length=i.length/3,V=0;V<L.length;++V)L[V]=-1,Z[V]=-1;let E=u.length;for(V=0;V<E;V+=3){let P=u[V],W=u[V+1],v=u[V+2],A=m.fromArray(i,P*3),b=m.fromArray(i,W*3),R=m.fromArray(i,v*3),G=$Ze(A,b,R);if(l(G)&&G.positions.length>3){let I=G.positions,w=G.indices,M=w.length;for(let O=0;O<M;++O){let k=w[O],B=I[k];B.y<0?(y=f.attributes,x=f.indices,S=L):(y=g.attributes,x=g.indices,S=Z),C=sf(y,x,S,u,k<3?V+k:-1,B),HN(P,W,v,B,i,o,s,r,a,c,d,y,h,p,n,C)}}else l(G)&&(A=G.positions[0],b=G.positions[1],R=G.positions[2]),A.y<0?(y=f.attributes,x=f.indices,S=L):(y=g.attributes,x=g.indices,S=Z),C=sf(y,x,S,u,V,A),HN(P,W,v,A,i,o,s,r,a,c,d,y,h,p,n,C),C=sf(y,x,S,u,V+1,b),HN(P,W,v,b,i,o,s,r,a,c,d,y,h,p,n,C),C=sf(y,x,S,u,V+2,R),HN(P,W,v,R,i,o,s,r,a,c,d,y,h,p,n,C)}bY(e,f,g)}var ate=dn.fromPointNormal(m.ZERO,m.UNIT_Y),rGe=new m,sGe=new m;function oC(e,t,n,i,o,r,s){if(!l(s))return;let a=m.fromArray(i,e*3,VR);m.equalsEpsilon(a,n,X.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function nte(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=rC(t),a=rC(t),c,d=r.length,u=[];u.length=i.length/3;let h=[];for(h.length=i.length/3,c=0;c<u.length;++c)u[c]=-1,h[c]=-1;for(c=0;c<d;c+=2){let p=r[c],g=r[c+1],f=m.fromArray(i,p*3,VR),y=m.fromArray(i,g*3,hY),x;Math.abs(f.y)<X.EPSILON6&&(f.y<0?f.y=-X.EPSILON6:f.y=X.EPSILON6),Math.abs(y.y)<X.EPSILON6&&(y.y<0?y.y=-X.EPSILON6:y.y=X.EPSILON6);let S=s.attributes,C=s.indices,V=h,L=a.attributes,Z=a.indices,E=u,P=ei.lineSegmentPlane(f,y,ate,fY);if(l(P)){let W=m.multiplyByScalar(m.UNIT_Y,5*X.EPSILON9,rGe);f.y<0&&(m.negate(W,W),S=a.attributes,C=a.indices,V=u,L=s.attributes,Z=s.indices,E=h);let v=m.add(P,W,sGe);x=sf(S,C,V,r,c,f),oC(p,g,f,i,x,S,o),x=sf(S,C,V,r,-1,v),oC(p,g,v,i,x,S,o),m.negate(W,W),m.add(P,W,v),x=sf(L,Z,E,r,-1,v),oC(p,g,v,i,x,L,o),x=sf(L,Z,E,r,c+1,y),oC(p,g,y,i,x,L,o)}else{let W,v,A;f.y<0?(W=a.attributes,v=a.indices,A=u):(W=s.attributes,v=s.indices,A=h),x=sf(W,v,A,r,c,f),oC(p,g,f,i,x,W,o),x=sf(W,v,A,r,c+1,y),oC(p,g,y,i,x,W,o)}}bY(e,a,s)}var ite=new U,aGe=new U,cte=new m,lte=new m,pY=new m,cGe=new m,lGe=new m,dGe=new m,ote=new re;function rte(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=m.unpack(n,s,cte);if(a.x>0)continue;let c=m.unpack(i,s,lte);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let d=m.unpack(o,s,pY);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):m.pack(a,o,s))}}var uGe=5*X.EPSILON9,KN=X.EPSILON6;function mGe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,d=rC(t),u=rC(t),h,p,g,f=!1,y=i.length/3;for(h=0;h<y;h+=4){let x=h,S=h+2,C=m.fromArray(i,x*3,cte),V=m.fromArray(i,S*3,lte);if(Math.abs(C.y)<KN)for(C.y=KN*(V.y<0?-1:1),i[h*3+1]=C.y,i[(h+1)*3+1]=C.y,p=x*3;p<x*3+4*3;p+=3)o[p]=i[h*3],o[p+1]=i[h*3+1],o[p+2]=i[h*3+2];if(Math.abs(V.y)<KN)for(V.y=KN*(C.y<0?-1:1),i[(h+2)*3+1]=V.y,i[(h+3)*3+1]=V.y,p=x*3;p<x*3+4*3;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 L=d.attributes,Z=d.indices,E=u.attributes,P=u.indices,W=ei.lineSegmentPlane(C,V,ate,cGe);if(l(W)){f=!0;let v=m.multiplyByScalar(m.UNIT_Y,uGe,lGe);C.y<0&&(m.negate(v,v),L=u.attributes,Z=u.indices,E=d.attributes,P=d.indices);let A=m.add(W,v,dGe);L.position.values.push(C.x,C.y,C.z,C.x,C.y,C.z),L.position.values.push(A.x,A.y,A.z),L.position.values.push(A.x,A.y,A.z),L.prevPosition.values.push(o[x*3],o[x*3+1],o[x*3+2]),L.prevPosition.values.push(o[x*3+3],o[x*3+4],o[x*3+5]),L.prevPosition.values.push(C.x,C.y,C.z,C.x,C.y,C.z),L.nextPosition.values.push(A.x,A.y,A.z),L.nextPosition.values.push(A.x,A.y,A.z),L.nextPosition.values.push(A.x,A.y,A.z),L.nextPosition.values.push(A.x,A.y,A.z),m.negate(v,v),m.add(W,v,A),E.position.values.push(A.x,A.y,A.z),E.position.values.push(A.x,A.y,A.z),E.position.values.push(V.x,V.y,V.z,V.x,V.y,V.z),E.prevPosition.values.push(A.x,A.y,A.z),E.prevPosition.values.push(A.x,A.y,A.z),E.prevPosition.values.push(A.x,A.y,A.z),E.prevPosition.values.push(A.x,A.y,A.z),E.nextPosition.values.push(V.x,V.y,V.z,V.x,V.y,V.z),E.nextPosition.values.push(r[S*3],r[S*3+1],r[S*3+2]),E.nextPosition.values.push(r[S*3+3],r[S*3+4],r[S*3+5]);let b=U.fromArray(s,x*2,ite),R=Math.abs(b.y);L.expandAndWidth.values.push(-1,R,1,R),L.expandAndWidth.values.push(-1,-R,1,-R),E.expandAndWidth.values.push(-1,R,1,R),E.expandAndWidth.values.push(-1,-R,1,-R);let G=m.magnitudeSquared(m.subtract(W,C,pY));if(G/=m.magnitudeSquared(m.subtract(V,C,pY)),l(c)){let I=re.fromArray(c,x*4,ote),w=re.fromArray(c,S*4,ote),M=X.lerp(I.x,w.x,G),O=X.lerp(I.y,w.y,G),k=X.lerp(I.z,w.z,G),B=X.lerp(I.w,w.w,G);for(p=x*4;p<x*4+2*4;++p)L.color.values.push(c[p]);for(L.color.values.push(M,O,k,B),L.color.values.push(M,O,k,B),E.color.values.push(M,O,k,B),E.color.values.push(M,O,k,B),p=S*4;p<S*4+2*4;++p)E.color.values.push(c[p])}if(l(a)){let I=U.fromArray(a,x*2,ite),w=U.fromArray(a,(h+3)*2,aGe),M=X.lerp(I.x,w.x,G);for(p=x*2;p<x*2+2*2;++p)L.st.values.push(a[p]);for(L.st.values.push(M,I.y),L.st.values.push(M,w.y),E.st.values.push(M,I.y),E.st.values.push(M,w.y),p=S*2;p<S*2+2*2;++p)E.st.values.push(a[p])}g=L.position.values.length/3-4,Z.push(g,g+2,g+1),Z.push(g+1,g+2,g+3),g=E.position.values.length/3-4,P.push(g,g+2,g+1),P.push(g+1,g+2,g+3)}else{let v,A;for(C.y<0?(v=u.attributes,A=u.indices):(v=d.attributes,A=d.indices),v.position.values.push(C.x,C.y,C.z),v.position.values.push(C.x,C.y,C.z),v.position.values.push(V.x,V.y,V.z),v.position.values.push(V.x,V.y,V.z),p=h*3;p<h*3+4*3;++p)v.prevPosition.values.push(o[p]),v.nextPosition.values.push(r[p]);for(p=h*2;p<h*2+4*2;++p)v.expandAndWidth.values.push(s[p]),l(a)&&v.st.values.push(a[p]);if(l(c))for(p=h*4;p<h*4+4*4;++p)v.color.values.push(c[p]);g=v.position.values.length/3-4,A.push(g,g+2,g+1),A.push(g+1,g+2,g+3)}}f&&(rte(u),rte(d)),bY(e,u,d)}Mc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||de.intersectPlane(n,dn.ORIGIN_ZX_PLANE)!==Jt.INTERSECTING))return e;if(t.geometryType!==fu.NONE)switch(t.geometryType){case fu.POLYLINES:mGe(e);break;case fu.TRIANGLES:tte(e);break;case fu.LINES:nte(e);break}else jZe(t),t.primitiveType===Ae.TRIANGLES?tte(e):t.primitiveType===Ae.LINES&&nte(e);return e};var An=Mc;var Gvt=_(T(),1);function LR(e,t,n,i,o,r,s,a,c,d,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=d,this._initialized=u}Object.defineProperties(LR.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});LR.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let u=i.arrayBufferView,h=this._size,p=this._pixelFormat,g=this._internalFormat,f=this._pixelDatatype,y=this._preMultiplyAlpha,x=this._flipY,S=4;l(u)&&(S=ot.alignmentInBytes(p,f,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,S),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let C=!1;if(!this._initialized){let V;t===0&&n===0&&r===h&&s===h?(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ot.flipY(u,p,f,h,h)),V=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,x),V=i),C=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),V=ot.createTypedArray(p,f,h,h)),a.texImage2D(d,0,g,h,h,0,p,je.toWebGLConstant(f,this._context),V),this._initialized=!0}C||(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ot.flipY(u,p,f,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,je.toWebGLConstant(f,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,x),a.texSubImage2D(d,0,t,n,p,je.toWebGLConstant(f,this._context),i))),a.bindTexture(c,null)};LR.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};LR.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0;let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var RR=LR;var Xvt=_(T(),1);var jN={DONT_CARE:ie.DONT_CARE,FASTEST:ie.FASTEST,NICEST:ie.NICEST,validate:function(e){return e===jN.DONT_CARE||e===jN.FASTEST||e===jN.NICEST}},af=Object.freeze(jN);var Hvt=_(T(),1);var vvt=_(T(),1);var qN={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR};qN.validate=function(e){return e===qN.NEAREST||e===qN.LINEAR};var fi=Object.freeze(qN);var Avt=_(T(),1);var U0={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR,NEAREST_MIPMAP_NEAREST:ie.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ie.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ie.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ie.LINEAR_MIPMAP_LINEAR};U0.validate=function(e){return e===U0.NEAREST||e===U0.LINEAR||e===U0.NEAREST_MIPMAP_NEAREST||e===U0.LINEAR_MIPMAP_NEAREST||e===U0.NEAREST_MIPMAP_LINEAR||e===U0.LINEAR_MIPMAP_LINEAR};var en=Object.freeze(U0);var kvt=_(T(),1);var $N={CLAMP_TO_EDGE:ie.CLAMP_TO_EDGE,REPEAT:ie.REPEAT,MIRRORED_REPEAT:ie.MIRRORED_REPEAT,validate:function(e){return e===$N.CLAMP_TO_EDGE||e===$N.REPEAT||e===$N.MIRRORED_REPEAT}},Ln=Object.freeze($N);function ZR(e){e=e??Y.EMPTY_OBJECT;let{wrapS:t=Ln.CLAMP_TO_EDGE,wrapT:n=Ln.CLAMP_TO_EDGE,minificationFilter:i=en.LINEAR,magnificationFilter:o=fi.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(ZR.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});ZR.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};ZR.NEAREST=Object.freeze(new ZR({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:en.NEAREST,magnificationFilter:fi.NEAREST}));var tn=ZR;var swt=_(T(),1);function hGe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??Q.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(c){let d=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function ute(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 Rp(e){e=e??Y.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,d=!1,u=i.length;for(r=0;r<u;++r)hGe(s,i[r],r,t);for(u=s.length,r=0;r<u;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Q.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(r=0;r<u;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(d=!0);let h;t.vertexArrayObject&&(h=t.glCreateVertexArray(),t.glBindVertexArray(h),ute(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=h,this._attributes=s,this._indexBuffer=o}function dte(e){return e.values.length/e.componentsPerAttribute}function fGe(e){return Q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function pGe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===Q.DOUBLE&&(e[n].componentDatatype=Q.FLOAT,e[n].values=Q.createTypedArray(Q.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=dte(e[o[0]]),t=1;t<s;++t){let d=dte(e[o[t]]);if(d!==r)throw new ce(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${d.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(d,u){return Q.getSizeInBytes(e[u].componentDatatype)-Q.getSizeInBytes(e[d].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=fGe(i);if(a>0){let d=Q.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let h=r*a,p=new ArrayBuffer(h),g={};for(t=0;t<s;++t){n=o[t];let f=Q.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Q.createTypedArray(e[n].componentDatatype,p),index:c[n]/f,strideInComponentType:a/f}}for(t=0;t<r;++t)for(let f=0;f<s;++f){n=o[f],i=e[n];let y=i.values,x=g[n],S=x.pointer,C=i.componentsPerAttribute;for(let V=0;V<C;++V)S[x.index+V]=y[t*C+V];x.index+=x.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Rp.fromGeometry=function(e){e=e??Y.EMPTY_OBJECT;let t=e.context,n=e.geometry??Y.EMPTY_OBJECT,i=e.bufferUsage??ke.DYNAMIC_DRAW,o=e.attributeLocations??Y.EMPTY_OBJECT,r=e.interleave??!1,s=e.vertexArrayAttributes,a,c,d,u=l(s)?s:[],h=n.attributes;if(r){let f=pGe(h);if(l(f)){d=Ct.createVertexBuffer({context:t,typedArray:f.buffer,usage:i});let y=f.offsetsInBytes,x=f.vertexSizeInBytes;for(a in h)h.hasOwnProperty(a)&&l(h[a])&&(c=h[a],l(c.values)?u.push({index:o[a],vertexBuffer:d,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:y[a],strideInBytes:x}):u.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in h)if(h.hasOwnProperty(a)&&l(h[a])){c=h[a];let f=c.componentDatatype;f===Q.DOUBLE&&(f=Q.FLOAT),d=void 0,l(c.values)&&(d=Ct.createVertexBuffer({context:t,typedArray:Q.createTypedArray(f,c.values),usage:i})),u.push({index:o[a],vertexBuffer:d,value:c.value,componentDatatype:f,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,g=n.indices;return l(g)&&(ht.computeNumberOfVertices(n)>=X.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=Ct.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ne.UNSIGNED_INT}):p=Ct.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ne.UNSIGNED_SHORT})),new Rp({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(Rp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Rp.prototype.getAttribute=function(e){return this._attributes[e]};function bGe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Dt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let d=c.instanceDivisor,u=c.index;d!==i[u]&&(t.glVertexAttribDivisor(u,d),i[u]=d)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function gGe(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)}}Rp.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&bGe(this),this._hasConstantAttributes&&gGe(this,this._gl)):ute(this._gl,this._attributes,this._indexBuffer)};Rp.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)}};Rp.prototype.isDestroyed=function(){return!1};Rp.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),me(this)};var oi=Rp;function Jo(e){e=e??Y.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=ot.RGBA,pixelDatatype:o=je.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new tn}=e,c=e.preMultiplyAlpha||i===ot.RGB||i===ot.LUMINANCE,{width:d,height:u}=e;l(n)&&({width:d,height:u}=n.positiveX);let h=d,p=ot.textureSizeInBytes(i,o,h,h)*6,g=ot.toInternalFormat(i,o,t),f=t._gl,y=f.TEXTURE_CUBE_MAP,x=f.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=x,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let S=l(n);function C(V){return new RR(t,x,y,V,g,i,o,h,c,r,S)}this._positiveX=C(f.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=C(f.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=C(f.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=C(f.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=C(f.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=C(f.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,mte(this,a),f.activeTexture(f.TEXTURE0),f.bindTexture(y,x),s?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL);for(let V of Jo.faceNames())yY(this[V],n?.[V],0);f.bindTexture(y,null)}Jo.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Fr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};Jo.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*yGe(){yield Jo.FaceName.POSITIVEX,yield Jo.FaceName.NEGATIVEX,yield Jo.FaceName.POSITIVEY,yield Jo.FaceName.NEGATIVEY,yield Jo.FaceName.POSITIVEZ,yield Jo.FaceName.NEGATIVEZ}Jo.faceNames=function(){return yGe()};function yY(e,t,n){n=n??0;let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,d=e._preMultiplyAlpha,u=e._context,h=u._gl;if(!l(t)){h.texImage2D(i,n,a,o,o,0,r,je.toWebGLConstant(s,u),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=ot.alignmentInBytes(r,s,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,g),l(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=ot.flipY(p,r,s,o,o)),h.texImage2D(i,n,a,o,o,0,r,je.toWebGLConstant(s,u),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),h.texImage2D(i,n,a,r,je.toWebGLConstant(s,u),t))}Jo.loadFace=yY;Object.defineProperties(Jo.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){mte(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}}});Jo.getDirection=function(e,t){switch(e){case Jo.FaceName.POSITIVEX:return m.clone(m.UNIT_X,t);case Jo.FaceName.NEGATIVEX:return m.negate(m.UNIT_X,t);case Jo.FaceName.POSITIVEY:return m.clone(m.UNIT_Y,t);case Jo.FaceName.NEGATIVEY:return m.negate(m.UNIT_Y,t);case Jo.FaceName.POSITIVEZ:return m.clone(m.UNIT_Z,t);case Jo.FaceName.NEGATIVEZ:return m.negate(m.UNIT_Z,t)}};function mte(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[en.NEAREST_MIPMAP_NEAREST,en.NEAREST_MIPMAP_LINEAR,en.LINEAR_MIPMAP_NEAREST,en.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===je.FLOAT&&!r.textureFloatLinear||s===je.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?en.NEAREST_MIPMAP_NEAREST:en.NEAREST,i=fi.NEAREST);let a=r._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}Jo.prototype.loadMipmaps=function(e,t){t=t??!1;let n=this._context._gl,i=this._texture,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){let s=e[r],a=r+1;for(let c of Jo.faceNames())yY(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};Jo.prototype.generateMipmap=function(e){e=e??af.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)};Jo.createVertexArray=function(e){let t=va.createGeometry(va.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Xe.POSITION_ONLY})),n=this._attributeLocations=An.createAttributeLocations(t);return oi.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:ke.STATIC_DRAW})};Jo.prototype.isDestroyed=function(){return!1};Jo.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=me(this._positiveX),this._negativeX=me(this._negativeX),this._positiveY=me(this._positiveY),this._negativeY=me(this._negativeY),this._positiveZ=me(this._positiveZ),this._negativeZ=me(this._negativeZ),me(this)};var Lr=Jo;var Zwt=_(T(),1);function xGe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var ac=xGe;var _Ut=_(T(),1);var fUt=_(T(),1);var rUt=_(T(),1);var Ewt=_(T(),1),GR=`/**
|
|
|
* 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 Xwt=_(T(),1),ER=`/**
|
|
|
* 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 Pwt=_(T(),1),IR=`/**
|
|
|
* 0.1
|
|
|
*
|
|
|
* @name czm_epsilon1
|
|
|
* @glslConstant
|
|
|
*/
|
|
|
const float czm_epsilon1 = 0.1;
|
|
|
`;var wwt=_(T(),1),XR=`/**
|
|
|
* 0.01
|
|
|
*
|
|
|
* @name czm_epsilon2
|
|
|
* @glslConstant
|
|
|
*/
|
|
|
const float czm_epsilon2 = 0.01;
|
|
|
`;var Awt=_(T(),1),WR=`/**
|
|
|
* 0.001
|
|
|
*
|
|
|
* @name czm_epsilon3
|
|
|
* @glslConstant
|
|
|
*/
|
|
|
const float czm_epsilon3 = 0.001;
|
|
|
`;var Nwt=_(T(),1),PR=`/**
|
|
|
* 0.0001
|
|
|
*
|
|
|
* @name czm_epsilon4
|
|
|
* @glslConstant
|
|
|
*/
|
|
|
const float czm_epsilon4 = 0.0001;
|
|
|
`;var Uwt=_(T(),1),vR=`/**
|
|
|
* 0.00001
|
|
|
*
|
|
|
* @name czm_epsilon5
|
|
|
* @glslConstant
|
|
|
*/
|
|
|
const float czm_epsilon5 = 0.00001;
|
|
|
`;var Owt=_(T(),1),wR=`/**
|
|
|
* 0.000001
|
|
|
*
|
|
|
* @name czm_epsilon6
|
|
|
* @glslConstant
|
|
|
*/
|
|
|
const float czm_epsilon6 = 0.000001;
|
|
|
`;var Ywt=_(T(),1),FR=`/**
|
|
|
* 0.0000001
|
|
|
*
|
|
|
* @name czm_epsilon7
|
|
|
* @glslConstant
|
|
|
*/
|
|
|
const float czm_epsilon7 = 0.0000001;
|
|
|
`;var Hwt=_(T(),1),AR=`/**
|
|
|
* 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 Jwt=_(T(),1),MR=`/**
|
|
|
* 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 jwt=_(T(),1),NR=`/**
|
|
|
* 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 $wt=_(T(),1),kR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
|
|
|
*
|
|
|
* @name czm_passCesium3DTile
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passCesium3DTile = 4.0;
|
|
|
`;var tFt=_(T(),1),UR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}
|
|
|
*
|
|
|
* @name czm_passCesium3DTileClassification
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passCesium3DTileClassification = 5.0;
|
|
|
`;var iFt=_(T(),1),DR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}
|
|
|
*
|
|
|
* @name czm_passCesium3DTileClassificationIgnoreShow
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;
|
|
|
`;var rFt=_(T(),1),OR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#CLASSIFICATION}
|
|
|
*
|
|
|
* @name czm_passClassification
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passClassification = 7.0;
|
|
|
`;var aFt=_(T(),1),BR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#COMPUTE}
|
|
|
*
|
|
|
* @name czm_passCompute
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passCompute = 1.0;
|
|
|
`;var lFt=_(T(),1),YR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#ENVIRONMENT}
|
|
|
*
|
|
|
* @name czm_passEnvironment
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passEnvironment = 0.0;
|
|
|
`;var uFt=_(T(),1),zR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#GLOBE}
|
|
|
*
|
|
|
* @name czm_passGlobe
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passGlobe = 2.0;
|
|
|
`;var hFt=_(T(),1),HR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#OPAQUE}
|
|
|
*
|
|
|
* @name czm_passOpaque
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passOpaque = 7.0;
|
|
|
`;var pFt=_(T(),1),KR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#OVERLAY}
|
|
|
*
|
|
|
* @name czm_passOverlay
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passOverlay = 10.0;
|
|
|
`;var gFt=_(T(),1),JR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
|
|
|
*
|
|
|
* @name czm_passTerrainClassification
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passTerrainClassification = 3.0;
|
|
|
`;var xFt=_(T(),1),QR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#TRANSLUCENT}
|
|
|
*
|
|
|
* @name czm_passTranslucent
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passTranslucent = 8.0;
|
|
|
`;var TFt=_(T(),1),jR=`/**
|
|
|
* The automatic GLSL constant for {@link Pass#VOXELS}
|
|
|
*
|
|
|
* @name czm_passVoxels
|
|
|
* @glslConstant
|
|
|
*
|
|
|
* @see czm_pass
|
|
|
*/
|
|
|
const float czm_passVoxels = 9.0;
|
|
|
`;var CFt=_(T(),1),qR=`/**
|
|
|
* 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 LFt=_(T(),1),$R=`/**
|
|
|
* 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 ZFt=_(T(),1),eZ=`/**
|
|
|
* 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 EFt=_(T(),1),tZ=`/**
|
|
|
* 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 XFt=_(T(),1),nZ=`/**
|
|
|
* 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 PFt=_(T(),1),iZ=`/**
|
|
|
* 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 wFt=_(T(),1),oZ=`/**
|
|
|
* 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 AFt=_(T(),1),rZ=`/**
|
|
|
* 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 NFt=_(T(),1),sZ=`/**
|
|
|
* 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 UFt=_(T(),1),aZ=`/**
|
|
|
* 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 OFt=_(T(),1),cZ=`/**
|
|
|
* 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 YFt=_(T(),1),lZ=`/**
|
|
|
* 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 HFt=_(T(),1),dZ=`/**
|
|
|
* 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 JFt=_(T(),1),uZ=`/**
|
|
|
* 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 jFt=_(T(),1),mZ=`/**
|
|
|
* @name czm_depthRangeStruct
|
|
|
* @glslStruct
|
|
|
*/
|
|
|
struct czm_depthRangeStruct
|
|
|
{
|
|
|
float near;
|
|
|
float far;
|
|
|
};
|
|
|
`;var $Ft=_(T(),1),hZ=`/**
|
|
|
* 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 tAt=_(T(),1),fZ=`/**
|
|
|
* 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 iAt=_(T(),1),pZ=`/**
|
|
|
* 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 rAt=_(T(),1),bZ=`/**
|
|
|
* 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 aAt=_(T(),1),gZ=`/**
|
|
|
* DOC_TBA
|
|
|
*
|
|
|
* @name czm_ray
|
|
|
* @glslStruct
|
|
|
*/
|
|
|
struct czm_ray
|
|
|
{
|
|
|
vec3 origin;
|
|
|
vec3 direction;
|
|
|
};
|
|
|
`;var lAt=_(T(),1),yZ=`/**
|
|
|
* 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 uAt=_(T(),1),xZ=`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 hAt=_(T(),1),_Z=`// 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 pAt=_(T(),1),TZ=`/**
|
|
|
* @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 gAt=_(T(),1),SZ=`/**
|
|
|
* 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 xAt=_(T(),1),CZ=`/**
|
|
|
* 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 TAt=_(T(),1),VZ=`/**
|
|
|
* 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 CAt=_(T(),1),LZ=`/**
|
|
|
* 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 LAt=_(T(),1),RZ=`/**
|
|
|
* 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 ZAt=_(T(),1),ZZ=`/**
|
|
|
* 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 EAt=_(T(),1),GZ=`
|
|
|
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 XAt=_(T(),1),EZ=`
|
|
|
uniform vec4 shadowMap_cascadeDistances;
|
|
|
|
|
|
float czm_cascadeDistance(vec4 weights)
|
|
|
{
|
|
|
return dot(shadowMap_cascadeDistances, weights);
|
|
|
}
|
|
|
`;var PAt=_(T(),1),IZ=`
|
|
|
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 wAt=_(T(),1),XZ=`
|
|
|
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 AAt=_(T(),1),WZ=`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 NAt=_(T(),1),PZ=`/**
|
|
|
* DOC_TBA
|
|
|
*
|
|
|
* @name czm_columbusViewMorph
|
|
|
* @glslFunction
|
|
|
*/
|
|
|
vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
|
|
|
{
|
|
|
// Just linear for now.
|
|
|
vec3 p = mix(position2D.xyz, position3D.xyz, time);
|
|
|
return vec4(p, 1.0);
|
|
|
}
|
|
|
`;var UAt=_(T(),1),vZ=`/**
|
|
|
* 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 OAt=_(T(),1),wZ=`/**
|
|
|
* 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 YAt=_(T(),1),FZ=`/**
|
|
|
* 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 HAt=_(T(),1),AZ=`/**
|
|
|
* 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 JAt=_(T(),1),MZ=`/**
|
|
|
* @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 jAt=_(T(),1),NZ=`/**
|
|
|
* 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 $At=_(T(),1),kZ=`// 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 t9t=_(T(),1),UZ=`/**
|
|
|
* 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 i9t=_(T(),1),DZ=`/**
|
|
|
* 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 r9t=_(T(),1),OZ=`/**
|
|
|
* 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 a9t=_(T(),1),BZ=`/**
|
|
|
* 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 l9t=_(T(),1),YZ=`/**
|
|
|
* 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 u9t=_(T(),1),zZ=`/**
|
|
|
* 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 h9t=_(T(),1),HZ=`/**
|
|
|
* 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 p9t=_(T(),1),KZ=`/**
|
|
|
* 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 g9t=_(T(),1),JZ=`/**
|
|
|
* 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 x9t=_(T(),1),QZ=`/**
|
|
|
* 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 T9t=_(T(),1),jZ=`/**
|
|
|
* 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 C9t=_(T(),1),qZ=`/**
|
|
|
* 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 L9t=_(T(),1),$Z=`/**
|
|
|
* 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 Z9t=_(T(),1),eG=`/**
|
|
|
* 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 E9t=_(T(),1),tG=`/**
|
|
|
* @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 X9t=_(T(),1),nG=`/**
|
|
|
* 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 P9t=_(T(),1),iG=`/**
|
|
|
* 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 w9t=_(T(),1),oG=`/**
|
|
|
* 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 A9t=_(T(),1),rG=`/**
|
|
|
* 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 N9t=_(T(),1),sG=`/**
|
|
|
* 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 U9t=_(T(),1),aG=`/**
|
|
|
* 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 O9t=_(T(),1),cG=`/**
|
|
|
* 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 Y9t=_(T(),1),lG=`/**
|
|
|
* 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 H9t=_(T(),1),dG=`/**
|
|
|
* 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 J9t=_(T(),1),uG=`/**
|
|
|
* 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 j9t=_(T(),1),mG=`/**
|
|
|
* 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 $9t=_(T(),1),hG=`/**
|
|
|
* 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 tMt=_(T(),1),fG=`/**
|
|
|
* 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 q = czm_modelViewProjection * position; // clip coordinates
|
|
|
q.xyz /= q.w; // normalized device coordinates
|
|
|
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
|
|
|
return q;
|
|
|
}
|
|
|
`;var iMt=_(T(),1),pG=`/**
|
|
|
* 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 rMt=_(T(),1),bG=`/**
|
|
|
* 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 aMt=_(T(),1),gG=` /**
|
|
|
* 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 lMt=_(T(),1),yG=`/**
|
|
|
* 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 uMt=_(T(),1),xG=`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 hMt=_(T(),1),_G=`// 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 pMt=_(T(),1),TG=`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 gMt=_(T(),1),SG=`/**
|
|
|
* 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 xMt=_(T(),1),CG=`/**
|
|
|
* 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 TMt=_(T(),1),VG=`/**
|
|
|
* 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 CMt=_(T(),1),LG=`/**
|
|
|
* 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 LMt=_(T(),1),RG=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
|
|
|
{
|
|
|
return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
|
|
|
}
|
|
|
`;var ZMt=_(T(),1),ZG=`/**
|
|
|
* 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 EMt=_(T(),1),GG=`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 XMt=_(T(),1),EG=`/**
|
|
|
* 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 PMt=_(T(),1),IG=`/**
|
|
|
* 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 wMt=_(T(),1),XG=`/**
|
|
|
* 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 AMt=_(T(),1),WG=`/**
|
|
|
* 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 NMt=_(T(),1),PG=`/**
|
|
|
* 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 UMt=_(T(),1),vG=`
|
|
|
float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)
|
|
|
{
|
|
|
return czm_unpackDepth(czm_textureCube(shadowMap, d));
|
|
|
}
|
|
|
|
|
|
float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)
|
|
|
{
|
|
|
#ifdef USE_SHADOW_DEPTH_TEXTURE
|
|
|
return texture(shadowMap, uv).r;
|
|
|
#else
|
|
|
return czm_unpackDepth(texture(shadowMap, uv));
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)
|
|
|
{
|
|
|
return step(depth, czm_sampleShadowMap(shadowMap, uv));
|
|
|
}
|
|
|
|
|
|
float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)
|
|
|
{
|
|
|
return step(depth, czm_sampleShadowMap(shadowMap, uv));
|
|
|
}
|
|
|
`;var OMt=_(T(),1),wG=`
|
|
|
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 YMt=_(T(),1),FG=`/**
|
|
|
* 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 HMt=_(T(),1),AG=`/**
|
|
|
* 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 JMt=_(T(),1),MG=`/**
|
|
|
* 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 jMt=_(T(),1),NG=`/**
|
|
|
* 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 $Mt=_(T(),1),kG=`/**
|
|
|
* 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 tNt=_(T(),1),UG=`/**
|
|
|
* 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 iNt=_(T(),1),DG=`/**
|
|
|
* 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 rNt=_(T(),1),OG=`/**
|
|
|
* @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 aNt=_(T(),1),BG=`/**
|
|
|
* 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 lNt=_(T(),1),YG=`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 uNt=_(T(),1),zG=`/**
|
|
|
* 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 hNt=_(T(),1),HG=`/**
|
|
|
* 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 pNt=_(T(),1),KG=`/**
|
|
|
* 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 gNt=_(T(),1),JG=`/**
|
|
|
* 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 xNt=_(T(),1),QG=`#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 TNt=_(T(),1),jG=`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
|
|
|
return eyeCoordinate;
|
|
|
#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 CNt=_(T(),1),qG=`// 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 LNt=_(T(),1),$G=`#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 ZNt=_(T(),1),eE=`/**
|
|
|
* 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 ENt=_(T(),1),tE=`/**
|
|
|
* 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 _x={czm_degreesPerRadian:GR,czm_depthRange:ER,czm_epsilon1:IR,czm_epsilon2:XR,czm_epsilon3:WR,czm_epsilon4:PR,czm_epsilon5:vR,czm_epsilon6:wR,czm_epsilon7:FR,czm_infinity:AR,czm_oneOverPi:MR,czm_oneOverTwoPi:NR,czm_passCesium3DTile:kR,czm_passCesium3DTileClassification:UR,czm_passCesium3DTileClassificationIgnoreShow:DR,czm_passClassification:OR,czm_passCompute:BR,czm_passEnvironment:YR,czm_passGlobe:zR,czm_passOpaque:HR,czm_passOverlay:KR,czm_passTerrainClassification:JR,czm_passTranslucent:QR,czm_passVoxels:jR,czm_pi:qR,czm_piOverFour:$R,czm_piOverSix:eZ,czm_piOverThree:tZ,czm_piOverTwo:nZ,czm_radiansPerDegree:iZ,czm_sceneMode2D:oZ,czm_sceneMode3D:rZ,czm_sceneModeColumbusView:sZ,czm_sceneModeMorphing:aZ,czm_solarRadius:cZ,czm_threePiOver2:lZ,czm_twoPi:dZ,czm_webMercatorMaxLatitude:uZ,czm_depthRangeStruct:mZ,czm_material:hZ,czm_materialInput:fZ,czm_modelMaterial:pZ,czm_modelVertexOutput:bZ,czm_ray:gZ,czm_raySegment:yZ,czm_shadowParameters:xZ,czm_acesTonemapping:_Z,czm_alphaWeight:TZ,czm_antialias:SZ,czm_applyHSBShift:CZ,czm_approximateSphericalCoordinates:VZ,czm_approximateTanh:LZ,czm_backFacing:RZ,czm_branchFreeTernary:ZZ,czm_cascadeColor:GZ,czm_cascadeDistance:EZ,czm_cascadeMatrix:IZ,czm_cascadeWeights:XZ,czm_clipPolygons:WZ,czm_columbusViewMorph:PZ,czm_computeAtmosphereColor:vZ,czm_computeGroundAtmosphereScattering:wZ,czm_computePosition:FZ,czm_computeScattering:AZ,czm_cosineAndSine:MZ,czm_decompressTextureCoordinates:NZ,czm_depthClamp:kZ,czm_eastNorthUpToEyeCoordinates:UZ,czm_ellipsoidContainsPoint:DZ,czm_ellipsoidTextureCoordinates:OZ,czm_equalsEpsilon:BZ,czm_eyeOffset:YZ,czm_eyeToWindowCoordinates:zZ,czm_fastApproximateAtan:HZ,czm_fog:KZ,czm_gammaCorrect:JZ,czm_geodeticSurfaceNormal:QZ,czm_getDefaultMaterial:jZ,czm_getDynamicAtmosphereLightDirection:qZ,czm_getLambertDiffuse:$Z,czm_getSpecular:eG,czm_getWaterNoise:tG,czm_HSBToRGB:nG,czm_HSLToRGB:iG,czm_hue:oG,czm_inverseGamma:rG,czm_isEmpty:sG,czm_isFull:aG,czm_latitudeToWebMercatorFraction:cG,czm_linearToSrgb:lG,czm_lineDistance:dG,czm_luminance:uG,czm_maximumComponent:mG,czm_metersPerPixel:hG,czm_modelToWindowCoordinates:fG,czm_multiplyWithColorBalance:pG,czm_nearFarScalar:bG,czm_octDecode:gG,czm_packDepth:yG,czm_pbrLighting:xG,czm_pbrNeutralTonemapping:_G,czm_phong:TG,czm_planeDistance:SG,czm_pointAlongRay:CG,czm_rayEllipsoidIntersectionInterval:VG,czm_raySphereIntersectionInterval:LG,czm_readDepth:RG,czm_readNonPerspective:ZG,czm_reverseLogDepth:GG,czm_RGBToHSB:EG,czm_RGBToHSL:IG,czm_RGBToXYZ:XG,czm_round:WG,czm_saturation:PG,czm_shadowDepthCompare:vG,czm_shadowVisibility:wG,czm_signNotZero:FG,czm_sphericalHarmonics:AG,czm_srgbToLinear:MG,czm_tangentToEyeSpaceMatrix:NG,czm_textureCube:kG,czm_transformPlane:UG,czm_translateRelativeToEye:DG,czm_translucentPhong:OG,czm_transpose:BG,czm_unpackClippingExtents:YG,czm_unpackDepth:zG,czm_unpackFloat:HG,czm_unpackUint:KG,czm_valueTransform:JG,czm_vertexLogDepth:QG,czm_windowToEyeCoordinates:jG,czm_writeDepthClamp:qG,czm_writeLogDepth:$G,czm_writeNonPerspective:eE,czm_XYZToRGB:tE};var aUt=_(T(),1);function _Ge(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 nE=_Ge;function hte(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 fte(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=hte(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function pte(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&&Ys._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=fte(i,Ys._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),pte(o,t)}}))}function TGe(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function SGe(e){let t=[],n=fte("main",e,t);pte(n,t),TGe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
|
|
|
`;return i.replace(n.glslSource,"")}function bte(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i<o;++i)r+=`
|
|
|
#line 0
|
|
|
${s[i]}`;r=hte(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(y,x){return a=x,`
|
|
|
`});let c=[];r=r.replace(/#extension.*\n/gm,function(y){return c.push(y),`
|
|
|
`}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let d=e.pickColorQualifier;l(d)&&(r=Ys.createPickFragmentShaderSource(r,d));let u="",h=c.length;for(i=0;i<h;i++)u+=c[i];t&&(u+=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
|
precision highp float;
|
|
|
precision highp int;
|
|
|
#else
|
|
|
precision mediump float;
|
|
|
precision mediump int;
|
|
|
#define highp mediump
|
|
|
#endif
|
|
|
|
|
|
`);let p=e.defines;if(l(p))for(i=0,o=p.length;i<o;++i){let y=p[i];y.length!==0&&(u+=`#define ${y}
|
|
|
`)}n.textureFloatLinear&&(u+=`#define OES_texture_float_linear
|
|
|
|
|
|
`),n.floatingPointTexture&&(u+=`#define OES_texture_float
|
|
|
|
|
|
`);let g="";e.includeBuiltIns&&(g=SGe(r)),u+=`
|
|
|
#line 0
|
|
|
`;let f=g+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(f)&&!/czm_out_FragColor/g.test(f)&&/out_FragColor/g.test(f)&&(u+=`layout(location = 0) out vec4 out_FragColor;
|
|
|
|
|
|
`),u+=g,u+=r,n.webgl2?u=`#version 300 es
|
|
|
${u}`:u=nE(u,t),u}function Ys(e){e=e??Y.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}Ys.prototype.clone=function(){return new Ys({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Ys.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Ys.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}`};Ys.prototype.createCombinedVertexShader=function(e){return bte(this,!1,e)};Ys.prototype.createCombinedFragmentShader=function(e){return bte(this,!0,e)};Ys._czmBuiltinsAndUniforms={};for(let e in _x)_x.hasOwnProperty(e)&&(Ys._czmBuiltinsAndUniforms[e]=_x[e]);for(let e in bp)if(bp.hasOwnProperty(e)){let t=bp[e];typeof t.getDeclaration=="function"&&(Ys._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Ys.createPickVertexShaderSource=function(e){return`${Ys.replaceMain(e,"czm_old_main")}
|
|
|
in vec4 pickColor;
|
|
|
out vec4 czm_pickColor;
|
|
|
void main()
|
|
|
{
|
|
|
czm_old_main();
|
|
|
czm_pickColor = pickColor;
|
|
|
}`};Ys.createPickFragmentShaderSource=function(e,t){let n=Ys.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 CGe(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 gte(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 yte(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(gte(e,o))return o}}var VGe=["v_normalEC","v_normal"];Ys.findNormalVarying=function(e){return gte(e,"#ifdef HAS_NORMALS")?CGe(e,"HAS_NORMALS")?"v_normalEC":void 0:yte(e,VGe)};var LGe=["v_positionEC"];Ys.findPositionVarying=function(e){return yte(e,LGe)};var De=Ys;function Em(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Em.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Em.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function RGe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Em.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new De({sources:[t]})),typeof n=="string"&&(n=new De({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?RGe(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let d=this._context,u=t.createCombinedVertexShader(d),h=n.createCombinedFragmentShader(d),p=new nn({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:t,vertexShaderText:u,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};Em.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){xY(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Em.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Em.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new De({sources:[r]})),typeof s=="string"&&(s=new De({sources:[s]}));let c=this._context,d=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),h=new nn({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function xY(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];xY(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Em.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];xY(this,n),--this._numberOfShaders}this._shadersToRelease={}};Em.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Em.prototype.isDestroyed=function(){return!1};Em.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return me(this)};var iE=Em;var PUt=_(T(),1);function Im(e){e=e??Y.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=ot.RGBA,pixelDatatype:o=je.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new tn}=e,{width:c,height:d}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(d)||(d=n.videoHeight??n.naturalHeight??n.height));let u=e.preMultiplyAlpha||i===ot.RGB||i===ot.LUMINANCE,h=ot.toInternalFormat(i,o,t),p=ot.isCompressedFormat(h),g=t._gl,f=p?ot.compressedTextureSizeInBytes(i,c,d):ot.textureSizeInBytes(i,o,c,d);this._id=e.id??Hn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=h,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=d,this._dimensions=new U(c,d),this._hasMipmap=!1,this._sizeInBytes=f,this._preMultiplyAlpha=u,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,Ste(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?ot.isCompressedFormat(h)?ZGe(this,n):xte(this,n):l(n.framebuffer)?EGe(this,n):_te(this,n),this._initialized=!0):Tte(this),g.bindTexture(this._textureTarget,null)}function ZGe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,d=a;for(let u=0;u<t.mipLevels.length;++u)c=e5(c),d=e5(d),i.compressedTexImage2D(o,u+1,r,c,d,0,t.mipLevels[u])}}function xte(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:d,flipY:u}=e,h=ot.alignmentInBytes(c,d,s);i.pixelStorei(i.UNPACK_ALIGNMENT,h),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(u&&(p=ot.flipY(p,c,d,s,a)),i.texImage2D(o,0,r,s,a,0,c,je.toWebGLConstant(d,n),p),l(t.mipLevels)){let g=s,f=a;for(let y=0;y<t.mipLevels.length;++y)g=e5(g),f=e5(f),i.texImage2D(o,y+1,r,g,f,0,c,je.toWebGLConstant(d,n),t.mipLevels[y])}}function GGe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:d}=e,u=ot.alignmentInBytes(c,d,o);a.pixelStorei(a.UNPACK_ALIGNMENT,u),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=ot.flipY(t,c,d,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,c,je.toWebGLConstant(d,s),t)}function EGe(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 _te(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,je.toWebGLConstant(e.pixelDatatype,n),t)}function IGe(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,je.toWebGLConstant(e.pixelDatatype,o),t)}function e5(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Tte(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,je.toWebGLConstant(e._pixelDatatype,t),null)}Im.create=function(e){return new Im(e)};Im.fromFramebuffer=function(e){e=e??Y.EMPTY_OBJECT;let t=e.context,n=t._gl,{pixelFormat:i=ot.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:c}=e;return new Im({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(Im.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Ste(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 Ste(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[en.NEAREST_MIPMAP_NEAREST,en.NEAREST_MIPMAP_LINEAR,en.LINEAR_MIPMAP_NEAREST,en.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===je.FLOAT&&!r.textureFloatLinear||a===je.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?en.NEAREST_MIPMAP_NEAREST:en.NEAREST,i=fi.NEAREST),r.webgl2&&ot.isDepthFormat(s)&&(n=en.NEAREST,i=fi.NEAREST);let c=r._gl,d=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(d,e._texture),c.texParameteri(d,c.TEXTURE_MIN_FILTER,n),c.texParameteri(d,c.TEXTURE_MAG_FILTER,i),c.texParameteri(d,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(d,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(d,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(d,null)}Im.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:d}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,d=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,d=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let u=!1;this._initialized||(t===0&&n===0&&c===this._width&&d===this._height?(l(i.arrayBufferView)?xte(this,i):_te(this,i),u=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Tte(this)),this._initialized=!0),u||(l(i.arrayBufferView)?GGe(this,i.arrayBufferView,t,n,c,d):IGe(this,i,t,n)),s.bindTexture(a,null)};Im.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};Im.prototype.generateMipmap=function(e){e=e??af.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)};Im.prototype.isDestroyed=function(){return!1};Im.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),me(this)};var vt=Im;var AUt=_(T(),1);function Tx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Tx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Tx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Tx.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};Tx.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={}};Tx.prototype.isDestroyed=function(){return!1};Tx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return me(this)};var oE=Tx;var NDt=_(T(),1);var rDt=_(T(),1);var $Ut=_(T(),1);var BUt=_(T(),1);function gu(e){this.planes=e??[]}var rE=[new m,new m,new m];m.clone(m.UNIT_X,rE[0]);m.clone(m.UNIT_Y,rE[1]);m.clone(m.UNIT_Z,rE[2]);var D0=new m,XGe=new m,Cte=new dn(new m(1,0,0),0);gu.fromBoundingSphere=function(e,t){l(t)||(t=new gu);let n=rE.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=rE[a],d=i[s],u=i[s+1];l(d)||(d=i[s]=new re),l(u)||(u=i[s+1]=new re),m.multiplyByScalar(c,-r,D0),m.add(o,D0,D0),d.x=c.x,d.y=c.y,d.z=c.z,d.w=-m.dot(c,D0),m.multiplyByScalar(c,r,D0),m.add(o,D0,D0),u.x=-c.x,u.y=-c.y,u.z=-c.z,u.w=-m.dot(m.negate(c,XGe),D0),s+=2}return t};gu.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(dn.fromCartesian4(t[i],Cte));if(r===Jt.OUTSIDE)return Jt.OUTSIDE;r===Jt.INTERSECTING&&(n=!0)}return n?Jt.INTERSECTING:Jt.INSIDE};gu.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===gu.MASK_OUTSIDE||t===gu.MASK_INSIDE)return t;let n=gu.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&(t&s)===0)continue;let a=e.intersectPlane(dn.fromCartesian4(i[o],Cte));if(a===Jt.OUTSIDE)return gu.MASK_OUTSIDE;a===Jt.INTERSECTING&&(n|=s)}return n};gu.MASK_OUTSIDE=4294967295;gu.MASK_INSIDE=0;gu.MASK_INDETERMINATE=2147483647;var bs=gu;function cf(e){e=e??Y.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new bs,this._orthographicMatrix=new F}function Vte(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(cf.prototype,{projectionMatrix:{get:function(){return Vte(this),this._orthographicMatrix}}});var WGe=new m,PGe=new m,vGe=new m,_Y=new m;cf.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=m.cross(t,n,WGe);m.normalize(u,u);let h=PGe;m.multiplyByScalar(t,c,h),m.add(e,h,h);let p=vGe;m.multiplyByScalar(u,a,p),m.add(h,p,p);let g=i[0];return l(g)||(g=i[0]=new re),g.x=u.x,g.y=u.y,g.z=u.z,g.w=-m.dot(u,p),m.multiplyByScalar(u,s,p),m.add(h,p,p),g=i[1],l(g)||(g=i[1]=new re),g.x=-u.x,g.y=-u.y,g.z=-u.z,g.w=-m.dot(m.negate(u,_Y),p),m.multiplyByScalar(n,r,p),m.add(h,p,p),g=i[2],l(g)||(g=i[2]=new re),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-m.dot(n,p),m.multiplyByScalar(n,o,p),m.add(h,p,p),g=i[3],l(g)||(g=i[3]=new re),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-m.dot(m.negate(n,_Y),p),g=i[4],l(g)||(g=i[4]=new re),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-m.dot(t,h),m.multiplyByScalar(t,d,p),m.add(e,p,p),g=i[5],l(g)||(g=i[5]=new re),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-m.dot(m.negate(t,_Y),p),this._cullingVolume};cf.prototype.getPixelDimensions=function(e,t,n,i,o){Vte(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};cf.prototype.clone=function(e){return l(e)||(e=new cf),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};cf.prototype.equals=function(e){return l(e)&&e instanceof cf&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};cf.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof cf&&X.equalsEpsilon(this.right,e.right,t,n)&&X.equalsEpsilon(this.left,e.left,t,n)&&X.equalsEpsilon(this.top,e.top,t,n)&&X.equalsEpsilon(this.bottom,e.bottom,t,n)&&X.equalsEpsilon(this.near,e.near,t,n)&&X.equalsEpsilon(this.far,e.far,t,n)};var Ar=cf;function Rl(e){e=e??Y.EMPTY_OBJECT,this._offCenterFrustum=new Ar,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}Rl.packedLength=4;Rl.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};Rl.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Rl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function O0(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(Rl.prototype,{projectionMatrix:{get:function(){return O0(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return O0(this),this._offCenterFrustum}}});Rl.prototype.computeCullingVolume=function(e,t,n){return O0(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Rl.prototype.getPixelDimensions=function(e,t,n,i,o){return O0(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Rl.prototype.clone=function(e){return l(e)||(e=new Rl),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};Rl.prototype.equals=function(e){return!l(e)||!(e instanceof Rl)?!1:(O0(this),O0(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Rl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Rl)?!1:(O0(this),O0(e),X.equalsEpsilon(this.width,e.width,t,n)&&X.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var un=Rl;var fDt=_(T(),1);var TY={};function wGe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var FGe=32.184,AGe=2451545;function Ote(e,t){t=q.addSeconds(e,FGe,t);let n=q.totalDays(t)-AGe;return t=q.addSeconds(t,wGe(n),t),t}var t5=new q(2451545,0,Kn.TAI),MGe=1e3,yu=X.RADIANS_PER_DEGREE,ud=X.RADIANS_PER_ARCSECOND,wa=14959787e4,Lte=new $;function Bte(e,t,n,i,o,r,s){n<0&&(n=-n,o+=X.PI);let a=e*(1-t),c=i-o,d=o,u=kGe(r-i,t),h=NGe(t,0);YGe(c,n,d,Lte);let p=a*(1+t),g=Math.cos(u),f=Math.sin(u),y=1+t*g,x=p/y;return l(s)?(s.x=x*g,s.y=x*f,s.z=0):s=new m(x*g,x*f,0),$.multiplyByVector(Lte,s,s)}function NGe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function kGe(e,t){let n=OGe(e,t);return BGe(n,t)}var UGe=50,DGe=X.EPSILON8;function OGe(e,t){let n=Math.floor(e/X.TWO_PI);e-=n*X.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<UGe&&Math.abs(o-i)>DGe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*X.TWO_PI,o}function BGe(e,t){let n=Math.floor(e/X.TWO_PI);e-=n*X.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=X.zeroToTwoPi(r),e<0&&(r-=X.TWO_PI),r+=n*X.TWO_PI,r}function YGe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),d=Math.sin(n);return l(i)?(i[0]=c*o-d*r*s,i[1]=d*o+c*r*s,i[2]=r*a,i[3]=-c*r-d*o*s,i[4]=-d*r+c*o*s,i[5]=o*a,i[6]=d*a,i[7]=-c*a,i[8]=s):i=new $(c*o-d*r*s,-c*r-d*o*s,d*a,d*o+c*r*s,-d*r+c*o*s,-c*a,r*a,o*a,s),i}var zGe=1.0000010178*wa,HGe=100.46645683*yu,KGe=129597742283429e-5*ud,Rte=16002,Zte=21863,Gte=32004,Ete=10931,Ite=14529,Xte=16368,Wte=15318,Pte=32794,JGe=64*1e-7*wa,QGe=-152*1e-7*wa,jGe=62*1e-7*wa,qGe=-8*1e-7*wa,$Ge=32*1e-7*wa,eEe=-41*1e-7*wa,tEe=19*1e-7*wa,nEe=-11*1e-7*wa,iEe=-150*1e-7*wa,oEe=-46*1e-7*wa,rEe=68*1e-7*wa,sEe=54*1e-7*wa,aEe=14*1e-7*wa,cEe=24*1e-7*wa,lEe=-28*1e-7*wa,dEe=22*1e-7*wa,vte=10,wte=16002,Fte=21863,Ate=10931,Mte=1473,Nte=32004,kte=4387,Ute=73,uEe=-325*1e-7,mEe=-322*1e-7,hEe=-79*1e-7,fEe=232*1e-7,pEe=-52*1e-7,bEe=97*1e-7,gEe=55*1e-7,yEe=-41*1e-7,xEe=-105*1e-7,_Ee=-137*1e-7,TEe=258*1e-7,SEe=35*1e-7,CEe=-116*1e-7,VEe=-88*1e-7,LEe=-112*1e-7,REe=-80*1e-7,sC=new q(0,0,Kn.TAI);function ZEe(e,t){Ote(e,sC);let i=(sC.dayNumber-t5.dayNumber+(sC.secondsOfDay-t5.secondsOfDay)/Jn.SECONDS_PER_DAY)/(Jn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=zGe+JGe*Math.cos(Rte*o)+iEe*Math.sin(Rte*o)+QGe*Math.cos(Zte*o)+oEe*Math.sin(Zte*o)+jGe*Math.cos(Gte*o)+rEe*Math.sin(Gte*o)+qGe*Math.cos(Ete*o)+sEe*Math.sin(Ete*o)+$Ge*Math.cos(Ite*o)+aEe*Math.sin(Ite*o)+eEe*Math.cos(Xte*o)+cEe*Math.sin(Xte*o)+tEe*Math.cos(Wte*o)+lEe*Math.sin(Wte*o)+nEe*Math.cos(Pte*o)+dEe*Math.sin(Pte*o),s=HGe+KGe*i+uEe*Math.cos(vte*o)+xEe*Math.sin(vte*o)+mEe*Math.cos(wte*o)+_Ee*Math.sin(wte*o)+hEe*Math.cos(Fte*o)+TEe*Math.sin(Fte*o)+fEe*Math.cos(Ate*o)+SEe*Math.sin(Ate*o)+pEe*Math.cos(Mte*o)+CEe*Math.sin(Mte*o)+bEe*Math.cos(Nte*o)+VEe*Math.sin(Nte*o)+gEe*Math.cos(kte*o)+LEe*Math.sin(kte*o)+yEe*Math.cos(Ute*o)+REe*Math.sin(Ute*o),a=.0167086342-.0004203654*i,c=102.93734808*yu+11612.3529*ud*i,d=469.97289*ud*i,u=174.87317577*yu-8679.27034*ud*i;return Bte(r,a,d,c,u,s,t)}function Yte(e,t){Ote(e,sC);let i=(sC.dayNumber-t5.dayNumber+(sC.secondsOfDay-t5.secondsOfDay)/Jn.SECONDS_PER_DAY)/Jn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,d=5.15668983*yu,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*yu,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*yu,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*yu,x=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,S=297.85019547*yu+ud*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),C=93.27209062*yu+ud*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),V=134.96340251*yu+ud*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),L=357.52910918*yu+ud*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),Z=310.17137918*yu-ud*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),E=2*S,P=4*S,W=6*S,v=2*V,A=3*V,b=4*V,R=2*C;a+=3400.4*Math.cos(E)-635.6*Math.cos(E-V)-235.6*Math.cos(V)+218.1*Math.cos(E-L)+181*Math.cos(E+V),c+=.014216*Math.cos(E-V)+.008551*Math.cos(E-v)-.001383*Math.cos(V)+.001356*Math.cos(E+V)-.001147*Math.cos(P-A)-914e-6*Math.cos(P-v)+869e-6*Math.cos(E-L-V)-627e-6*Math.cos(E)-394e-6*Math.cos(P-b)+282e-6*Math.cos(E-L-v)-279e-6*Math.cos(S-V)-236e-6*Math.cos(v)+231e-6*Math.cos(P)+229e-6*Math.cos(W-b)-201e-6*Math.cos(v-R),u+=486.26*Math.cos(E-R)-40.13*Math.cos(E)+37.51*Math.cos(R)+25.73*Math.cos(v-R)+19.97*Math.cos(E-L-R),p+=-55609*Math.sin(E-V)-34711*Math.sin(E-v)-9792*Math.sin(V)+9385*Math.sin(P-A)+7505*Math.sin(P-v)+5318*Math.sin(E+V)+3484*Math.sin(P-b)-3417*Math.sin(E-L-V)-2530*Math.sin(W-b)-2376*Math.sin(E)-2075*Math.sin(E-A)-1883*Math.sin(v)-1736*Math.sin(W-5*V)+1626*Math.sin(L)-1370*Math.sin(W-A),f+=-5392*Math.sin(E-R)-540*Math.sin(L)-441*Math.sin(E)+423*Math.sin(R)-288*Math.sin(v-R),x+=-3332.9*Math.sin(E)+1197.4*Math.sin(E-V)-662.5*Math.sin(L)+396.3*Math.sin(V)-218*Math.sin(E-L);let G=2*Z,I=3*Z;u+=46.997*Math.cos(Z)*i-.614*Math.cos(E-R+Z)*i+.614*Math.cos(E-R-Z)*i-.0297*Math.cos(G)*o-.0335*Math.cos(Z)*o+.0012*Math.cos(E-R+G)*o-16e-5*Math.cos(Z)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(G)*r;let w=2.116*Math.sin(Z)*i-.111*Math.sin(E-R-Z)*i-.0015*Math.sin(Z)*o;p+=w,x+=w,f+=-520.77*Math.sin(Z)*i+13.66*Math.sin(E-R+Z)*i+1.12*Math.sin(E-Z)*i-1.06*Math.sin(R-Z)*i+.66*Math.sin(G)*o+.371*Math.sin(Z)*o-.035*Math.sin(E-R+G)*o-.015*Math.sin(E-R+Z)*o+.0014*Math.sin(Z)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(G)*r,a*=MGe;let M=d+u*ud,O=h+p*ud,k=y+x*ud,B=g+f*ud;return Bte(a,c,M,O,B,k,t)}var Dte=.012300034,GEe=Dte/(Dte+1)*-1;function EEe(e,t){return t=Yte(e,t),m.multiplyByScalar(t,GEe,t)}var zte=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),sE=new m;TY.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=q.now()),l(t)||(t=new m),sE=ZEe(e,sE),t=m.negate(sE,t),EEe(e,sE),m.subtract(t,sE,t),$.multiplyByVector(zte,t,t),t};TY.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=q.now()),t=Yte(e,t),$.multiplyByVector(zte,t,t),t};var B0=TY;var bDt=_(T(),1),n5={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};n5.getMorphTime=function(e){return e===n5.SCENE3D?1:e===n5.MORPHING?void 0:0};var oe=Object.freeze(n5);var _Dt=_(T(),1);function IEe(e){e=e??Y.EMPTY_OBJECT,this.color=D.clone(e.color??D.WHITE),this.intensity=e.intensity??2}var Zp=IEe;function aC(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new ze,this._viewportCartesian4=new re,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new U,this._currentFrustum=new U,this._frustumPlanes=new re,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Yn,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new U,this._eyeEllipsoidNormalEC=new m,this._eyeEllipsoidCurvature=new U,this._modelToEnu=new F,this._enuToModel=new F,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new D,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new m,this._atmosphereRayleighScaleHeight=new m,this._atmosphereMieCoefficient=new m,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(aC.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!ze.equals(e,this._viewport)){ze.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 Kte(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Kte(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return CY(this),this._view3D}},viewRotation:{get:function(){return CY(this),this._viewRotation}},viewRotation3D:{get:function(){return CY(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return jte(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return jte(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return UEe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return DEe(this),this._modelView}},modelView3D:{get:function(){return OEe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return JEe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return BEe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return YEe(this),this._inverseModelView3D}},viewProjection:{get:function(){return zEe(this),this._viewProjection}},inverseViewProjection:{get:function(){return HEe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return KEe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return QEe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return jEe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return qEe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return $Ee(this),this._normal}},normal3D:{get:function(){return eIe(this),this._normal3D}},inverseNormal:{get:function(){return tIe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return nIe(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 Qte(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Qte(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??ne.default}}});function XEe(e,t){F.clone(t,e._view),F.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function WEe(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function PEe(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function vEe(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Hte=new m,wEe=new F;function FEe(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=m.fromRadians(o.longitude,o.latitude,0,n,Hte)):(e._eyeHeight=-n.maximumRadius,m.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=m.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Hte)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Ft.eastNorthUpToFixedFrame(i,n,wEe);e._enuToModel=F.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=F.inverseTransformation(e._enuToModel,e._modelToEnu),X.equalsEpsilon(n._radii.x,n._radii.y,X.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var SY=new $,AEe=new he;function MEe(e,t){Ft.computeIcrfToCentralBodyFixedMatrix(t.time,SY);let n=B0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(SY,n,n),m.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=B0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(SY,n,n),$.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,AEe);i.project(r,e._sunPositionColumbusView)}aC.prototype.updateCamera=function(e){XEe(this,e.viewMatrix),WEe(this,e.inverseViewMatrix),FEe(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 un};aC.prototype.updateFrustum=function(e){PEe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&vEe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=X.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};aC.prototype.updatePass=function(e){this._pass=e};var NEe=[],kEe=new Zp;aC.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),MEe(this,e);let n=e.light??kEe;n instanceof Zp?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=m.multiplyByScalar(o,n.intensity,o);let r=m.maximumComponent(o);r>1?m.divideByScalar(o,r,this._lightColor):m.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??NEe,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=m.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=m.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=m.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Ft.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,h;l(d)?u.height>u.width?h=Math.tan(.5*d)*2/u.height:h=Math.tan(.5*d)*2/u.width:h=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,D.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Kte(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function UEe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function DEe(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function OEe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function BEe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function YEe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function zEe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function HEe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function KEe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function JEe(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 QEe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function jEe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function qEe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function $Ee(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function eIe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function tIe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;F.getMatrix3(e.modelView,t),$.transpose(t,t)}}function nIe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;F.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var Jte=new m;function Qte(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,Jte),Yn.fromCartesian(Jte,e._encodedCameraPositionMC))}var iIe=new m,oIe=new m,rIe=new m,sIe=new m,aIe=new he,cIe=new m,lIe=new F;function dIe(e,t,n,i,o,r,s,a){let c=iIe;c.x=e.y,c.y=e.z,c.z=e.x;let d=oIe;d.x=n.y,d.y=n.z,d.z=n.x;let u=rIe;u.x=i.y,u.y=i.z,u.z=i.x;let h=sIe;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,aIe);p.longitude=X.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=X.clamp(p.latitude,-X.PI_OVER_TWO,X.PI_OVER_TWO);let g=s.ellipsoid,f=g.cartographicToCartesian(p,cIe),y=Ft.eastNorthUpToFixedFrame(f,g,lIe);return F.multiplyByPointAsVector(y,d,d),F.multiplyByPointAsVector(y,u,u),F.multiplyByPointAsVector(y,h,h),l(a)||(a=new F),a[0]=d.x,a[1]=u.x,a[2]=-h.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-h.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-h.z,a[11]=0,a[12]=-m.dot(d,f),a[13]=-m.dot(u,f),a[14]=m.dot(h,f),a[15]=1,a}function CY(e){e._view3DDirty&&(e._mode===oe.SCENE3D?F.clone(e._view,e._view3D):dIe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function jte(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var aE=aC;function xu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let s=l(n)?n(e,o):uIe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Hn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new iE(this),this._textureCache=new oE;let d=s;this._stencilBits=d.getParameter(d.STENCIL_BITS),Dt._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Dt._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),Dt._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),Dt._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),Dt._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),Dt._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),Dt._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),Dt._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),Dt._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Dt._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS),Dt._maximumSamples=this._webgl2?d.getParameter(d.MAX_SAMPLES):0;let u=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);Dt._minimumAliasedLineWidth=u[0],Dt._maximumAliasedLineWidth=u[1];let h=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);Dt._minimumAliasedPointSize=h[0],Dt._maximumAliasedPointSize=h[1];let p=d.getParameter(d.MAX_VIEWPORT_DIMS);Dt._maximumViewportWidth=p[0],Dt._maximumViewportHeight=p[1];let g=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);Dt._highpFloatSupported=g.precision!==0;let f=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);Dt._highpIntSupported=f.rangeMax!==0,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!Rr(d,["OES_standard_derivatives"]),this._blendMinmax=!!Rr(d,["EXT_blend_minmax"]),this._elementIndexUint=!!Rr(d,["OES_element_index_uint"]),this._depthTexture=!!Rr(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Rr(d,["EXT_frag_depth"]),this._debugShaders=Rr(d,["WEBGL_debug_shaders"]),this._textureFloat=!!Rr(d,["OES_texture_float"]),this._textureHalfFloat=!!Rr(d,["OES_texture_half_float"]),this._textureFloatLinear=!!Rr(d,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Rr(d,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Rr(d,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Rr(d,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Rr(d,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Rr(d,["EXT_color_buffer_half_float"]),this._s3tc=!!Rr(d,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Rr(d,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Rr(d,["WEBGL_compressed_texture_astc"]),this._etc=!!Rr(d,["WEBG_compressed_texture_etc"]),this._etc1=!!Rr(d,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Rr(d,["EXT_texture_compression_bptc"]),Ll.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let y=r?Rr(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=y,Dt._maximumTextureFilterAnisotropy=l(y)?d.getParameter(y.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let x,S,C,V,L,Z,E,P,W,v;if(c){let G=this;x=function(){return G._gl.createVertexArray()},S=function(I){G._gl.bindVertexArray(I)},C=function(I){G._gl.deleteVertexArray(I)},V=function(I,w,M,O,k){d.drawElementsInstanced(I,w,M,O,k)},L=function(I,w,M,O){d.drawArraysInstanced(I,w,M,O)},Z=function(I,w){d.vertexAttribDivisor(I,w)},E=function(I){d.drawBuffers(I)}}else P=Rr(d,["OES_vertex_array_object"]),l(P)&&(x=function(){return P.createVertexArrayOES()},S=function(G){P.bindVertexArrayOES(G)},C=function(G){P.deleteVertexArrayOES(G)}),W=Rr(d,["ANGLE_instanced_arrays"]),l(W)&&(V=function(G,I,w,M,O){W.drawElementsInstancedANGLE(G,I,w,M,O)},L=function(G,I,w,M){W.drawArraysInstancedANGLE(G,I,w,M)},Z=function(G,I){W.vertexAttribDivisorANGLE(G,I)}),v=Rr(d,["WEBGL_draw_buffers"]),l(v)&&(E=function(G){v.drawBuffersWEBGL(G)});this.glCreateVertexArray=x,this.glBindVertexArray=S,this.glDeleteVertexArray=C,this.glDrawElementsInstanced=V,this.glDrawArraysInstanced=L,this.glVertexAttribDivisor=Z,this.glDrawBuffers=E,this._vertexArrayObject=!!P,this._instancedArrays=!!W,this._drawBuffers=!!v,Dt._maximumDrawBuffers=this.drawBuffers?d.getParameter(ie.MAX_DRAW_BUFFERS):1,Dt._maximumColorAttachments=this.drawBuffers?d.getParameter(ie.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new D(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let A=new aE,b=new ac(this),R=Ue.fromCache();this._defaultPassState=b,this._defaultRenderState=R,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=A,this._currentRenderState=R,this._currentPassState=b,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let G=0;G<Dt._maximumVertexAttributes;G++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ue.apply(d,R,b)}function uIe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new ce("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 ce("The browser supports WebGL, but initialization failed.");return r}function mIe(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 hIe(e,t,n,i){let o=`${mIe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function fIe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ce(hIe(e,t,n,i))}function pIe(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 bIe(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,pIe(e,o,t))}return i}function Rr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var gIe={};Object.defineProperties(xu.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=bIe(this._originalGLContext,e?fIe: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:ot.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:ot.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 Lr({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 gIe}}});function qte(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ue.partialApply(e._gl,o,t,r,n,i)}var VY;typeof WebGLRenderingContext<"u"&&(VY=[ie.BACK]);function LY(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=VY;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var yIe=new ii;xu.prototype.clear=function(e,t){e=e??yIe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(D.equals(this._clearColor,o)||(D.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;qte(this,a,t,!0);let c=e.framebuffer??t.framebuffer;LY(this,c),n.clear(i)};function xIe(e,t,n,i,o){LY(e,t),qte(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function _Ie(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??F.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;l(d)?(s=s*d.bytesPerIndex,l(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,c===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}xu.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,xIe(this,o,t,n,r),_Ie(this,e,n,i)};xu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=VY;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)};xu.prototype.readPixels=function(e){let t=this._gl;e=e??Y.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??t.drawingBufferWidth,r=e.height??t.drawingBufferHeight,s=e.framebuffer,a=je.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=ot.createTypedArray(ot.RGBA,a,o,r);return LY(this,s),t.readPixels(n,i,o,r,ot.RGBA,je.toWebGLConstant(a,this),c),c};var $te={position:0,textureCoordinates:1};xu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new ht({attributes:{position:new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Ae.TRIANGLES});e=oi.fromGeometry({context:this,geometry:t,attributeLocations:$te,bufferUsage:ke.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};xu.prototype.createViewportQuadCommand=function(e,t){return t=t??Y.EMPTY_OBJECT,new $e({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Ae.TRIANGLES,renderState:t.renderState,shaderProgram:nn.fromCache({context:this,vertexShaderSource:ux,fragmentShaderSource:e,attributeLocations:$te}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};xu.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function RY(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(RY.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});RY.prototype.destroy=function(){delete this._pickObjects[this.key]};xu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ce("Out of unique Pick IDs.");return this._pickObjects[t]=e,new RY(this._pickObjects,t,D.fromRgba(t))};xu.prototype.isDestroyed=function(){return!1};xu.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(),me(this)};var cE=xu;var YOt=_(T(),1);var COt=_(T(),1);function cC(e){e=e??Y.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new fe("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new fe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Fr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new Fr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}cC.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};cC.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};cC.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)};cC.prototype.isDestroyed=function(){return!1};cC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),me(this)};var lE=cC;var POt=_(T(),1);var ROt=_(T(),1);var Zl={RGBA4:ie.RGBA4,RGBA8:ie.RGBA8,RGBA16F:ie.RGBA16F,RGBA32F:ie.RGBA32F,RGB5_A1:ie.RGB5_A1,RGB565:ie.RGB565,DEPTH_COMPONENT16:ie.DEPTH_COMPONENT16,STENCIL_INDEX8:ie.STENCIL_INDEX8,DEPTH_STENCIL:ie.DEPTH_STENCIL,DEPTH24_STENCIL8:ie.DEPTH24_STENCIL8,validate:function(e){return e===Zl.RGBA4||e===Zl.RGBA8||e===Zl.RGBA16F||e===Zl.RGBA32F||e===Zl.RGB5_A1||e===Zl.RGB565||e===Zl.DEPTH_COMPONENT16||e===Zl.STENCIL_INDEX8||e===Zl.DEPTH_STENCIL||e===Zl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ie.FLOAT?Zl.RGBA32F:e===ie.HALF_FLOAT_OES?Zl.RGBA16F:Zl.RGBA8}},Nc=Object.freeze(Zl);function dE(e){e=e??Y.EMPTY_OBJECT;let n=e.context._gl,i=Dt.maximumRenderbufferSize,o=e.format??Nc.RGBA4,r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=e.numSamples??1;this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(dE.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});dE.prototype._getRenderbuffer=function(){return this._renderbuffer};dE.prototype.isDestroyed=function(){return!1};dE.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),me(this)};var md=dE;function Gs(e){e=e??Y.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(Gs.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}}});Gs.prototype.isDirty=function(e,t,n,i,o){n=n??1;let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};Gs.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??je.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??ot.RGBA:void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new vt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:tn.NEAREST}),this._numSamples>1){let a=Nc.getColorFormat(o);this._colorRenderbuffers[s]=new md({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new vt({context:e,width:t,height:n,pixelFormat:ot.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:tn.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new md({context:e,width:t,height:n,format:Nc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new md({context:e,width:t,height:n,format:Nc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new vt({context:e,width:t,height:n,pixelFormat:ot.DEPTH_COMPONENT,pixelDatatype:je.UNSIGNED_INT,sampler:tn.NEAREST}):this._depthRenderbuffer=new md({context:e,width:t,height:n,format:Nc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new lE({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Fr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Gs.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};Gs.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Gs.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};Gs.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Gs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Gs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Gs.prototype.getDepthTexture=function(){return this._depthTexture};Gs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Gs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Gs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Gs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Gs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Gs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Gs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Gs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Gs.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 pi=Gs;var JOt=_(T(),1);function TIe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Re.createIfNeeded(t.positiveX).fetchImage(i),Re.createIfNeeded(t.negativeX).fetchImage(i),Re.createIfNeeded(t.positiveY).fetchImage(i),Re.createIfNeeded(t.negativeY).fetchImage(i),Re.createIfNeeded(t.positiveZ).fetchImage(i),Re.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Lr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var uE=TIe;var d3t=_(T(),1);var jOt=_(T(),1);var Sx={VERTEX:0,FRAGMENT:1,BOTH:2};Sx.includesVertexShader=function(e){return e===Sx.VERTEX||e===Sx.BOTH};Sx.includesFragmentShader=function(e){return e===Sx.FRAGMENT||e===Sx.BOTH};var ge=Object.freeze(Sx);var $Ot=_(T(),1);function ZY(e){this.name=e,this.fields=[]}ZY.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};ZY.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var mE=ZY;var t3t=_(T(),1);function GY(e){this.signature=e,this.body=[]}GY.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}`)};GY.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var hE=GY;function kc(){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(kc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});kc.prototype.addDefine=function(e,t,n){n=n??ge.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),ge.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};kc.prototype.addStruct=function(e,t,n){this._structs[e]=new mE(t),ge.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};kc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};kc.prototype.addFunction=function(e,t,n){this._functions[e]=new hE(t),ge.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};kc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};kc.prototype.addUniform=function(e,t,n){n=n??ge.BOTH;let i=`uniform ${e} ${t};`;ge.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};kc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};kc.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+=CIe(e),i};kc.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}`)};kc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};kc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};kc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=SIe(this),i=VIe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
|
|
|
`),r=new De({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
|
|
|
`),a=new De({defines:this._fragmentShaderParts.defineLines,sources:[s]});return nn.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};kc.prototype.clone=function(){return Be(this,!0)};function SIe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function CIe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function VIe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var Cx=kc;var E3t=_(T(),1);var f3t=_(T(),1);function fE({x:e,y:t,width:n,height:i}){this.rectangle=new ze(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function EY({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new fE({x:n,y:n,width:e-2*n,height:t-2*n})}EY.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};EY.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,o=i.width,r=i.height,s=o-t,a=r-n;return s<0||a<0?void 0:s===0&&a===0?e:s>a?(e.childNode1=new fE({x:i.x,y:i.y,width:t,height:r}),e.childNode2=new fE({x:i.x+t,y:i.y,width:s,height:r}),this._findNode(e.childNode1,{width:t,height:n})):(e.childNode1=new fE({x:i.x,y:i.y,width:o,height:n}),e.childNode2=new fE({x:i.x,y:i.y+n,width:o,height:a}),this._findNode(e.childNode1,{width:t,height:n}))}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var lC=EY;var ene=16;function Gl(e){e=e??Y.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(ene,ene);this._pixelFormat=e.pixelFormat??ot.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Hn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Gl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});Gl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new ze),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,s=i.width,a=i.height,c=i.x,d=i.y,u=this._subRegions.get(e);if(l(u)){let h=this._rectangles[u];c+=h.x,d+=h.y}return t.x=c/o,t.y=d/r,t.width=s/o,t.height=a/r,t};Gl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new vt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,c=s._textureTarget,d=this._texture,u=new Fr({context:e,colorTextures:[d],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),u._bind();let h=this.rectangles,p=this._subRegions;for(let g=0;g<h.length;++g){let f=i[g],y=h[g];if(!l(f)||!l(y)||l(p.get(g)))continue;let{x,y:S,width:C,height:V}=f;a.copyTexSubImage2D(c,0,x,S,y.x,y.y,C,V)}return a.bindTexture(c,null),s._initialized=!0,u._unBind(),u.destroy(),s};Gl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture,s=r.width,a=r.height,c=this._subRegions,d=i.map((C,V)=>new tne({index:V,image:C})).filter((C,V)=>l(C.image)&&!l(c.get(V))),u=0,h=0,p=0;for(let C=t;C<o.length;++C){let{width:V,height:L}=o[C].image;u=Math.max(u,V),h=Math.max(h,L),p+=V*L,d.push(o[C])}s=Math.max(u,s),a=Math.max(h,a),e.webgl2||(s=X.nextPowerOfTwo(s),a=X.nextPowerOfTwo(a));let g=p,f=1;for(;g/s/a>=1;)f*=2,s>a?a*=f:s*=f;d.sort(({image:C},{image:V})=>V.height*V.width-C.height*C.width);let y=new Array(this._nextIndex);for(let C of this._subRegions.keys())l(c.get(C))&&(y[C]=i[C]);let x,S=!1;for(;!S;){x=new lC({height:a,width:s,borderPadding:n});let C;for(C=0;C<d.length;++C){let{index:V,image:L}=d[C];if(!l(L))continue;let Z=x.pack(V,L);if(!l(Z)){s>a?a*=2:s*=2;break}y[V]=Z.rectangle}S=C===d.length}this._texturePacker=x,this._texture=this._copyFromTexture(e,s,a,y),r.destroy(),this._rectangles=y,this._guid=Hn()};Gl.prototype.getImageIndex=function(e){return this._indexById.get(e)};Gl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let o=this._texture,r=this._rectangles[e];try{o.copyFrom({source:t,xOffset:r.x,yOffset:r.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function tne({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Gl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new tne({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};Gl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let o=t[n],{image:r,index:s}=o,a=this._texturePacker.pack(s,r);if(!l(a)){try{this._resize(e,n)}catch(c){i=c,l(o.reject)&&o.reject(i)}break}this._rectangles[s]=a.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:o}=t[n];l(o)&&o(-1)}return t.length=0,!1}for(let o=0;o<t.length;++o)this._copyImageToTexture(t[o]);return t.length=0,!0};Gl.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 lC({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function LIe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof Re)&&(e=Re.createIfNeeded(e).fetchImage()),e}Gl.prototype.addImage=function(e,t){let n=this._indexPromiseById.get(e);if(l(n))return n;let i=this._nextIndex++;return this._indexById.set(e,i),n=(async()=>(t=await LIe(t,e),this.isDestroyed()||!l(t)?-1:this._addImage(i,t)))(),this._indexPromiseById.set(e,n),n};Gl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new ce(`image with id "${e}" not found in the atlas.`);let i=this._indexPromiseById.get(e);for(let[r,s]of this._subRegions.entries())if(n===s&&this._rectangles[r].equals(t))return i.then(c=>c===-1?-1:r);let o=this._nextIndex++;return this._subRegions.set(o,n),this._rectangles[o]=t.clone(),i.then(r=>{if(r===-1)return-1;let s=this._rectangles[r];return o})};Gl.prototype.isDestroyed=function(){return!1};Gl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),me(this)};var Vx=Gl;var M3t=_(T(),1);function zs(e,t,n,i){let o=zs._verifyAttributes(t);n=n??0;let r=[],s={},a,c,d=o.length;for(let h=0;h<d;++h){let p=o[h];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function u(h,p){return Q.getSizeInBytes(p.componentDatatype)-Q.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(u);let h=zs._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:h,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:zs._createArrayViews(a,h)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}zs._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:o.index??i,enabled:o.enabled??!0,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype??Q.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??ke.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};zs._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Q.getSizeInBytes(a.componentDatatype)}let i=n>0?Q.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};zs._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Q.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Q.getSizeInBytes(a)}return n};zs.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];zs._resize(o,this._size),zs._appendWriters(this.writers,o)}IY(this)};zs._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=Q.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var RIe=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];zs._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]=RIe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};zs.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=ZIe(this,i)||t;if(t||!l(this.va)){IY(this);let s=this.va=[],a=X.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let d=0;d<c;++d){let u=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=d*(i.vertexSizeInBytes*a);zs._appendAttributes(u,i,h,this._instanced)}u=u.concat(this._precreated),s.push({va:new oi({context:this._context,attributes:u,indexBuffer:e}),indicesCount:1.5*(d!==c-1?a:this._size%a)})}}};function ZIe(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=Ct.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}zs._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};zs.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)GIe(n[i],e,t)};function GIe(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)}}zs.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function IY(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}zs.prototype.isDestroyed=function(){return!1};zs.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 IY(this),me(this)};var Gp=zs;var O3t=_(T(),1);var k3t=_(T(),1),nne=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],XY=1,pE=8,Lx=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!==XY)throw new Error(`Got v${o} data when expected v${XY}.`);let r=nne[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=nne.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,pE,t),this.coords=new this.ArrayType(this.data,pE+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(pE+s+a+c),this.ids=new this.IndexArrayType(this.data,pE,t),this.coords=new this.ArrayType(this.data,pE+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(XY<<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 PY(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],d=[];for(;c.length;){let u=c.pop()||0,h=c.pop()||0,p=c.pop()||0;if(h-p<=a){for(let x=p;x<=h;x++){let S=s[2*x],C=s[2*x+1];S>=t&&S<=i&&C>=n&&C<=o&&d.push(r[x])}continue}let g=p+h>>1,f=s[2*g],y=s[2*g+1];f>=t&&f<=i&&y>=n&&y<=o&&d.push(r[g]),(u===0?t<=f:n<=y)&&(c.push(p),c.push(g-1),c.push(1-u)),(u===0?i>=f:o>=y)&&(c.push(g+1),c.push(h),c.push(1-u))}return d}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],d=i*i;for(;a.length;){let u=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let x=p;x<=h;x++)ine(r[2*x],r[2*x+1],t,n)<=d&&c.push(o[x]);continue}let g=p+h>>1,f=r[2*g],y=r[2*g+1];ine(f,y,t,n)<=d&&c.push(o[g]),(u===0?t-i<=f:n-i<=y)&&(a.push(p),a.push(g-1),a.push(1-u)),(u===0?t+i>=f:n+i>=y)&&(a.push(g+1),a.push(h),a.push(1-u))}return c}};function PY(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;one(e,t,s,i,o,r),PY(e,t,n,i,s-1,1-r),PY(e,t,n,s+1,o,1-r)}function one(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+g)),y=Math.min(o,Math.floor(n+(d-u)*p/d+g));one(e,t,n,f,y,r)}let s=t[2*n+r],a=i,c=o;for(bE(e,t,i,n),t[2*o+r]>s&&bE(e,t,i,o);a<c;){for(bE(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?bE(e,t,i,c):(c++,bE(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function bE(e,t,n,i){WY(e,n,i),WY(t,2*n,2*i),WY(t,2*n+1,2*i+1)}function WY(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function ine(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}var dC={},EIe={KDBush:Lx,addCache:function(e,t){return dC[e]=t,t},removeCache:function(e){delete dC[e]},getCache:function(e){return dC[e]},getCacheOrAdd:function(e){return dC[e]||(dC[e]={}),dC[e]}},Ep=EIe;var dBt=_(T(),1);var q3t=_(T(),1);function Y0(e){e=e??Y.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ne.default,this._rectangle=e.rectangle??le.MAX_VALUE,this._projection=new Ii(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(Y0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Y0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Y0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Y0.prototype.rectangleToNativeRectangle=function(e,t){let n=X.toDegrees(e.west),i=X.toDegrees(e.south),o=X.toDegrees(e.east),r=X.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new le(n,i,o,r)};Y0.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=X.toDegrees(o.west),o.south=X.toDegrees(o.south),o.east=X.toDegrees(o.east),o.north=X.toDegrees(o.north),o};Y0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,d=(e+1)*a+o.west,u=o.height/s,h=o.north-t*u,p=o.north-(t+1)*u;return l(i)||(i=new le(c,p,d,h)),i.west=c,i.south=p,i.east=d,i.north=h,i};Y0.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!le.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=X.TWO_PI);let d=(c-i.west)/s|0;d>=o&&(d=o-1);let u=(i.north-e.latitude)/a|0;return u>=r&&(u=r-1),l(n)?(n.x=d,n.y=u,n):new U(d,u)};var Ki=Y0;var rne=new m,sne=new m,ane=new he,vY=new m,IIe=new m,cne=new de,XIe=new Ki,gE=[new he,new he,new he,new he],yE=new U,qr={};qr.initialize=function(){let e=qr._initPromise;return l(e)||(e=Re.fetchJson(sn("Assets/approximateTerrainHeights.json")).then(function(t){qr._terrainHeights=t}),qr._initPromise=e),e};qr.getMinimumMaximumHeights=function(e,t){t=t??ne.default;let n=lne(e),i=qr._defaultMinTerrainHeight,o=qr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=qr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(le.northeast(e,ane),rne),t.cartographicToCartesian(le.southwest(e,ane),sne),m.midpoint(sne,rne,vY);let a=t.scaleToGeodeticSurface(vY,IIe);if(l(a)){let c=m.distance(vY,a);i=Math.min(i,-c)}else i=qr._defaultMinTerrainHeight}return i=Math.max(qr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};qr.getBoundingSphere=function(e,t){t=t??ne.default;let n=lne(e),i=qr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=qr._terrainHeights[r];l(s)&&(i=s[1])}let o=de.fromRectangle3D(e,t,0);return de.fromRectangle3D(e,t,i,cne),de.union(o,cne,o)};function lne(e){he.fromRadians(e.east,e.north,0,gE[0]),he.fromRadians(e.west,e.north,0,gE[1]),he.fromRadians(e.east,e.south,0,gE[2]),he.fromRadians(e.west,e.south,0,gE[3]);let t=0,n=0,i=0,o=0,r=qr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=gE[c];if(XIe.positionToTileXY(d,s,yE),c===0)i=yE.x,o=yE.y;else if(i!==yE.x||o!==yE.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}qr._terrainHeightsMaxLevel=6;qr._defaultMaxTerrainHeight=9e3;qr._defaultMinTerrainHeight=-1e5;qr._terrainHeights=void 0;qr._initPromise=void 0;Object.defineProperties(qr,{initialized:{get:function(){return l(qr._terrainHeights)}}});var ui=qr;var cHt=_(T(),1);var bBt=_(T(),1);var mBt=_(T(),1);/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */var{entries:xne,setPrototypeOf:dne,isFrozen:WIe,getPrototypeOf:PIe,getOwnPropertyDescriptor:vIe}=Object,{freeze:Dc,seal:_u,create:_ne}=Object,{apply:kY,construct:UY}=typeof Reflect<"u"&&Reflect;Dc||(Dc=function(t){return t});_u||(_u=function(t){return t});kY||(kY=function(t,n,i){return t.apply(n,i)});UY||(UY=function(t,n){return new t(...n)});var i5=Oc(Array.prototype.forEach),wIe=Oc(Array.prototype.lastIndexOf),une=Oc(Array.prototype.pop),xE=Oc(Array.prototype.push),FIe=Oc(Array.prototype.splice),r5=Oc(String.prototype.toLowerCase),wY=Oc(String.prototype.toString),mne=Oc(String.prototype.match),_E=Oc(String.prototype.replace),AIe=Oc(String.prototype.indexOf),MIe=Oc(String.prototype.trim),Xm=Oc(Object.prototype.hasOwnProperty),Uc=Oc(RegExp.prototype.test),TE=NIe(TypeError);function Oc(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return kY(e,t,i)}}function NIe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return UY(e,n)}}function Wi(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r5;dne&&dne(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(WIe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function kIe(e){for(let t=0;t<e.length;t++)Xm(e,t)||(e[t]=null);return e}function Rx(e){let t=_ne(null);for(let[n,i]of xne(e))Xm(e,n)&&(Array.isArray(i)?t[n]=kIe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=Rx(i):t[n]=i);return t}function SE(e,t){for(;e!==null;){let i=vIe(e,t);if(i){if(i.get)return Oc(i.get);if(typeof i.value=="function")return Oc(i.value)}e=PIe(e)}function n(){return null}return n}var hne=Dc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),FY=Dc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),AY=Dc(["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"]),UIe=Dc(["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"]),MY=Dc(["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"]),DIe=Dc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fne=Dc(["#text"]),pne=Dc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),NY=Dc(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),bne=Dc(["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"]),o5=Dc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),OIe=_u(/\{\{[\w\W]*|[\w\W]*\}\}/gm),BIe=_u(/<%[\w\W]*|[\w\W]*%>/gm),YIe=_u(/\$\{[\w\W]*/gm),zIe=_u(/^data-[\-\w.\u00B7-\uFFFF]+$/),HIe=_u(/^aria-[\-\w]+$/),Tne=_u(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),KIe=_u(/^(?:\w+script|data):/i),JIe=_u(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sne=_u(/^html$/i),QIe=_u(/^[a-z][.\w]*(-[.\w]+)+$/i),gne=Object.freeze({__proto__:null,ARIA_ATTR:HIe,ATTR_WHITESPACE:JIe,CUSTOM_ELEMENT:QIe,DATA_ATTR:zIe,DOCTYPE_NAME:Sne,ERB_EXPR:BIe,IS_ALLOWED_URI:Tne,IS_SCRIPT_OR_DATA:KIe,MUSTACHE_EXPR:OIe,TMPLIT_EXPR:YIe}),CE={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},jIe=function(){return typeof window>"u"?null:window},qIe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},yne=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Cne(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jIe(),t=$t=>Cne($t);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==CE.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:g}=e,f=c.prototype,y=SE(f,"cloneNode"),x=SE(f,"remove"),S=SE(f,"nextSibling"),C=SE(f,"childNodes"),V=SE(f,"parentNode");if(typeof s=="function"){let $t=n.createElement("template");$t.content&&$t.content.ownerDocument&&(n=$t.content.ownerDocument)}let L,Z="",{implementation:E,createNodeIterator:P,createDocumentFragment:W,getElementsByTagName:v}=n,{importNode:A}=i,b=yne();t.isSupported=typeof xne=="function"&&typeof V=="function"&&E&&E.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:R,ERB_EXPR:G,TMPLIT_EXPR:I,DATA_ATTR:w,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:B}=gne,{IS_ALLOWED_URI:N}=gne,z=null,K=Wi({},[...hne,...FY,...AY,...MY,...fne]),te=null,H=Wi({},[...pne,...NY,...bne,...o5]),j=Object.seal(_ne(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}})),ee=null,pe=null,_e=!0,ae=!0,ye=!1,Se=!0,Ee=!1,Ie=!0,Fe=!1,ve=!1,ct=!1,Je=!1,bt=!1,Qe=!1,Tt=!0,ft=!1,gt="user-content-",En=!0,cn=!1,Ce={},Le=null,St=Wi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),mn=null,to=Wi({},["audio","video","img","source","image","track"]),He=null,yr=Wi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),cr="http://www.w3.org/1998/Math/MathML",ma="http://www.w3.org/2000/svg",Me="http://www.w3.org/1999/xhtml",at=Me,et=!1,qe=null,lt=Wi({},[cr,ma,Me],wY),Bt=Wi({},["mi","mo","mn","ms","mtext"]),xn=Wi({},["annotation-xml"]),no=Wi({},["title","style","font","a","script"]),zi=null,ms=["application/xhtml+xml","text/html"],lr="text/html",Gi=null,Ei=null,ha=n.createElement("form"),jr=function(Ve){return Ve instanceof RegExp||Ve instanceof Function},Tl=function(){let Ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ei&&Ei===Ve)){if((!Ve||typeof Ve!="object")&&(Ve={}),Ve=Rx(Ve),zi=ms.indexOf(Ve.PARSER_MEDIA_TYPE)===-1?lr:Ve.PARSER_MEDIA_TYPE,Gi=zi==="application/xhtml+xml"?wY:r5,z=Xm(Ve,"ALLOWED_TAGS")?Wi({},Ve.ALLOWED_TAGS,Gi):K,te=Xm(Ve,"ALLOWED_ATTR")?Wi({},Ve.ALLOWED_ATTR,Gi):H,qe=Xm(Ve,"ALLOWED_NAMESPACES")?Wi({},Ve.ALLOWED_NAMESPACES,wY):lt,He=Xm(Ve,"ADD_URI_SAFE_ATTR")?Wi(Rx(yr),Ve.ADD_URI_SAFE_ATTR,Gi):yr,mn=Xm(Ve,"ADD_DATA_URI_TAGS")?Wi(Rx(to),Ve.ADD_DATA_URI_TAGS,Gi):to,Le=Xm(Ve,"FORBID_CONTENTS")?Wi({},Ve.FORBID_CONTENTS,Gi):St,ee=Xm(Ve,"FORBID_TAGS")?Wi({},Ve.FORBID_TAGS,Gi):{},pe=Xm(Ve,"FORBID_ATTR")?Wi({},Ve.FORBID_ATTR,Gi):{},Ce=Xm(Ve,"USE_PROFILES")?Ve.USE_PROFILES:!1,_e=Ve.ALLOW_ARIA_ATTR!==!1,ae=Ve.ALLOW_DATA_ATTR!==!1,ye=Ve.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=Ve.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=Ve.SAFE_FOR_TEMPLATES||!1,Ie=Ve.SAFE_FOR_XML!==!1,Fe=Ve.WHOLE_DOCUMENT||!1,Je=Ve.RETURN_DOM||!1,bt=Ve.RETURN_DOM_FRAGMENT||!1,Qe=Ve.RETURN_TRUSTED_TYPE||!1,ct=Ve.FORCE_BODY||!1,Tt=Ve.SANITIZE_DOM!==!1,ft=Ve.SANITIZE_NAMED_PROPS||!1,En=Ve.KEEP_CONTENT!==!1,cn=Ve.IN_PLACE||!1,N=Ve.ALLOWED_URI_REGEXP||Tne,at=Ve.NAMESPACE||Me,Bt=Ve.MATHML_TEXT_INTEGRATION_POINTS||Bt,xn=Ve.HTML_INTEGRATION_POINTS||xn,j=Ve.CUSTOM_ELEMENT_HANDLING||{},Ve.CUSTOM_ELEMENT_HANDLING&&jr(Ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(j.tagNameCheck=Ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ve.CUSTOM_ELEMENT_HANDLING&&jr(Ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(j.attributeNameCheck=Ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ve.CUSTOM_ELEMENT_HANDLING&&typeof Ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(j.allowCustomizedBuiltInElements=Ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(ae=!1),bt&&(Je=!0),Ce&&(z=Wi({},fne),te=[],Ce.html===!0&&(Wi(z,hne),Wi(te,pne)),Ce.svg===!0&&(Wi(z,FY),Wi(te,NY),Wi(te,o5)),Ce.svgFilters===!0&&(Wi(z,AY),Wi(te,NY),Wi(te,o5)),Ce.mathMl===!0&&(Wi(z,MY),Wi(te,bne),Wi(te,o5))),Ve.ADD_TAGS&&(z===K&&(z=Rx(z)),Wi(z,Ve.ADD_TAGS,Gi)),Ve.ADD_ATTR&&(te===H&&(te=Rx(te)),Wi(te,Ve.ADD_ATTR,Gi)),Ve.ADD_URI_SAFE_ATTR&&Wi(He,Ve.ADD_URI_SAFE_ATTR,Gi),Ve.FORBID_CONTENTS&&(Le===St&&(Le=Rx(Le)),Wi(Le,Ve.FORBID_CONTENTS,Gi)),En&&(z["#text"]=!0),Fe&&Wi(z,["html","head","body"]),z.table&&(Wi(z,["tbody"]),delete ee.tbody),Ve.TRUSTED_TYPES_POLICY){if(typeof Ve.TRUSTED_TYPES_POLICY.createHTML!="function")throw TE('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ve.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw TE('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');L=Ve.TRUSTED_TYPES_POLICY,Z=L.createHTML("")}else L===void 0&&(L=qIe(g,o)),L!==null&&typeof Z=="string"&&(Z=L.createHTML(""));Dc&&Dc(Ve),Ei=Ve}},Xo=Wi({},[...FY,...AY,...UIe]),xr=Wi({},[...MY,...DIe]),Tm=function(Ve){let Zt=V(Ve);(!Zt||!Zt.tagName)&&(Zt={namespaceURI:at,tagName:"template"});let Nt=r5(Ve.tagName),uo=r5(Zt.tagName);return qe[Ve.namespaceURI]?Ve.namespaceURI===ma?Zt.namespaceURI===Me?Nt==="svg":Zt.namespaceURI===cr?Nt==="svg"&&(uo==="annotation-xml"||Bt[uo]):!!Xo[Nt]:Ve.namespaceURI===cr?Zt.namespaceURI===Me?Nt==="math":Zt.namespaceURI===ma?Nt==="math"&&xn[uo]:!!xr[Nt]:Ve.namespaceURI===Me?Zt.namespaceURI===ma&&!xn[uo]||Zt.namespaceURI===cr&&!Bt[uo]?!1:!xr[Nt]&&(no[Nt]||!Xo[Nt]):!!(zi==="application/xhtml+xml"&&qe[Ve.namespaceURI]):!1},_r=function(Ve){xE(t.removed,{element:Ve});try{V(Ve).removeChild(Ve)}catch{x(Ve)}},du=function(Ve,Zt){try{xE(t.removed,{attribute:Zt.getAttributeNode(Ve),from:Zt})}catch{xE(t.removed,{attribute:null,from:Zt})}if(Zt.removeAttribute(Ve),Ve==="is")if(Je||bt)try{_r(Zt)}catch{}else try{Zt.setAttribute(Ve,"")}catch{}},Kh=function(Ve){let Zt=null,Nt=null;if(ct)Ve="<remove></remove>"+Ve;else{let Rs=mne(Ve,/^[\r\n\t ]+/);Nt=Rs&&Rs[0]}zi==="application/xhtml+xml"&&at===Me&&(Ve='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ve+"</body></html>");let uo=L?L.createHTML(Ve):Ve;if(at===Me)try{Zt=new p().parseFromString(uo,zi)}catch{}if(!Zt||!Zt.documentElement){Zt=E.createDocument(at,"template",null);try{Zt.documentElement.innerHTML=et?Z:uo}catch{}}let Tr=Zt.body||Zt.documentElement;return Ve&&Nt&&Tr.insertBefore(n.createTextNode(Nt),Tr.childNodes[0]||null),at===Me?v.call(Zt,Fe?"html":"body")[0]:Fe?Zt.documentElement:Tr},hp=function(Ve){return P.call(Ve.ownerDocument||Ve,Ve,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Jh=function(Ve){return Ve instanceof h&&(typeof Ve.nodeName!="string"||typeof Ve.textContent!="string"||typeof Ve.removeChild!="function"||!(Ve.attributes instanceof u)||typeof Ve.removeAttribute!="function"||typeof Ve.setAttribute!="function"||typeof Ve.namespaceURI!="string"||typeof Ve.insertBefore!="function"||typeof Ve.hasChildNodes!="function")},fp=function(Ve){return typeof a=="function"&&Ve instanceof a};function qa($t,Ve,Zt){i5($t,Nt=>{Nt.call(t,Ve,Zt,Ei)})}let I0=function(Ve){let Zt=null;if(qa(b.beforeSanitizeElements,Ve,null),Jh(Ve))return _r(Ve),!0;let Nt=Gi(Ve.nodeName);if(qa(b.uponSanitizeElement,Ve,{tagName:Nt,allowedTags:z}),Ve.hasChildNodes()&&!fp(Ve.firstElementChild)&&Uc(/<[/\w]/g,Ve.innerHTML)&&Uc(/<[/\w]/g,Ve.textContent)||Ve.nodeType===CE.progressingInstruction||Ie&&Ve.nodeType===CE.comment&&Uc(/<[/\w]/g,Ve.data))return _r(Ve),!0;if(!z[Nt]||ee[Nt]){if(!ee[Nt]&&X0(Nt)&&(j.tagNameCheck instanceof RegExp&&Uc(j.tagNameCheck,Nt)||j.tagNameCheck instanceof Function&&j.tagNameCheck(Nt)))return!1;if(En&&!Le[Nt]){let uo=V(Ve)||Ve.parentNode,Tr=C(Ve)||Ve.childNodes;if(Tr&&uo){let Rs=Tr.length;for(let Ao=Rs-1;Ao>=0;--Ao){let ec=y(Tr[Ao],!0);ec.__removalCount=(Ve.__removalCount||0)+1,uo.insertBefore(ec,S(Ve))}}}return _r(Ve),!0}return Ve instanceof c&&!Tm(Ve)||(Nt==="noscript"||Nt==="noembed"||Nt==="noframes")&&Uc(/<\/no(script|embed|frames)/i,Ve.innerHTML)?(_r(Ve),!0):(Ee&&Ve.nodeType===CE.text&&(Zt=Ve.textContent,i5([R,G,I],uo=>{Zt=_E(Zt,uo," ")}),Ve.textContent!==Zt&&(xE(t.removed,{element:Ve.cloneNode()}),Ve.textContent=Zt)),qa(b.afterSanitizeElements,Ve,null),!1)},kS=function(Ve,Zt,Nt){if(Tt&&(Zt==="id"||Zt==="name")&&(Nt in n||Nt in ha))return!1;if(!(ae&&!pe[Zt]&&Uc(w,Zt))){if(!(_e&&Uc(M,Zt))){if(!te[Zt]||pe[Zt]){if(!(X0(Ve)&&(j.tagNameCheck instanceof RegExp&&Uc(j.tagNameCheck,Ve)||j.tagNameCheck instanceof Function&&j.tagNameCheck(Ve))&&(j.attributeNameCheck instanceof RegExp&&Uc(j.attributeNameCheck,Zt)||j.attributeNameCheck instanceof Function&&j.attributeNameCheck(Zt))||Zt==="is"&&j.allowCustomizedBuiltInElements&&(j.tagNameCheck instanceof RegExp&&Uc(j.tagNameCheck,Nt)||j.tagNameCheck instanceof Function&&j.tagNameCheck(Nt))))return!1}else if(!He[Zt]){if(!Uc(N,_E(Nt,k,""))){if(!((Zt==="src"||Zt==="xlink:href"||Zt==="href")&&Ve!=="script"&&AIe(Nt,"data:")===0&&mn[Ve])){if(!(ye&&!Uc(O,_E(Nt,k,"")))){if(Nt)return!1}}}}}}return!0},X0=function(Ve){return Ve!=="annotation-xml"&&mne(Ve,B)},Ds=function(Ve){qa(b.beforeSanitizeAttributes,Ve,null);let{attributes:Zt}=Ve;if(!Zt||Jh(Ve))return;let Nt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0},uo=Zt.length;for(;uo--;){let Tr=Zt[uo],{name:Rs,namespaceURI:Ao,value:ec}=Tr,qy=Gi(Rs),vc=Rs==="value"?ec:MIe(ec);if(Nt.attrName=qy,Nt.attrValue=vc,Nt.keepAttr=!0,Nt.forceKeepAttr=void 0,qa(b.uponSanitizeAttribute,Ve,Nt),vc=Nt.attrValue,ft&&(qy==="id"||qy==="name")&&(du(Rs,Ve),vc=gt+vc),Ie&&Uc(/((--!?|])>)|<\/(style|title)/i,vc)){du(Rs,Ve);continue}if(Nt.forceKeepAttr||(du(Rs,Ve),!Nt.keepAttr))continue;if(!Se&&Uc(/\/>/i,vc)){du(Rs,Ve);continue}Ee&&i5([R,G,I],xq=>{vc=_E(vc,xq," ")});let yq=Gi(Ve.nodeName);if(kS(yq,qy,vc)){if(L&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Ao)switch(g.getAttributeType(yq,qy)){case"TrustedHTML":{vc=L.createHTML(vc);break}case"TrustedScriptURL":{vc=L.createScriptURL(vc);break}}try{Ao?Ve.setAttributeNS(Ao,Rs,vc):Ve.setAttribute(Rs,vc),Jh(Ve)?_r(Ve):une(t.removed)}catch{}}}qa(b.afterSanitizeAttributes,Ve,null)},$a=function $t(Ve){let Zt=null,Nt=hp(Ve);for(qa(b.beforeSanitizeShadowDOM,Ve,null);Zt=Nt.nextNode();)qa(b.uponSanitizeShadowNode,Zt,null),I0(Zt),Ds(Zt),Zt.content instanceof r&&$t(Zt.content);qa(b.afterSanitizeShadowDOM,Ve,null)};return t.sanitize=function($t){let Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Zt=null,Nt=null,uo=null,Tr=null;if(et=!$t,et&&($t="<!-->"),typeof $t!="string"&&!fp($t))if(typeof $t.toString=="function"){if($t=$t.toString(),typeof $t!="string")throw TE("dirty is not a string, aborting")}else throw TE("toString is not a function");if(!t.isSupported)return $t;if(ve||Tl(Ve),t.removed=[],typeof $t=="string"&&(cn=!1),cn){if($t.nodeName){let ec=Gi($t.nodeName);if(!z[ec]||ee[ec])throw TE("root node is forbidden and cannot be sanitized in-place")}}else if($t instanceof a)Zt=Kh("<!---->"),Nt=Zt.ownerDocument.importNode($t,!0),Nt.nodeType===CE.element&&Nt.nodeName==="BODY"||Nt.nodeName==="HTML"?Zt=Nt:Zt.appendChild(Nt);else{if(!Je&&!Ee&&!Fe&&$t.indexOf("<")===-1)return L&&Qe?L.createHTML($t):$t;if(Zt=Kh($t),!Zt)return Je?null:Qe?Z:""}Zt&&ct&&_r(Zt.firstChild);let Rs=hp(cn?$t:Zt);for(;uo=Rs.nextNode();)I0(uo),Ds(uo),uo.content instanceof r&&$a(uo.content);if(cn)return $t;if(Je){if(bt)for(Tr=W.call(Zt.ownerDocument);Zt.firstChild;)Tr.appendChild(Zt.firstChild);else Tr=Zt;return(te.shadowroot||te.shadowrootmode)&&(Tr=A.call(i,Tr,!0)),Tr}let Ao=Fe?Zt.outerHTML:Zt.innerHTML;return Fe&&z["!doctype"]&&Zt.ownerDocument&&Zt.ownerDocument.doctype&&Zt.ownerDocument.doctype.name&&Uc(Sne,Zt.ownerDocument.doctype.name)&&(Ao="<!DOCTYPE "+Zt.ownerDocument.doctype.name+`>
|
|
|
`+Ao),Ee&&i5([R,G,I],ec=>{Ao=_E(Ao,ec," ")}),L&&Qe?L.createHTML(Ao):Ao},t.setConfig=function(){let $t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tl($t),ve=!0},t.clearConfig=function(){Ei=null,ve=!1},t.isValidAttribute=function($t,Ve,Zt){Ei||Tl({});let Nt=Gi($t),uo=Gi(Ve);return kS(Nt,uo,Zt)},t.addHook=function($t,Ve){typeof Ve=="function"&&xE(b[$t],Ve)},t.removeHook=function($t,Ve){if(Ve!==void 0){let Zt=wIe(b[$t],Ve);return Zt===-1?void 0:FIe(b[$t],Zt,1)[0]}return une(b[$t])},t.removeHooks=function($t){b[$t]=[]},t.removeAllHooks=function(){b=yne()},t}var Vne=Cne();var $Ie=0,DY={};function lf(e,t){let n,i=e;l(DY[i])?n=DY[i]:(n=$Ie++,DY[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(lf.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=Vne.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}}});lf.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};lf.prototype.equals=function(e){return lf.equals(this,e)};lf.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};lf.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new lf(e.html,t)};lf.clone=function(e){if(l(e))return new lf(e.html,e.showOnScreen)};var Gt=lf;var yBt=_(T(),1),eXe={NONE:0,LERC:1},Tu=Object.freeze(eXe);var _zt=_(T(),1);var zYt=_(T(),1);var CBt=_(T(),1);function Bc(e,t,n){this.minimum=m.clone(e??m.ZERO),this.maximum=m.clone(t??m.ZERO),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}Bc.fromCorners=function(e,t,n){return l(n)||(n=new Bc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};Bc.fromPoints=function(e,t){if(l(t)||(t=new Bc),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let h=1;h<c;h++){let p=e[h],g=p.x,f=p.y,y=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(f,i),s=Math.max(f,s),o=Math.min(y,o),a=Math.max(y,a)}let d=t.minimum;d.x=n,d.y=i,d.z=o;let u=t.maximum;return u.x=r,u.y=s,u.z=a,t.center=m.midpoint(d,u,t.center),t};Bc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=m.clone(e.minimum,t.minimum),t.maximum=m.clone(e.maximum,t.maximum),t.center=m.clone(e.center,t.center),t):new Bc(e.minimum,e.maximum,e.center)};Bc.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&m.equals(e.minimum,t.minimum)&&m.equals(e.maximum,t.maximum)};var s5=new m;Bc.intersectPlane=function(e,t){s5=m.subtract(e.maximum,e.minimum,s5);let n=m.multiplyByScalar(s5,.5,s5),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=m.dot(e.center,i)+t.distance;return r-o>0?Jt.INSIDE:r+o<0?Jt.OUTSIDE:Jt.INTERSECTING};Bc.prototype.clone=function(e){return Bc.clone(this,e)};Bc.prototype.intersectPlane=function(e){return Bc.intersectPlane(this,e)};Bc.prototype.equals=function(e){return Bc.equals(this,e)};var z0=Bc;var IBt=_(T(),1);function df(e,t){this._ellipsoid=e,this._cameraPosition=new m,this._cameraPositionInScaledSpace=new m,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(df.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=m.magnitudeSquared(n)-1;m.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Lne=new m;df.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Lne);return BY(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};df.prototype.isScaledSpacePointVisible=function(e){return BY(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var tXe=new m;df.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=tXe,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),BY(e,o,i)};df.prototype.computeHorizonCullingPoint=function(e,t,n){return Gne(this._ellipsoid,e,t,n)};var Rne=ne.clone(ne.UNIT_SPHERE);df.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Zne(this._ellipsoid,n,Rne);return Gne(o,e,t,i)};df.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return Ene(this._ellipsoid,e,t,n,i,o)};df.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Zne(this._ellipsoid,o,Rne);return Ene(s,e,t,n,i,r)};var nXe=[];df.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=le.subsample(e,t,0,nXe),o=de.fromPoints(i);if(!(m.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var iXe=new m;function Zne(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,iXe);e=ne.fromCartesian3(i,n)}return e}function Gne(e,t,n,i){l(i)||(i=new m);let o=Wne(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],d=Ine(e,c,o);if(d<0)return;r=Math.max(r,d)}return Xne(o,r,i)}var a5=new m;function Ene(e,t,n,i,o,r){l(r)||(r=new m),i=i??3,o=o??m.ZERO;let s=Wne(e,t),a=0;for(let c=0,d=n.length;c<d;c+=i){a5.x=n[c]+o.x,a5.y=n[c+1]+o.y,a5.z=n[c+2]+o.z;let u=Ine(e,a5,s);if(u<0)return;a=Math.max(a,u)}return Xne(s,a,r)}function BY(e,t,n){let i=t,o=n,r=m.subtract(e,i,Lne),s=-m.dot(r,i);return!(o<0?s>0:s>o&&s*s/m.magnitudeSquared(r)>o)}var oXe=new m,rXe=new m;function Ine(e,t,n){let i=e.transformPositionToScaledSpace(t,oXe),o=m.magnitudeSquared(i),r=Math.sqrt(o),s=m.divideByScalar(i,r,rXe);o=Math.max(1,o),r=Math.max(1,r);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-c*u)}function Xne(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var OY=new m;function Wne(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,OY),m.normalize(OY,OY))}var Ip=df;var rYt=_(T(),1);var OBt=_(T(),1);var YY=new re;function uf(e,t){t=t??ne.default,e=t.scaleToGeodeticSurface(e);let n=Ft.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(F.getColumn(n,0,YY)),this._yAxis=m.fromCartesian4(F.getColumn(n,1,YY));let i=m.fromCartesian4(F.getColumn(n,2,YY));this._plane=dn.fromPointNormal(e,i)}Object.defineProperties(uf.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 sXe=new z0;uf.fromPoints=function(e,t){let n=z0.fromPoints(e,sXe);return new uf(n.center,t)};var Pne=new yn,c5=new m;uf.prototype.projectPointOntoPlane=function(e,t){let n=Pne;n.origin=e,m.normalize(e,n.direction);let i=ei.rayPlane(n,this._plane,c5);if(l(i)||(m.negate(n.direction,n.direction),i=ei.rayPlane(n,this._plane,c5)),l(i)){let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new U(r,s)}};uf.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};uf.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=Pne;n.origin=e,m.clone(this._plane.normal,n.direction);let i=ei.rayPlane(n,this._plane,c5);l(i)||(m.negate(n.direction,n.direction),i=ei.rayPlane(n,this._plane,c5));let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return t.x=r,t.y=s,t};uf.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 aXe=new m;uf.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new m);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=aXe;return m.multiplyByScalar(o,e.x,s),t=m.add(i,s,t),m.multiplyByScalar(r,e.y,s),m.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};uf.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 $r=uf;function ki(e,t){this.center=m.clone(e??m.ZERO),this.halfAxes=$.clone(t??$.ZERO)}ki.packedLength=m.packedLength+$.packedLength;ki.pack=function(e,t,n){return n=n??0,m.pack(e.center,t,n),$.pack(e.halfAxes,t,n+m.packedLength),t};ki.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ki),m.unpack(e,t,n.center),$.unpack(e,t+m.packedLength,n.halfAxes),n};var cXe=new m,lXe=new m,dXe=new m,uXe=new m,mXe=new m,hXe=new m,fXe=new $,pXe={unitary:new $,diagonal:new $};ki.fromPoints=function(e,t){if(l(t)||(t=new ki),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=m.ZERO,t;let n,i=e.length,o=m.clone(e[0],cXe);for(n=1;n<i;n++)m.add(o,e[n],o);let r=1/i;m.multiplyByScalar(o,r,o);let s=0,a=0,c=0,d=0,u=0,h=0,p;for(n=0;n<i;n++)p=m.subtract(e[n],o,lXe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,d+=p.y*p.y,u+=p.y*p.z,h+=p.z*p.z;s*=r,a*=r,c*=r,d*=r,u*=r,h*=r;let g=fXe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=d,g[5]=u,g[6]=c,g[7]=u,g[8]=h;let f=$.computeEigenDecomposition(g,pXe),y=$.clone(f.unitary,t.halfAxes),x=$.getColumn(y,0,uXe),S=$.getColumn(y,1,mXe),C=$.getColumn(y,2,hXe),V=-Number.MAX_VALUE,L=-Number.MAX_VALUE,Z=-Number.MAX_VALUE,E=Number.MAX_VALUE,P=Number.MAX_VALUE,W=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],V=Math.max(m.dot(x,p),V),L=Math.max(m.dot(S,p),L),Z=Math.max(m.dot(C,p),Z),E=Math.min(m.dot(x,p),E),P=Math.min(m.dot(S,p),P),W=Math.min(m.dot(C,p),W);x=m.multiplyByScalar(x,.5*(E+V),x),S=m.multiplyByScalar(S,.5*(P+L),S),C=m.multiplyByScalar(C,.5*(W+Z),C);let v=m.add(x,S,t.center);m.add(v,C,v);let A=dXe;return A.x=V-E,A.y=L-P,A.z=Z-W,m.multiplyByScalar(A,.5,A),$.multiplyByScale(t.halfAxes,A,t.halfAxes),t};var Nne=new m,bXe=new m;function vne(e,t,n,i,o,r,s,a,c,d,u){l(u)||(u=new ki);let h=u.halfAxes;$.setColumn(h,0,t,h),$.setColumn(h,1,n,h),$.setColumn(h,2,i,h);let p=Nne;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+d)/2;let g=bXe;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(d-c)/2;let f=u.center;return p=$.multiplyByVector(h,p,p),m.add(e,p,f),$.multiplyByScale(h,g,h),u}var wne=new he,gXe=new m,yXe=new he,xXe=new he,_Xe=new he,TXe=new he,SXe=new he,CXe=new m,Fne=new m,VXe=new m,Ane=new m,LXe=new m,RXe=new U,ZXe=new U,GXe=new U,EXe=new U,IXe=new U,XXe=new m,WXe=new m,PXe=new m,vXe=new m,wXe=new U,FXe=new m,AXe=new m,MXe=new m,NXe=new dn(m.UNIT_X,0);ki.fromRectangle=function(e,t,n,i,o){t=t??0,n=n??0,i=i??ne.default;let r,s,a,c,d,u,h;if(e.width<=X.PI){let P=le.center(e,wne),W=i.cartographicToCartesian(P,gXe),v=new $r(W,i);h=v.plane;let A=P.longitude,b=e.south<0&&e.north>0?0:P.latitude,R=he.fromRadians(A,e.north,n,yXe),G=he.fromRadians(e.west,e.north,n,xXe),I=he.fromRadians(e.west,b,n,_Xe),w=he.fromRadians(e.west,e.south,n,TXe),M=he.fromRadians(A,e.south,n,SXe),O=i.cartographicToCartesian(R,CXe),k=i.cartographicToCartesian(G,Fne),B=i.cartographicToCartesian(I,VXe),N=i.cartographicToCartesian(w,Ane),z=i.cartographicToCartesian(M,LXe),K=v.projectPointToNearestOnPlane(O,RXe),te=v.projectPointToNearestOnPlane(k,ZXe),H=v.projectPointToNearestOnPlane(B,GXe),j=v.projectPointToNearestOnPlane(N,EXe),ee=v.projectPointToNearestOnPlane(z,IXe);return r=Math.min(te.x,H.x,j.x),s=-r,c=Math.max(te.y,K.y),a=Math.min(j.y,ee.y),G.height=w.height=t,k=i.cartographicToCartesian(G,Fne),N=i.cartographicToCartesian(w,Ane),d=Math.min(dn.getPointDistance(h,k),dn.getPointDistance(h,N)),u=n,vne(v.origin,v.xAxis,v.yAxis,v.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,g=e.north<0,f=p?e.south:g?e.north:0,y=le.center(e,wne).longitude,x=m.fromRadians(y,f,n,i,XXe);x.z=0;let C=Math.abs(x.x)<X.EPSILON10&&Math.abs(x.y)<X.EPSILON10?m.UNIT_X:m.normalize(x,WXe),V=m.UNIT_Z,L=m.cross(C,V,PXe);h=dn.fromPointNormal(x,C,NXe);let Z=m.fromRadians(y+X.PI_OVER_TWO,f,n,i,vXe);s=m.dot(dn.projectPointOntoPlane(h,Z,wXe),L),r=-s,c=m.fromRadians(0,e.north,g?t:n,i,FXe).z,a=m.fromRadians(0,e.south,p?t:n,i,AXe).z;let E=m.fromRadians(e.east,f,n,i,MXe);return d=dn.getPointDistance(h,E),u=0,vne(x,L,V,C,r,s,a,c,d,u,o)};ki.fromTransformation=function(e,t){return l(t)||(t=new ki),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};ki.clone=function(e,t){if(l(e))return l(t)?(m.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new ki(e.center,e.halfAxes)};ki.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[$.COLUMN0ROW0]+s*o[$.COLUMN0ROW1]+a*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+s*o[$.COLUMN1ROW1]+a*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+s*o[$.COLUMN2ROW1]+a*o[$.COLUMN2ROW2]),d=m.dot(i,n)+t.distance;return d<=-c?Jt.OUTSIDE:d>=c?Jt.INSIDE:Jt.INTERSECTING};var kne=new m,Une=new m,Dne=new m,kXe=new m,Mne=new m,UXe=new m;ki.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,Nne),i=e.halfAxes,o=$.getColumn(i,0,kne),r=$.getColumn(i,1,Une),s=$.getColumn(i,2,Dne),a=m.magnitude(o),c=m.magnitude(r),d=m.magnitude(s),u=!0,h=!0,p=!0;a>0?m.divideByScalar(o,a,o):u=!1,c>0?m.divideByScalar(r,c,r):h=!1,d>0?m.divideByScalar(s,d,s):p=!1;let g=!u+!h+!p,f,y,x;if(g===1){let L=o;f=r,y=s,h?p||(L=s,y=o):(L=r,f=o),x=m.cross(f,y,Mne),L===o?o=x:L===r?r=x:L===s&&(s=x)}else if(g===2){f=o,h?f=r:p&&(f=s);let L=m.UNIT_Y;L.equalsEpsilon(f,X.EPSILON3)&&(L=m.UNIT_X),y=m.cross(f,L,kXe),m.normalize(y,y),x=m.cross(f,y,Mne),m.normalize(x,x),f===o?(r=y,s=x):f===r?(s=y,o=x):f===s&&(o=y,r=x)}else g===3&&(o=m.UNIT_X,r=m.UNIT_Y,s=m.UNIT_Z);let S=UXe;S.x=m.dot(n,o),S.y=m.dot(n,r),S.z=m.dot(n,s);let C=0,V;return S.x<-a?(V=S.x+a,C+=V*V):S.x>a&&(V=S.x-a,C+=V*V),S.y<-c?(V=S.y+c,C+=V*V):S.y>c&&(V=S.y-c,C+=V*V),S.z<-d?(V=S.z+d,C+=V*V):S.z>d&&(V=S.z-d,C+=V*V),C};var DXe=new m,OXe=new m;ki.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Pa);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,kne),d=$.getColumn(a,1,Une),u=$.getColumn(a,2,Dne),h=m.add(c,d,DXe);m.add(h,u,h),m.add(h,s,h);let p=m.subtract(h,t,OXe),g=m.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.add(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.subtract(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.subtract(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.add(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.add(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.subtract(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.subtract(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var BXe=new m,YXe=new m,zXe=new m;ki.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,BXe),r=$.getColumn(i,1,YXe),s=$.getColumn(i,2,zXe);return m.clone(n,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],o,t[1]),m.subtract(t[1],r,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],o,t[2]),m.add(t[2],r,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],o,t[3]),m.add(t[3],r,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],o,t[4]),m.subtract(t[4],r,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],o,t[5]),m.subtract(t[5],r,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],o,t[6]),m.add(t[6],r,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],o,t[7]),m.add(t[7],r,t[7]),m.add(t[7],s,t[7]),t};var HXe=new $;ki.computeTransformation=function(e,t){l(t)||(t=new F);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,HXe);return F.fromRotationTranslation(i,n,t)};var KXe=new de;ki.isOccluded=function(e,t){let n=de.fromOrientedBoundingBox(e,KXe);return!t.isBoundingSphereVisible(n)};ki.prototype.intersectPlane=function(e){return ki.intersectPlane(this,e)};ki.prototype.distanceSquaredTo=function(e){return ki.distanceSquaredTo(this,e)};ki.prototype.computePlaneDistances=function(e,t,n){return ki.computePlaneDistances(this,e,t,n)};ki.prototype.computeCorners=function(e){return ki.computeCorners(this,e)};ki.prototype.computeTransformation=function(e){return ki.computeTransformation(this,e)};ki.prototype.isOccluded=function(e){return ki.isOccluded(this,e)};ki.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};ki.prototype.clone=function(e){return ki.clone(this,e)};ki.prototype.equals=function(e){return ki.equals(this,e)};var Xn=ki;var CYt=_(T(),1);var dYt=_(T(),1);var l5={};l5.getHeight=function(e,t,n){return(e-n)*t+n};var JXe=new he;l5.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,JXe);if(!l(r))return m.clone(e,o);let s=l5.getHeight(r.height,n,i);return m.fromRadians(r.longitude,r.latitude,s,t,o)};var Zr=l5;var mYt=_(T(),1),QXe={NONE:0,BITS12:1},Hs=Object.freeze(QXe);var Zx=new m,jXe=new m,Su=new U,d5=new F,qXe=new F,$Xe=Math.pow(2,12);function cc(e,t,n,i,o,r,s,a,c,d){let u=Hs.NONE,h,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,f=t.maximum,y=m.subtract(f,g,jXe),x=i-n;Math.max(m.maximumComponent(y),x)<$Xe-1?u=Hs.BITS12:u=Hs.NONE,h=F.inverseTransformation(o,new F);let C=m.negate(g,Zx);F.multiply(F.fromTranslation(C,d5),h,h);let V=Zx;V.x=1/y.x,V.y=1/y.y,V.z=1/y.z,F.multiply(F.fromScale(V,d5),h,h),p=F.clone(o),F.setTranslation(p,m.ZERO,p),o=F.clone(o,new F);let L=F.fromTranslation(g,d5),Z=F.fromScale(y,qXe),E=F.multiply(L,Z,d5);F.multiply(o,E,o),F.multiply(p,E,p)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=m.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=d??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}cc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,d=i.y;if(this.quantization===Hs.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,Zx),n.x=X.clamp(n.x,0,1),n.y=X.clamp(n.y,0,1),n.z=X.clamp(n.z,0,1);let u=this.maximumHeight-this.minimumHeight,h=X.clamp((o-this.minimumHeight)/u,0,1);U.fromElements(n.x,n.y,Su);let p=Fn.compressTextureCoordinates(Su);U.fromElements(n.z,h,Su);let g=Fn.compressTextureCoordinates(Su);U.fromElements(c,d,Su);let f=Fn.compressTextureCoordinates(Su);if(e[t++]=p,e[t++]=g,e[t++]=f,this.hasWebMercatorT){U.fromElements(s,0,Su);let y=Fn.compressTextureCoordinates(Su);e[t++]=y}}else m.subtract(n,this.center,Zx),e[t++]=Zx.x,e[t++]=Zx.y,e[t++]=Zx.z,e[t++]=o,e[t++]=c,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Fn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var eWe=new m,One=new m;cc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let u=0;u<i;u++){let h=s*i+u,p=s*r+u;t[p]=e[h]}let a=this.decodePosition(t,s,eWe),c=n.geodeticSurfaceNormal(a,One),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};cc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};cc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new m),t*=this.stride,this.quantization===Hs.BITS12){let i=Fn.decompressTextureCoordinates(e[t],Su);n.x=i.x,n.y=i.y;let o=Fn.decompressTextureCoordinates(e[t+1],Su);return n.z=o.x,F.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],m.add(n,this.center,n)};cc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,One),a=this.decodeHeight(e,t),c=Zr.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};cc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===Hs.BITS12?Fn.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};cc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Hs.BITS12?Fn.decompressTextureCoordinates(e[t+1],Su).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};cc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Hs.BITS12?Fn.decompressTextureCoordinates(e[t+3],Su).x:e[t+6]};cc.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 U.fromElements(o,r,n)};cc.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};cc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Hs.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var u5={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},m5={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};cc.prototype.getAttributes=function(e){let t=Q.FLOAT,n=Q.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===Hs.NONE){s(u5.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(u5.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(u5.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(m5.compressed0,a?4:3),c&&s(m5.compressed1,1),this.hasGeodeticSurfaceNormals&&s(m5.geodeticSurfaceNormal,3)}return r};cc.prototype.getAttributeLocations=function(){return this.quantization===Hs.NONE?u5:m5};cc.clone=function(e,t){if(l(e))return l(t)||(t=new cc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=m.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var lc=cc;var IYt=_(T(),1);function El(e){this._ellipsoid=e??ne.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(El.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});El.mercatorAngleToGeodeticLatitude=function(e){return X.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};El.geodeticLatitudeToMercatorAngle=function(e){e>El.MaximumLatitude?e=El.MaximumLatitude:e<-El.MaximumLatitude&&(e=-El.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};El.MaximumLatitude=El.mercatorAngleToGeodeticLatitude(Math.PI);El.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=El.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};El.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=El.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Pi=El;var mf={};mf.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var zY=new m,tWe=new F,nWe=new m,iWe=new m;mf.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=X.PI_OVER_TWO,a=X.toRadians,c=e.heightmap,d=e.width,u=e.height,h=e.skirtHeight,p=h>0,g=e.isGeographic??!0,f=e.ellipsoid??ne.default,y=1/f.maximumRadius,x=le.clone(e.nativeRectangle),S=le.clone(e.rectangle),C,V,L,Z;l(S)?(C=S.west,V=S.south,L=S.east,Z=S.north):g?(C=a(x.west),V=a(x.south),L=a(x.east),Z=a(x.north)):(C=x.west*y,V=s-2*o(r(-x.south*y)),L=x.east*y,Z=s-2*o(r(-x.north*y)));let E=e.relativeToCenter,P=l(E);E=P?E:m.ZERO;let W=e.includeWebMercatorT??!1,v=e.exaggeration??1,A=e.exaggerationRelativeHeight??0,R=v!==1,G=e.structure??mf.DEFAULT_STRUCTURE,I=G.heightScale??mf.DEFAULT_STRUCTURE.heightScale,w=G.heightOffset??mf.DEFAULT_STRUCTURE.heightOffset,M=G.elementsPerHeight??mf.DEFAULT_STRUCTURE.elementsPerHeight,O=G.stride??mf.DEFAULT_STRUCTURE.stride,k=G.elementMultiplier??mf.DEFAULT_STRUCTURE.elementMultiplier,B=G.isBigEndian??mf.DEFAULT_STRUCTURE.isBigEndian,N=le.computeWidth(x),z=le.computeHeight(x),K=N/(d-1),te=z/(u-1);g||(N*=y,z*=y);let H=f.radiiSquared,j=H.x,ee=H.y,pe=H.z,_e=65536,ae=-65536,ye=Ft.eastNorthUpToFixedFrame(E,f),Se=F.inverseTransformation(ye,tWe),Ee,Ie;W&&(Ee=Pi.geodeticLatitudeToMercatorAngle(V),Ie=1/(Pi.geodeticLatitudeToMercatorAngle(Z)-Ee));let Fe=nWe;Fe.x=Number.POSITIVE_INFINITY,Fe.y=Number.POSITIVE_INFINITY,Fe.z=Number.POSITIVE_INFINITY;let ve=iWe;ve.x=Number.NEGATIVE_INFINITY,ve.y=Number.NEGATIVE_INFINITY,ve.z=Number.NEGATIVE_INFINITY;let ct=Number.POSITIVE_INFINITY,Je=d*u,bt=h>0?d*2+u*2:0,Qe=Je+bt,Tt=new Array(Qe),ft=new Array(Qe),gt=new Array(Qe),En=W?new Array(Qe):[],cn=R?new Array(Qe):[],Ce=0,Le=u,St=0,mn=d;p&&(--Ce,++Le,--St,++mn);let to=1e-5;for(let qe=Ce;qe<Le;++qe){let lt=qe;lt<0&&(lt=0),lt>=u&&(lt=u-1);let Bt=x.north-te*lt;g?Bt=a(Bt):Bt=s-2*o(r(-Bt*y));let xn=(Bt-V)/(Z-V);xn=X.clamp(xn,0,1);let no=qe===Ce,zi=qe===Le-1;h>0&&(no?Bt+=to*z:zi&&(Bt-=to*z));let ms=t(Bt),lr=n(Bt),Gi=pe*lr,Ei;W&&(Ei=(Pi.geodeticLatitudeToMercatorAngle(Bt)-Ee)*Ie);for(let ha=St;ha<mn;++ha){let jr=ha;jr<0&&(jr=0),jr>=d&&(jr=d-1);let Tl=lt*(d*O)+jr*O,Xo;if(M===1)Xo=c[Tl];else{Xo=0;let $a;if(B)for($a=0;$a<M;++$a)Xo=Xo*k+c[Tl+$a];else for($a=M-1;$a>=0;--$a)Xo=Xo*k+c[Tl+$a]}Xo=Xo*I+w,ae=Math.max(ae,Xo),_e=Math.min(_e,Xo);let xr=x.west+K*jr;g?xr=a(xr):xr=xr*y;let Tm=(xr-C)/(L-C);Tm=X.clamp(Tm,0,1);let _r=lt*d+jr;if(h>0){let $a=ha===St,$t=ha===mn-1,Ve=no||zi||$a||$t;if((no||zi)&&($a||$t))continue;Ve&&(Xo-=h,$a?(_r=Je+(u-lt-1),xr-=to*N):zi?_r=Je+u+(d-jr-1):$t?(_r=Je+u+d+lt,xr+=to*N):no&&(_r=Je+u+d+u+jr))}let du=ms*t(xr),Kh=ms*n(xr),hp=j*du,Jh=ee*Kh,qa=1/i(hp*du+Jh*Kh+Gi*lr),I0=hp*qa,kS=Jh*qa,X0=Gi*qa,Ds=new m;Ds.x=I0+du*Xo,Ds.y=kS+Kh*Xo,Ds.z=X0+lr*Xo,F.multiplyByPoint(Se,Ds,zY),m.minimumByComponent(zY,Fe,Fe),m.maximumByComponent(zY,ve,ve),ct=Math.min(ct,Xo),Tt[_r]=Ds,gt[_r]=new U(Tm,xn),ft[_r]=Xo,W&&(En[_r]=Ei),R&&(cn[_r]=f.geodeticSurfaceNormal(Ds))}}let He=de.fromPoints(Tt),yr;l(S)&&(yr=Xn.fromRectangle(S,_e,ae,f));let cr;P&&(cr=new Ip(f).computeHorizonCullingPointPossiblyUnderEllipsoid(E,Tt,_e));let ma=new z0(Fe,ve,E),Me=new lc(E,ma,ct,ae,ye,!1,W,R,v,A),at=new Float32Array(Qe*Me.stride),et=0;for(let qe=0;qe<Qe;++qe)et=Me.encode(at,et,Tt[qe],gt[qe],ft[qe],void 0,En[qe],cn[qe]);return{vertices:at,maximumHeight:ae,minimumHeight:_e,encoding:Me,boundingSphere3D:He,orientedBoundingBox:yr,occludeePointInScaledSpace:cr}};var uC=mf;var JYt=_(T(),1);function H0(){fe.throwInstantiationError()}Object.defineProperties(H0.prototype,{credits:{get:fe.throwInstantiationError},waterMask:{get:fe.throwInstantiationError}});H0.prototype.interpolateHeight=fe.throwInstantiationError;H0.prototype.isChildAvailable=fe.throwInstantiationError;H0.prototype.createMesh=fe.throwInstantiationError;H0.prototype.upsample=fe.throwInstantiationError;H0.prototype.wasCreatedByUpsampling=fe.throwInstantiationError;H0.maximumAsynchronousTasks=5;var Wm=H0;var jYt=_(T(),1);function oWe(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,y){this.center=e,this.vertices=t,this.stride=d??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=u,this.encoding=h,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=f,this.northIndicesWestToEast=y}var Cu=oWe;var izt=_(T(),1);function Yc(){fe.throwInstantiationError()}Object.defineProperties(Yc.prototype,{errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},hasWaterMask:{get:fe.throwInstantiationError},hasVertexNormals:{get:fe.throwInstantiationError},availability:{get:fe.throwInstantiationError}});var Bne=[];Yc.getRegularGridIndices=function(e,t){let n=Bne[e];l(n)||(Bne[e]=n=[]);let i=n[t];return l(i)||(e*t<X.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),Kne(e,t,i,0)),i};var Yne=[];Yc.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Yne[e];l(n)||(Yne[e]=n=[]);let i=n[t];if(!l(i)){let o=Yc.getRegularGridIndices(e,t),r=Hne(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,d=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return i};var zne=[];Yc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=zne[e];l(n)||(zne[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,d=r+a,u=Hne(e,t),h=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,g=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,y=Ne.createTypedArray(c,d);Kne(e,t,y,0),Yc.addSkirtIndices(h,p,g,f,o,y,r),i=n[t]={indices:y,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:f,indexCountWithoutSkirts:r}}return i};Yc.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=h5(e,a,r,s),a+=e.length,s=h5(t,a,r,s),a+=t.length,s=h5(n,a,r,s),a+=n.length,h5(i,a,r,s)};function Hne(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function Kne(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,d=c+1,u=a+1;n[i++]=a,n[i++]=c,n[i++]=u,n[i++]=u,n[i++]=c,n[i++]=d,++o}++o}}function h5(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}Yc.heightmapTerrainQuality=.25;Yc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Yc.heightmapTerrainQuality/(t*n)};Yc.prototype.requestTileGeometry=fe.throwInstantiationError;Yc.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Yc.prototype.getTileDataAvailable=fe.throwInstantiationError;Yc.prototype.loadTileDataAvailability=fe.throwInstantiationError;var es=Yc;function Xp(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??Tu.NONE;let t=uC.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===Tu.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(Xp.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var Jne="createVerticesFromHeightmap",rWe=new yi(Jne),sWe=new yi(Jne,Wm.maximumAsynchronousTasks);Xp.prototype.createMesh=function(e){e=e??Y.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),h=c.cartographicToCartesian(le.center(u)),p=this._structure,f=es.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(f*4,1e3);let x=(a?sWe:rWe).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:u,relativeToCenter:h,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ii,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(x))return;let S=this;return Promise.resolve(x).then(function(C){let V;S._skirtHeight>0?V=es.getRegularGridAndSkirtIndicesAndEdgeIndices(C.gridWidth,C.gridHeight):V=es.getRegularGridIndicesAndEdgeIndices(C.gridWidth,C.gridHeight);let L=C.gridWidth*C.gridHeight;return S._mesh=new Cu(h,new Float32Array(C.vertices),V.indices,V.indexCountWithoutSkirts,L,C.minimumHeight,C.maximumHeight,de.clone(C.boundingSphere3D),m.clone(C.occludeePointInScaledSpace),C.numberOfAttributes,Xn.clone(C.orientedBoundingBox),lc.clone(C.encoding),V.westIndicesSouthToNorth,V.southIndicesEastToWest,V.eastIndicesNorthToSouth,V.northIndicesWestToEast),S._buffer=void 0,S._mesh})};Xp.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(le.center(d)),h=this._structure,g=es.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let f=uC.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:d,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ii,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=es.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=es.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let x=f.gridWidth*f.gridHeight;return this._mesh=new Cu(u,f.vertices,y.indices,y.indexCountWithoutSkirts,x,f.minimumHeight,f.maximumHeight,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};Xp.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,h=r.heightScale,p=l(this._mesh),g=this._encoding===Tu.LERC;if(!p&&g)return;let y;if(p){let x=this._mesh.vertices,S=this._mesh.encoding;y=Qne(x,S,u,h,e,i,o,t,n)}else y=aWe(this._buffer,a,c,s,d,e,i,o,t,n),y=y*h+u;return y};Xp.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,d=this._height,u=this._structure,h=u.stride,p=new this._bufferType(c*d*h),g=a.vertices,f=a.encoding,y=e.tileXYToRectangle(t,n,i),x=e.tileXYToRectangle(o,r,s),S=u.heightOffset,C=u.heightScale,V=u.elementsPerHeight,L=u.elementMultiplier,Z=u.isBigEndian,E=Math.pow(L,V-1);for(let P=0;P<d;++P){let W=X.lerp(x.north,x.south,P/(d-1));for(let v=0;v<c;++v){let A=X.lerp(x.west,x.east,v/(c-1)),b=Qne(g,f,S,C,y,c,d,A,W);b=b<u.lowestEncodedHeight?u.lowestEncodedHeight:b,b=b>u.highestEncodedHeight?u.highestEncodedHeight:b,cWe(p,V,L,E,h,Z,P*c+v,b)}}return Promise.resolve(new Xp({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};Xp.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};Xp.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function aWe(e,t,n,i,o,r,s,a,c,d){let u=(c-r.west)*(s-1)/(r.east-r.west),h=(d-r.south)*(a-1)/(r.north-r.south),p=u|0,g=p+1;g>=s&&(g=s-1,p=s-2);let f=h|0,y=f+1;y>=a&&(y=a-1,f=a-2);let x=u-p,S=h-f;f=a-1-f,y=a-1-y;let C=f5(e,t,n,i,o,f*s+p),V=f5(e,t,n,i,o,f*s+g),L=f5(e,t,n,i,o,y*s+p),Z=f5(e,t,n,i,o,y*s+g);return jne(x,S,C,V,L,Z)}function Qne(e,t,n,i,o,r,s,a,c){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(c-o.south)*(s-1)/(o.north-o.south),h=d|0,p=h+1;p>=r&&(p=r-1,h=r-2);let g=u|0,f=g+1;f>=s&&(f=s-1,g=s-2);let y=d-h,x=u-g;g=s-1-g,f=s-1-f;let S=(t.decodeHeight(e,g*r+h)-n)/i,C=(t.decodeHeight(e,g*r+p)-n)/i,V=(t.decodeHeight(e,f*r+h)-n)/i,L=(t.decodeHeight(e,f*r+p)-n)/i;return jne(y,x,S,C,V,L)}function jne(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function f5(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function cWe(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Fa=Xp;var Rzt=_(T(),1);function fC(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Gx=new le;function lWe(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}fC.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)lWe(e,g,p,s)||s.push(new mC(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,Gx);let a=Gx.west,c=Gx.north;r.tileXYToRectangle(i,o,e,Gx);let d=Gx.east,u=Gx.south,h=new fWe(e,a,u,d,c);for(let p=0;p<s.length;++p){let g=s[p];HY(g.extent,h)&&pWe(this._maximumLevel,g,h)}};fC.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(hC(i.extent,e)){t=i;break}}return l(t)?VE(void 0,t,e):-1};var dWe=[],uWe=[],mWe=new le,hWe=new le;fC.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=dWe;t.length=0,e.east<e.west?(t.push(le.fromRadians(-Math.PI,e.south,e.east,e.north,mWe)),t.push(le.fromRadians(e.west,e.south,Math.PI,e.north,hWe))):t.push(e);let n=uWe;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)LE(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 qne=new he;fC.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Gx);return le.center(i,qne),this.computeMaximumLevelAtPosition(qne)>=e};fC.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 mC(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(mC.prototype,{nw:{get:function(){return this._nw||(this._nw=new mC(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new mC(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new mC(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new mC(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function fWe(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function HY(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 pWe(e,t,n){for(;t.level<e;)if(p5(t.nw.extent,n))t=t.nw;else if(p5(t.ne.extent,n))t=t.ne;else if(p5(t.sw.extent,n))t=t.sw;else if(p5(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Wo(t.rectangles,n.level,bWe);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function bWe(e,t){return e.level-t}function p5(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function hC(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function VE(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&hC(t._nw.extent,n),s=t._ne&&hC(t._ne.extent,n),a=t._sw&&hC(t._sw.extent,n),c=t._se&&hC(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,VE(t,t._nw,n))),s&&(i=Math.max(i,VE(t,t._ne,n))),a&&(i=Math.max(i,VE(t,t._sw,n))),c&&(i=Math.max(i,VE(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];hC(a,n)&&(i=a.level)}t=t.parent}return i}function LE(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||HY(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=gWe(e[s.level],s)}LE(e,t._nw,n),LE(e,t._ne,n),LE(e,t._sw,n),LE(e,t._se,n)}function gWe(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];HY(o,t)?(o.west<t.west&&n.push(new le(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new le(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new le(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new le(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Pm=fC;var Pzt=_(T(),1);var Ezt=_(T(),1);function yWe(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 hf=yWe;function b5(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=r??0,this.retry=!1,this.error=s}b5.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new b5(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${hf(i)}`),c};b5.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Lo=b5;var Uzt=_(T(),1);function K0(e){if(e=e??Y.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ne.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new Pi(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 U(-i,-i),this._rectangleNortheastInMeters=new U(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new le(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(K0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});K0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};K0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};K0.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(le.southwest(e)),o=n.project(le.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new le(i.x,i.y,o.x,o.y)};K0.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,u=this._rectangleNortheastInMeters.y-t*d,h=this._rectangleNortheastInMeters.y-(t+1)*d;return l(i)?(i.west=a,i.south=h,i.east=c,i.north=u,i):new le(a,h,c,u)};K0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new U(o.west,o.south)),a=r.unproject(new U(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};K0.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!le.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-h.y,f=p/a|0;f>=o&&(f=o-1);let y=g/d|0;return y>=r&&(y=r-1),l(n)?(n.x=f,n.y=y,n):new U(f,y)};var ts=K0;var xWe=15;function $ne(e){this.ellipsoid=e.ellipsoid??ne.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}$ne.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 _We(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Gt(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=le.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Ki(s);else if(o===3857){let d=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>d&&(t.extent.xmax=d),t.extent.ymax>d&&(t.extent.ymax=d),t.extent.xmin<-d&&(t.extent.xmin=-d),t.extent.ymin<-d&&(t.extent.ymin=-d),s.rectangleSouthwestInMeters=new U(r.xmin,r.ymin),s.rectangleNortheastInMeters=new U(r.xmax,r.ymax),e.tilingScheme=new ts(s)}else throw new ce("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new ce("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Tu.LERC:Tu.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Pm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Pm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=es.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 TWe(e,t,n){try{let i=await t.fetchJson();_We(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Lo.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function J0(e){e=e??Y.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 be}Object.defineProperties(J0.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}}});J0.fromUrl=async function(e,t){t=t??Y.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Re.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new $ne(t);await TWe(o,i);let r=new J0(t);return o.build(r),r._resource=n,r};J0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(KY(this,n+1,e*2,t*2))){let h=eie(this,n+1,e*2,t*2);s=h.promise,a=h.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let d=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(h){return new Fa({buffer:h[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):xWe,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(h){if(l(a)&&a.state===$n.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=$n.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function KY(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}J0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};J0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=KY(this,n,e,t);if(l(i))return i;eie(this,n,e,t)};J0.prototype.loadTileDataAvailability=function(e,t,n){};function SWe(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},d=new U(e.x+1,e.y+1),u=!1,h=!1;for(;!(u&&h);){let p=d.x,g=h?d.y+1:d.y;if(!u){for(let f=e.y;f<g;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new U(d.x,e.y)),--d.x,--p,c.endX=d.x):d.x===o?(c.endX=d.x,u=!0):++d.x}if(!h){let f=d.y*t;for(let y=e.x;y<=p;++y)if(i[f+y]!==s){h=!0;break}h?(a.push(new U(e.x,d.y)),--d.y,c.endY=d.y):d.y===r?(c.endY=d.y,h=!0):++d.y}}return{endingIndices:a,range:c,value:s}}function CWe(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new U(0,0)];for(;a.length>0;){let c=a.pop(),d=SWe(c,n,i,o);if(d.value===1){let h=d.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function eie(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let d=new Ho({throttle:!1,throttleByServer:!0,type:hs.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(h)?(h=h.then(function(p){let g=CWe(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let y=0;y<g.length;++y){let x=g[y];f.addAvailableTileRange(t,x.startX,x.startY,x.endX,x.endY)}return KY(e,t,n,i)}),c[a]={promise:h,request:d},h=h.finally(function(p){return delete c[a],p}),{promise:h,request:d}):{}}var JY=J0;var dHt=_(T(),1),VWe={NONE:0,GEODESIC:1,RHUMB:2},on=Object.freeze(VWe);var fHt=_(T(),1);var tie=X.EPSILON10;function LWe(e,t,n,i){if(!l(e))return;n=n??!1;let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,d,u=0,h=-1;for(s=1;s<r;++s)c=e[s],t(a,c,tie)?(l(d)||(d=e.slice(0,s),u=s-1,h=0),o&&i.push(s)):(l(d)&&(d.push(c),u=s,o&&(h=i.length)),a=c);return n&&t(e[0],e[r-1],tie)&&(o&&(l(d)?i.splice(h,0,u):i.push(r-1)),l(d)?d.length-=1:d=e.slice(0,-1)),l(d)?d:e}var Co=LWe;var bHt=_(T(),1),RWe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},dc=Object.freeze(RWe);var xHt=_(T(),1);function Ex(){this._array=[],this._hash={}}Object.defineProperties(Ex.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Ex.prototype.contains=function(e){return l(this._hash[e])};Ex.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Ex.prototype.get=function(e){return this._hash[e]};Ex.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};Ex.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var It=Ex;var RHt=_(T(),1);var nie="https://dev.virtualearth.net/REST/v1/Locations";function QY(e){e=e??Y.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Re({url:nie,queryParameters:n}),this._credit=new Gt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(QY.prototype,{url:{get:function(){return nie}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});QY.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],d=r[3];return{displayName:o.name,destination:le.fromDegrees(a,s,d,c)}})})};var jY=QY;var MHt=_(T(),1);var ZWe=new m;function ff(e){e=e??Y.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}ff.fromDimensions=function(e){e=e??Y.EMPTY_OBJECT;let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new ff({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};ff.fromAxisAlignedBoundingBox=function(e){return new ff({minimum:e.minimum,maximum:e.maximum})};ff.packedLength=2*m.packedLength+1;ff.pack=function(e,t,n){return n=n??0,m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=e._offsetAttribute??-1,t};var oie=new m,rie=new m,iie={minimum:oie,maximum:rie,offsetAttribute:void 0};ff.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,oie),o=m.unpack(e,t+m.packedLength,rie),r=e[t+m.packedLength*2];return l(n)?(n._min=m.clone(i,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(iie.offsetAttribute=r===-1?void 0:r,new ff(iie))};ff.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new pn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=m.subtract(n,t,ZWe),a=m.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,d=e._offsetAttribute===ln.NONE?0:1,u=new Uint8Array(c/3).fill(d);i.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new ht({attributes:i,indices:o,primitiveType:Ae.LINES,boundingSphere:new de(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var vm=ff;var UHt=_(T(),1);function qY(){}Object.defineProperties(qY.prototype,{credit:{get:function(){}}});qY.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:m.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var $Y=qY;var TKt=_(T(),1);var mKt=_(T(),1);var $Ht=_(T(),1);var HHt=_(T(),1);function pC(){this.times=void 0,this.points=void 0,fe.throwInstantiationError()}pC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof m)return m;if(e instanceof we)return we};pC.prototype.evaluate=fe.throwInstantiationError;pC.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};pC.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};pC.prototype.clampTime=function(e){let t=this.times;return X.clamp(e,t[0],t[t.length-1])};var so=pC;function bC(e){e=e??Y.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(bC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});bC.prototype.findTimeInterval=so.prototype.findTimeInterval;bC.prototype.wrapTime=so.prototype.wrapTime;bC.prototype.clampTime=so.prototype.clampTime;bC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new m),m.lerp(n[o],n[o+1],r,t))};var Q0=bC;var nKt=_(T(),1);var sie={};sie.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new m,s[a]=new m;o[0]=n[0]/t[0],r[0]=m.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=m.subtract(i[a],m.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=m.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=m.subtract(i[a],m.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=m.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=m.subtract(r[a],m.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var gC=sie;var aie=[],cie=[],lie=[],die=[];function GWe(e,t,n){let i=aie,o=lie,r=cie,s=die;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new m),m.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new m),m.subtract(e[a+1],e[a-1],c),m.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new m),m.clone(n,c),gC.solve(i,r,o,s)}function EWe(e){let t=aie,n=lie,i=cie,o=die;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new m),m.subtract(e[1],e[0],s),m.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new m),m.subtract(e[r+1],e[r-1],s),m.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new m),m.subtract(e[r],e[r-1],s),m.multiplyByScalar(s,3,s),gC.solve(t,i,n,o)}function Il(e){e=e??Y.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(Il.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}}});Il.createC1=function(e){e=e??Y.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 Il({times:t,points:n,inTangents:r,outTangents:o})};Il.createNaturalCubic=function(e){e=e??Y.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new Q0({points:n,times:t});let i=EWe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Il({times:t,points:n,inTangents:r,outTangents:o})};Il.createClampedCubic=function(e){e=e??Y.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 Q0({points:n,times:t});let s=GWe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Il({times:t,points:n,inTangents:c,outTangents:a})};Il.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Il.prototype.findTimeInterval=so.prototype.findTimeInterval;var IWe=new re,yC=new m;Il.prototype.wrapTime=so.prototype.wrapTime;Il.prototype.clampTime=so.prototype.clampTime;Il.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,d=IWe;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;let u=F.multiplyByVector(Il.hermiteCoefficientMatrix,d,d);u.z*=a,u.w*=a;let h=this._pointType;return h===Number?n[s]*u.x+n[s+1]*u.y+r[s]*u.z+o[s]*u.w:(l(t)||(t=new h),t=h.multiplyByScalar(n[s],u.x,t),h.multiplyByScalar(n[s+1],u.y,yC),h.add(t,yC,t),h.multiplyByScalar(r[s],u.z,yC),h.add(t,yC,t),h.multiplyByScalar(o[s],u.w,yC),h.add(t,yC,t))};var j0=Il;var XWe=new re,uie=new m,xC=new m;function WWe(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new m);let d=(a-i)*o;return m.lerp(r,s,d,c)}}return function(i,o){l(o)||(o=new m);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=XWe;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,d,u,h,p;return r===0?(c=t[0],d=t[1],u=e.firstTangent,h=m.subtract(t[2],c,uie),m.multiplyByScalar(h,.5,h),p=F.multiplyByVector(j0.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],h=e.lastTangent,u=m.subtract(d,t[r-1],uie),m.multiplyByScalar(u,.5,u),p=F.multiplyByVector(j0.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],h=t[r+2],p=F.multiplyByVector(q0.catmullRomCoefficientMatrix,a,a)),o=m.multiplyByScalar(c,p.x,o),m.multiplyByScalar(d,p.y,xC),m.add(o,xC,o),m.multiplyByScalar(u,p.z,xC),m.add(o,xC,o),m.multiplyByScalar(h,p.w,xC),m.add(o,xC,o)}}var PWe=new m,vWe=new m;function q0(e){e=e??Y.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=PWe,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=vWe,m.multiplyByScalar(t[r-1],2,o),m.subtract(t[r],o,o),m.add(o,t[r-2],o),m.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(o),this._evaluateFunction=WWe(this),this._lastTimeIndex=0}Object.defineProperties(q0.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}}});q0.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);q0.prototype.findTimeInterval=so.prototype.findTimeInterval;q0.prototype.wrapTime=so.prototype.wrapTime;q0.prototype.clampTime=so.prototype.clampTime;q0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var ez=q0;var XJt=_(T(),1);var ZKt=_(T(),1);var VKt=_(T(),1);function $0(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),$0.decode(e)}$0.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};$0.decodeWithFromCharCode=function(e){let t="",n=wWe(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 RE(e,t,n){return t<=e&&e<=n}function wWe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let d=e[c];if(i===0){if(RE(d,0,127)){s.push(d);continue}if(RE(d,194,223)){i=1,t=d&31;continue}if(RE(d,224,239)){d===224&&(o=160),d===237&&(r=159),i=2,t=d&15;continue}if(RE(d,240,244)){d===240&&(o=144),d===244&&(r=143),i=3,t=d&7;continue}throw new ce("String decoding failed.")}if(!RE(d,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|d&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?$0.decode=$0.decodeWithTextDecoder:$0.decode=$0.decodeWithFromCharCode;var Xl=$0;function FWe(e,t,n){return JSON.parse(Xl(e,t,n))}var Qo=FWe;var kKt=_(T(),1),nz=_(cd(),1);var WKt=_(T(),1);var tz,mie="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyNTM5MmUwMy0zM2M2LTQxODAtODA0Yy0xNzg4MTZlYzc1ZmUiLCJpZCI6MjU5LCJpYXQiOjE3NDM1MjIzOTN9.nRQlDkn6eRcBJ_SbJNFii4uikmlbeHZgqzQNiyah2EY",g5={};g5.defaultAccessToken=mie;g5.defaultServer=new Re({url:"https://api.cesium.com/"});g5.getDefaultTokenCredit=function(e){if(e===mie){if(!l(tz)){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>`;tz=new Gt(t,!0)}return tz}};var wm=g5;function zc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:AWe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ce("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Re.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new nz.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(zc.prototype=Object.create(Re.prototype),zc.prototype.constructor=zc);zc.fromAssetId=function(e,t){let n=zc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new zc(i,n)})};Object.defineProperties(zc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=zc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});zc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Gt.getIonCredit),i=wm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Gt.clone(i)),n};zc.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=new zc(t._ionEndpoint,t._ionEndpointResource)),e=Re.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};zc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Re.prototype.fetchImage.call(this,e)};zc.prototype._makeRequest=function(e){return this._isExternal||new nz.default(this.url).authority()!==this._ionEndpointDomain?Re.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Re.prototype._makeRequest.call(this,e))};zc._createEndpointResource=function(e,t){t=t??Y.EMPTY_OBJECT;let n=t.server??wm.defaultServer,i=t.accessToken??wm.defaultAccessToken;n=Re.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function AWe(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){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var hd=zc;var sJt=_(T(),1);var YKt=_(T(),1);var y5={};y5.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let d=s+a+c,u,h,p,g,f,y;return d===1?s?(u=(e-n)/(i-n),h=(e-n)/(o-n),r.push(1),r.push(2),h!==1&&(r.push(-1),r.push(0),r.push(2),r.push(h)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),y=(e-o)/(i-o),r.push(0),r.push(1),y!==1&&(r.push(-1),r.push(2),r.push(1),r.push(y)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):d===2?!s&&n!==e?(g=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(y=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(y),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(h=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(h),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};y5.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,h=r-a,p=i-a,g=1/(h*d+u*p),f=t-a,y=e-s,x=(h*y+u*f)*g,S=(-p*y+d*f)*g,C=1-x-S;return l(c)?(c.x=x,c.y=S,c.z=C,c):new m(x,S,C)};y5.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=d/h,g=u/h;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new U),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Wp=y5;function eg(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=_5(e.westIndices,o,t),this._southIndices=_5(e.southIndices,r,t),this._eastIndices=_5(e.eastIndices,o,t),this._northIndices=_5(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(eg.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 x5=[];function _5(e,t,n){x5.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)x5[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(x5.sort(t),Ne.createTypedArray(n,x5)):e}var hie="createVerticesFromQuantizedTerrainMesh",MWe=new yi(hie),NWe=new yi(hie,Wm.maximumAsynchronousTasks);eg.prototype.createMesh=function(e){e=e??Y.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),h=(a?NWe:MWe).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:d,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(h))return;let p=this;return Promise.resolve(h).then(function(g){let f=p._quantizedVertices.length/3,y=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,x=Ne.createTypedArray(y,g.indices),S=new Float32Array(g.vertices),C=g.center,V=g.minimumHeight,L=g.maximumHeight,Z=p._boundingSphere,E=p._orientedBoundingBox,P=m.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,W=g.vertexStride,v=lc.clone(g.encoding);return p._mesh=new Cu(C,S,x,g.indexCountWithoutSkirts,f,V,L,Z,P,W,E,v,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var kWe=new yi("upsampleQuantizedTerrainMesh",Wm.maximumAsynchronousTasks);eg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=kWe.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:h,ellipsoid:u});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let f=c?g*.5:this._westSkirtHeight,y=d?g*.5:this._southSkirtHeight,x=c?this._eastSkirtHeight:g*.5,S=d?this._northSkirtHeight:g*.5,C=this._credits;return Promise.resolve(p).then(function(V){let L=new Uint16Array(V.vertices),Z=Ne.createTypedArray(L.length/3,V.indices),E;return l(V.encodedNormals)&&(E=new Uint8Array(V.encodedNormals)),new eg({quantizedVertices:L,indices:Z,encodedNormals:E,minimumHeight:V.minimumHeight,maximumHeight:V.maximumHeight,boundingSphere:de.clone(V.boundingSphere),orientedBoundingBox:Xn.clone(V.orientedBoundingBox),horizonOcclusionPoint:m.clone(V.horizonOcclusionPoint),westIndices:V.westIndices,southIndices:V.southIndices,eastIndices:V.eastIndices,northIndices:V.northIndices,westSkirtHeight:f,southSkirtHeight:y,eastSkirtHeight:x,northSkirtHeight:S,childTileMask:0,credits:C,createdByUpsampling:!0})})};var iz=32767,fie=new m;eg.prototype.interpolateHeight=function(e,t,n){let i=X.clamp((t-e.west)/e.width,0,1);i*=iz;let o=X.clamp((n-e.south)/e.height,0,1);return o*=iz,l(this._mesh)?BWe(this,i,o):YWe(this,i,o)};function pie(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),h=Math.max(i,r,a);return e>=c&&e<=d&&t>=u&&t<=h}var UWe=new U,DWe=new U,OWe=new U;function BWe(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,d,UWe),g=r.decodeTextureCoordinates(o,u,DWe),f=r.decodeTextureCoordinates(o,h,OWe);if(pie(t,n,p.x,p.y,g.x,g.y,f.x,f.y)){let y=Wp.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,fie);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let x=r.decodeHeight(o,d),S=r.decodeHeight(o,u),C=r.decodeHeight(o,h);return y.x*x+y.y*S+y.z*C}}}}function YWe(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=i[d],g=i[u],f=i[h],y=o[d],x=o[u],S=o[h];if(pie(t,n,p,y,g,x,f,S)){let C=Wp.computeBarycentricCoordinates(t,n,p,y,g,x,f,S,fie);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){let V=C.x*r[d]+C.y*r[u]+C.z*r[h];return X.lerp(e._minimumHeight,e._maximumHeight,V/iz)}}}}eg.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};eg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Ix=eg;function zWe(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 gie(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ne.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=[]}gie.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 yie(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Lo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ce(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=Lo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ce(y)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Lo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ce(y)}let c=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new ts({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Lo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ce(y)}if(e.levelZeroMaximumGeometricError=es.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Lo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ce(y)}let u;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(h)){g=new Pm(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let x=p[y],S=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let C=0;C<x.length;++C){let V=x[C],L=S-V.endY-1,Z=S-V.startY-1;e.overallAvailability[y].push([V.startX,L,V.endX,Z]),g.addAvailableTileRange(y,V.startX,L,V.endX,Z)}}}else l(h)&&(u=new Pm(e.tilingScheme,d),g=new Pm(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new zWe({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await sz(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function HWe(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
|
|
|
${t.message}`),e.previousError=Lo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return sz(e,n);throw new ce(i)}async function KWe(e,t,n){await yie(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Pm(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Gt(e.attribution);e.tileCredits.push(o)}return!0}async function sz(e,t){try{let n=await e.layerJsonResource.fetchJson();return KWe(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await yie(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):HWe(e,n,t)}}function Fm(e){e=e??Y.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 be;let t=e.credit;typeof t=="string"&&(t=new Gt(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 oz={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function bie(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 JWe(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Fa({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 QWe(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,d=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,h=Float64Array.BYTES_PER_ELEMENT*d,g=Uint16Array.BYTES_PER_ELEMENT*3,f=3,y=Uint16Array.BYTES_PER_ELEMENT,x=y*f,S=new DataView(t),C=new m(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let V=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let L=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let Z=new de(new m(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0)),S.getFloat64(a+u,!0));a+=h;let E=new m(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let P=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let W=new Uint16Array(t,a,P*3);a+=P*g,P>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,x=y*f);let v=W.subarray(0,P),A=W.subarray(P,2*P),b=W.subarray(P*2,3*P);Fn.zigZagDeltaDecode(v,A,b),a%y!==0&&(a+=y-a%y);let R=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Ne.createTypedArrayFromArrayBuffer(P,t,a,R*f);a+=R*x;let I=0,w=G.length;for(let ae=0;ae<w;++ae){let ye=G[ae];G[ae]=I-ye,ye===0&&++I}let M=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Ne.createTypedArrayFromArrayBuffer(P,t,a,M);a+=M*y;let k=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let B=Ne.createTypedArrayFromArrayBuffer(P,t,a,k);a+=k*y;let N=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=Ne.createTypedArrayFromArrayBuffer(P,t,a,N);a+=N*y;let K=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Ne.createTypedArrayFromArrayBuffer(P,t,a,K);a+=K*y;let H,j;for(;a<S.byteLength;){let ae=S.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ye=S.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ae===oz.OCT_VERTEX_NORMALS&&e._requestVertexNormals)H=new Uint8Array(t,a,P*2);else if(ae===oz.WATER_MASK&&e._requestWaterMask)j=new Uint8Array(t,a,ye);else if(ae===oz.METADATA&&e._requestMetadata){let Se=S.getUint32(a,!0);if(Se>0){let Ie=Qo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Se).available;if(l(Ie))for(let Fe=0;Fe<Ie.length;++Fe){let ve=n+Fe+1,ct=Ie[Fe],Je=e._tilingScheme.getNumberOfYTilesAtLevel(ve);for(let bt=0;bt<ct.length;++bt){let Qe=ct[bt],Tt=Je-Qe.endY-1,ft=Je-Qe.startY-1;e.availability.addAvailableTileRange(ve,Qe.startX,Tt,Qe.endX,ft),r.availability.addAvailableTileRange(ve,Qe.startX,Tt,Qe.endX,ft)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ye}let ee=e.getLevelMaximumGeometricError(n)*5,pe=e._tilingScheme.tileXYToRectangle(i,o,n),_e=Xn.fromRectangle(pe,V,L,e._tilingScheme.ellipsoid);return new Ix({center:C,minimumHeight:V,maximumHeight:L,boundingSphere:Z,orientedBoundingBox:_e,horizonOcclusionPoint:E,quantizedVertices:W,encodedNormals:H,indices:G,westIndices:O,southIndices:B,eastIndices:z,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:j,credits:e._tileCredits})}Fm.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!l(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let h=az(this,e,t,n,u,d===0);h.result&&(a=!0,c=c.then(()=>h.promise))}return!l(r)&&a?c.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):xie(this,e,t,n,r,i)};function xie(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ce("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let d,u,h=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),d=bie(void 0)):d=bie(c);let g=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(f){return l(f)?l(e._heightmapStructure)?JWe(e,f,i,t,n):QWe(e,f,i,t,n,o):Promise.reject(new ce("Mesh buffer doesn't exist."))})}Object.defineProperties(Fm.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}}});Fm.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Fm.fromIonAssetId=async function(e,t){let n=await hd.fromAssetId(e);return Fm.fromUrl(n,t)};Fm.fromUrl=async function(e,t){t=t??Y.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Re.createIfNeeded(e);n.appendForwardSlash();let i=new gie(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await sz(i);let o=new Fm(t);return i.build(o),o};Fm.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(az(this,e,t,n,i[r],r===0).result)return;return!1};Fm.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=az(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function rz(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function az(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,d=o.availability,u=rz(o,t,n,i);for(;l(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!c.isTileAvailable(u.level,u.x,u.y)){let h;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,h=o.availabilityPromiseCache[s],!l(h))){let p=new Ho({throttle:!1,throttleByServer:!0,type:hs.TERRAIN});h=xie(e,u.x,u.y,u.level,o,p),l(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}u=rz(o,u.x,u.y,u.level)}return{result:!1}}Fm._getAvailabilityTile=rz;var Xx=Fm;var _Qt=_(T(),1);var mQt=_(T(),1);var AJt=_(T(),1);var lz={},T5=new m,_ie=new m,Tie=new we,Sie=new $;function _C(e,t,n,i,o,r,s,a,c,d){let u=e+t;m.multiplyByScalar(i,Math.cos(u),T5),m.multiplyByScalar(n,Math.sin(u),_ie),m.add(T5,_ie,T5);let h=Math.cos(e);h=h*h;let p=Math.sin(e);p=p*p;let f=r/Math.sqrt(s*h+o*p)/a;return we.fromAxisAngle(T5,f,Tie),$.fromQuaternion(Tie,Sie),$.multiplyByVector(Sie,c,d),m.normalize(d,d),m.multiplyByScalar(d,a,d),d}var Cie=new m,Vie=new m,cz=new m,jWe=new m;lz.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,d=n?c:0;for(let u=0;u<c;u+=3){let h=u+1,p=u+2,g=m.fromArray(e,u,Cie);i.scaleToGeodeticSurface(g,g);let f=m.clone(g,Vie),y=i.geodeticSurfaceNormal(g,jWe),x=m.multiplyByScalar(y,o,cz);m.add(g,x,g),n&&(m.multiplyByScalar(y,r,x),m.add(f,x,f),a[u+d]=f.x,a[h+d]=f.y,a[p+d]=f.z),a[u]=g.x,a[h]=g.y,a[p]=g.z}return a};var qWe=new m,$We=new m,ePe=new m;lz.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,d=o*o,u=o*i,h=m.magnitude(s),p=m.normalize(s,qWe),g=m.cross(m.UNIT_Z,s,$We);g=m.normalize(g,g);let f=m.cross(p,g,ePe),y=1+Math.ceil(X.PI_OVER_TWO/a),x=X.PI_OVER_TWO/(y-1),S=X.PI_OVER_TWO-y*x;S<0&&(y-=Math.ceil(Math.abs(S)/x));let C=2*(y*(y+2)),V=t?new Array(C*3):void 0,L=0,Z=Cie,E=Vie,P=y*4*3,W=P-1,v=0,A=n?new Array(P):void 0,b,R,G,I,w;for(S=X.PI_OVER_TWO,Z=_C(S,r,f,g,c,u,d,h,p,Z),t&&(V[L++]=Z.x,V[L++]=Z.y,V[L++]=Z.z),n&&(A[W--]=Z.z,A[W--]=Z.y,A[W--]=Z.x),S=X.PI_OVER_TWO-x,b=1;b<y+1;++b){if(Z=_C(S,r,f,g,c,u,d,h,p,Z),E=_C(Math.PI-S,r,f,g,c,u,d,h,p,E),t){for(V[L++]=Z.x,V[L++]=Z.y,V[L++]=Z.z,G=2*b+2,R=1;R<G-1;++R)I=R/(G-1),w=m.lerp(Z,E,I,cz),V[L++]=w.x,V[L++]=w.y,V[L++]=w.z;V[L++]=E.x,V[L++]=E.y,V[L++]=E.z}n&&(A[W--]=Z.z,A[W--]=Z.y,A[W--]=Z.x,A[v++]=E.x,A[v++]=E.y,A[v++]=E.z),S=X.PI_OVER_TWO-(b+1)*x}for(b=y;b>1;--b){if(S=X.PI_OVER_TWO-(b-1)*x,Z=_C(-S,r,f,g,c,u,d,h,p,Z),E=_C(S+Math.PI,r,f,g,c,u,d,h,p,E),t){for(V[L++]=Z.x,V[L++]=Z.y,V[L++]=Z.z,G=2*(b-1)+2,R=1;R<G-1;++R)I=R/(G-1),w=m.lerp(Z,E,I,cz),V[L++]=w.x,V[L++]=w.y,V[L++]=w.z;V[L++]=E.x,V[L++]=E.y,V[L++]=E.z}n&&(A[W--]=Z.z,A[W--]=Z.y,A[W--]=Z.x,A[v++]=E.x,A[v++]=E.y,A[v++]=E.z)}S=X.PI_OVER_TWO,Z=_C(-S,r,f,g,c,u,d,h,p,Z);let M={};return t&&(V[L++]=Z.x,V[L++]=Z.y,V[L++]=Z.z,M.positions=V,M.numPts=y),n&&(A[W--]=Z.z,A[W--]=Z.y,A[W--]=Z.x,M.outerPositions=A),M};var Wl=lz;var UJt=_(T(),1);function tPe(e){e=e??Y.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Xt=tPe;var TC=new m,dz=new m,uz=new m,Lie=new m,Es=new U,Rie=new $,nPe=new $,mz=new we,Zie=new m,Gie=new m,Eie=new m,V5=new he,Iie=new m,Xie=new U,Wie=new U;function Pie(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,d=n?e.length/3*2:e.length/3,u=t.shadowVolume,h=i.st?new Float32Array(d*2):void 0,p=i.normal?new Float32Array(d*3):void 0,g=i.tangent?new Float32Array(d*3):void 0,f=i.bitangent?new Float32Array(d*3):void 0,y=u?new Float32Array(d*3):void 0,x=0,S=Zie,C=Gie,V=Eie,L=new Ii(a),Z=L.project(a.cartesianToCartographic(o,V5),Iie),E=a.scaleToGeodeticSurface(o,TC);a.geodeticSurfaceNormal(E,E);let P=Rie,W=nPe;if(c!==0){let w=we.fromAxisAngle(E,c,mz);P=$.fromQuaternion(w,P),w=we.fromAxisAngle(E,-c,mz),W=$.fromQuaternion(w,W)}else P=$.clone($.IDENTITY,P),W=$.clone($.IDENTITY,W);let v=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Xie),A=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Wie),b=e.length,R=n?b:0,G=R/3*2;for(let w=0;w<b;w+=3){let M=w+1,O=w+2,k=m.fromArray(e,w,TC);if(i.st){let B=$.multiplyByVector(P,k,dz),N=L.project(a.cartesianToCartographic(B,V5),uz);m.subtract(N,Z,N),Es.x=(N.x+r)/(2*r),Es.y=(N.y+s)/(2*s),v.x=Math.min(Es.x,v.x),v.y=Math.min(Es.y,v.y),A.x=Math.max(Es.x,A.x),A.y=Math.max(Es.y,A.y),n&&(h[x+G]=Es.x,h[x+1+G]=Es.y),h[x++]=Es.x,h[x++]=Es.y}(i.normal||i.tangent||i.bitangent||u)&&(S=a.geodeticSurfaceNormal(k,S),u&&(y[w+R]=-S.x,y[M+R]=-S.y,y[O+R]=-S.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(C=m.normalize(m.cross(m.UNIT_Z,S,C),C),$.multiplyByVector(W,C,C)),i.normal&&(p[w]=S.x,p[M]=S.y,p[O]=S.z,n&&(p[w+R]=-S.x,p[M+R]=-S.y,p[O+R]=-S.z)),i.tangent&&(g[w]=C.x,g[M]=C.y,g[O]=C.z,n&&(g[w+R]=-C.x,g[M+R]=-C.y,g[O+R]=-C.z)),i.bitangent&&(V=m.normalize(m.cross(S,C,V),V),f[w]=V.x,f[M]=V.y,f[O]=V.z,n&&(f[w+R]=V.x,f[M+R]=V.y,f[O+R]=V.z))))}if(i.st){b=h.length;for(let w=0;w<b;w+=2)h[w]=(h[w]-v.x)/(A.x-v.x),h[w+1]=(h[w+1]-v.y)/(A.y-v.y)}let I=new pn;if(i.position){let w=Wl.raisePositionsToHeight(e,t,n);I.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:w})}if(i.st&&(I.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(I.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),u&&(I.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let w=new Uint8Array(d);if(t.offsetAttribute===ln.TOP)w=w.fill(1,0,d/2);else{let M=t.offsetAttribute===ln.NONE?0:1;w=w.fill(M)}I.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:w})}return I}function vie(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var Wx=new m;function iPe(e){let t=e.center;Wx=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Wx),e.height,Wx),Wx=m.add(t,Wx,Wx);let n=new de(Wx,e.semiMajorAxis),i=Wl.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Pie(o,e,!1),a=vie(r);return a=Ne.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function oPe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,d=t.stRotation,u=e.length/3*2,h=new Float64Array(u*3),p=n.st?new Float32Array(u*2):void 0,g=n.normal?new Float32Array(u*3):void 0,f=n.tangent?new Float32Array(u*3):void 0,y=n.bitangent?new Float32Array(u*3):void 0,x=t.shadowVolume,S=x?new Float32Array(u*3):void 0,C=0,V=Zie,L=Gie,Z=Eie,E=new Ii(s),P=E.project(s.cartesianToCartographic(i,V5),Iie),W=s.scaleToGeodeticSurface(i,TC);s.geodeticSurfaceNormal(W,W);let v=we.fromAxisAngle(W,d,mz),A=$.fromQuaternion(v,Rie),b=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Xie),R=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Wie),G=e.length,I=G/3*2;for(let M=0;M<G;M+=3){let O=M+1,k=M+2,B=m.fromArray(e,M,TC),N;if(n.st){let K=$.multiplyByVector(A,B,dz),te=E.project(s.cartesianToCartographic(K,V5),uz);m.subtract(te,P,te),Es.x=(te.x+o)/(2*o),Es.y=(te.y+r)/(2*r),b.x=Math.min(Es.x,b.x),b.y=Math.min(Es.y,b.y),R.x=Math.max(Es.x,R.x),R.y=Math.max(Es.y,R.y),p[C+I]=Es.x,p[C+1+I]=Es.y,p[C++]=Es.x,p[C++]=Es.y}B=s.scaleToGeodeticSurface(B,B),N=m.clone(B,dz),V=s.geodeticSurfaceNormal(B,V),x&&(S[M+G]=-V.x,S[O+G]=-V.y,S[k+G]=-V.z);let z=m.multiplyByScalar(V,a,Lie);if(B=m.add(B,z,B),z=m.multiplyByScalar(V,c,z),N=m.add(N,z,N),n.position&&(h[M+G]=N.x,h[O+G]=N.y,h[k+G]=N.z,h[M]=B.x,h[O]=B.y,h[k]=B.z),n.normal||n.tangent||n.bitangent){Z=m.clone(V,Z);let K=m.fromArray(e,(M+3)%G,Lie);m.subtract(K,B,K);let te=m.subtract(N,B,uz);V=m.normalize(m.cross(te,K,V),V),n.normal&&(g[M]=V.x,g[O]=V.y,g[k]=V.z,g[M+G]=V.x,g[O+G]=V.y,g[k+G]=V.z),n.tangent&&(L=m.normalize(m.cross(Z,V,L),L),f[M]=L.x,f[O]=L.y,f[k]=L.z,f[M+G]=L.x,f[M+1+G]=L.y,f[M+2+G]=L.z),n.bitangent&&(y[M]=Z.x,y[O]=Z.y,y[k]=Z.z,y[M+G]=Z.x,y[O+G]=Z.y,y[k+G]=Z.z)}}if(n.st){G=p.length;for(let M=0;M<G;M+=2)p[M]=(p[M]-b.x)/(R.x-b.x),p[M+1]=(p[M+1]-b.y)/(R.y-b.y)}let w=new pn;if(n.position&&(w.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(w.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(w.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(w.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),n.bitangent&&(w.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),x&&(w.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:S})),l(t.offsetAttribute)){let M=new Uint8Array(u);if(t.offsetAttribute===ln.TOP)M=M.fill(1,0,u/2);else{let O=t.offsetAttribute===ln.NONE?0:1;M=M.fill(O)}w.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return w}function rPe(e){let t=e.length/3,n=Ne.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var S5=new de,C5=new de;function sPe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,TC),e.height,TC);S5.center=m.add(t,o,S5.center),S5.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),C5.center=m.add(t,o,C5.center),C5.radius=i;let r=Wl.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,d=de.union(S5,C5),u=Pie(s,e,!0),h=vie(a),p=h.length;h.length=p*2;let g=s.length/3;for(let L=0;L<p;L+=3)h[L+p]=h[L+2]+g,h[L+1+p]=h[L+1]+g,h[L+2+p]=h[L]+g;let f=Ne.createTypedArray(g*2/3,h),y=new ht({attributes:u,indices:f,primitiveType:Ae.TRIANGLES}),x=oPe(c,e);h=rPe(c);let S=Ne.createTypedArray(c.length*2/3,h),C=new ht({attributes:x,indices:S,primitiveType:Ae.TRIANGLES}),V=An.combineInstances([new Xt({geometry:y}),new Xt({geometry:C})]);return{boundingSphere:d,attributes:V[0].attributes,indices:V[0].indices}}function wie(e,t,n,i,o,r,s){let c=Wl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,d=c.length/3,u=new Array(d);for(let p=0;p<d;++p)u[p]=m.fromArray(c,p*3);let h=le.fromCartesianArray(u,r,s);return h.width>X.PI&&(h.north=h.north>0?X.PI_OVER_TWO-X.EPSILON7:h.north,h.south=h.south<0?X.EPSILON7-X.PI_OVER_TWO:h.south,h.east=X.PI,h.west=-X.PI),h}function bf(e){e=e??Y.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ne.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??X.RADIANS_PER_DEGREE,s=e.vertexFormat??Xe.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Xe.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}bf.packedLength=m.packedLength+ne.packedLength+Xe.packedLength+9;bf.pack=function(e,t,n){return n=n??0,m.pack(e._center,t,n),n+=m.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.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 Fie=new m,Aie=new ne,Mie=new Xe,pf={center:Fie,ellipsoid:Aie,vertexFormat:Mie,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};bf.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,Fie);t+=m.packedLength;let o=ne.unpack(e,t,Aie);t+=ne.packedLength;let r=Xe.unpack(e,t,Mie);t+=Xe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t++],g=e[t++]===1,f=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=d,n._height=u,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=f===-1?void 0:f,n):(pf.height=u,pf.extrudedHeight=p,pf.granularity=h,pf.stRotation=d,pf.rotation=c,pf.semiMajorAxis=s,pf.semiMinorAxis=a,pf.shadowVolume=g,pf.offsetAttribute=f===-1?void 0:f,new bf(pf))};bf.computeRectangle=function(e,t){e=e??Y.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ne.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??X.RADIANS_PER_DEGREE,a=e.rotation??0;return wie(n,o,r,a,s,i,t)};bf.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!X.equalsEpsilon(t,n,0,X.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=sPe(o);else if(r=iPe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===ln.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ht({attributes:r.attributes,indices:r.indices,primitiveType:Ae.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};bf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new bf({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};function aPe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Wl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=m.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return ht._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(bf.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=wie(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=aPe(this)),this._textureCoordinateRotationPoints}}});var Hc=bf;function Pp(e){e=e??Y.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 Hc(n),this._workerName="createCircleGeometry"}Pp.packedLength=Hc.packedLength;Pp.pack=function(e,t,n){return Hc.pack(e._ellipseGeometry,t,n)};var Nie=new Hc({center:new m,semiMajorAxis:1,semiMinorAxis:1}),Aa={center:new m,radius:void 0,ellipsoid:ne.clone(ne.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Xe,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};Pp.unpack=function(e,t,n){let i=Hc.unpack(e,t,Nie);return Aa.center=m.clone(i._center,Aa.center),Aa.ellipsoid=ne.clone(i._ellipsoid,Aa.ellipsoid),Aa.ellipsoid=ne.clone(i._ellipsoid,Nie._ellipsoid),Aa.height=i._height,Aa.extrudedHeight=i._extrudedHeight,Aa.granularity=i._granularity,Aa.vertexFormat=Xe.clone(i._vertexFormat,Aa.vertexFormat),Aa.stRotation=i._stRotation,Aa.shadowVolume=i._shadowVolume,l(n)?(Aa.semiMajorAxis=i._semiMajorAxis,Aa.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Hc(Aa),n):(Aa.radius=i._semiMajorAxis,new Pp(Aa))};Pp.createGeometry=function(e){return Hc.createGeometry(e._ellipseGeometry)};Pp.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new Pp({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Pp.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var hz=Pp;var OQt=_(T(),1);var FQt=_(T(),1);var kie=new m,Px=new m;function cPe(e){let t=e.center;Px=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Px),e.height,Px),Px=m.add(t,Px,Px);let n=new de(Px,e.semiMajorAxis),i=Wl.computeEllipsePositions(e,!1,!0).outerPositions,o=new pn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:Wl.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ne.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var L5=new de,R5=new de;function lPe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,kie),e.height,kie);L5.center=m.add(t,o,L5.center),L5.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),R5.center=m.add(t,o,R5.center),R5.radius=i;let r=Wl.computeEllipsePositions(e,!1,!0).outerPositions,s=new pn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:Wl.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=de.union(L5,R5),c=r.length/3;if(l(e.offsetAttribute)){let f=new Uint8Array(c);if(e.offsetAttribute===ln.TOP)f=f.fill(1,0,c/2);else{let y=e.offsetAttribute===ln.NONE?0:1;f=f.fill(y)}s.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let d=e.numberOfVerticalLines??16;d=X.clamp(d,0,c/2);let u=Ne.createTypedArray(c,c*2+d*2);c/=2;let h=0,p;for(p=0;p<c;++p)u[h++]=p,u[h++]=(p+1)%c,u[h++]=p+c,u[h++]=(p+1)%c+c;let g;if(d>0){let f=Math.min(d,c);g=Math.round(c/f);let y=Math.min(g*d,c);for(p=0;p<y;p+=g)u[h++]=p,u[h++]=p+c}return{boundingSphere:a,attributes:s,indices:u}}function SC(e){e=e??Y.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ne.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??X.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}SC.packedLength=m.packedLength+ne.packedLength+8;SC.pack=function(e,t,n){return n=n??0,m.pack(e._center,t,n),n+=m.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.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 Uie=new m,Die=new ne,vp={center:Uie,ellipsoid:Die,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};SC.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,Uie);t+=m.packedLength;let o=ne.unpack(e,t,Die);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=d,n._extrudedHeight=u,n._numberOfVerticalLines=h,n._offsetAttribute=p===-1?void 0:p,n):(vp.height=c,vp.extrudedHeight=u,vp.granularity=d,vp.rotation=a,vp.semiMajorAxis=r,vp.semiMinorAxis=s,vp.numberOfVerticalLines=h,vp.offsetAttribute=p===-1?void 0:p,new SC(vp))};SC.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!X.equalsEpsilon(t,n,0,X.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=lPe(o);else if(r=cPe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===ln.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ht({attributes:r.attributes,indices:r.indices,primitiveType:Ae.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var fd=SC;function CC(e){e=e??Y.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 fd(n),this._workerName="createCircleOutlineGeometry"}CC.packedLength=fd.packedLength;CC.pack=function(e,t,n){return fd.pack(e._ellipseGeometry,t,n)};var dPe=new fd({center:new m,semiMajorAxis:1,semiMinorAxis:1}),pd={center:new m,radius:void 0,ellipsoid:ne.clone(ne.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};CC.unpack=function(e,t,n){let i=fd.unpack(e,t,dPe);return pd.center=m.clone(i._center,pd.center),pd.ellipsoid=ne.clone(i._ellipsoid,pd.ellipsoid),pd.height=i._height,pd.extrudedHeight=i._extrudedHeight,pd.granularity=i._granularity,pd.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(pd.semiMajorAxis=i._semiMajorAxis,pd.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new fd(pd),n):(pd.radius=i._semiMajorAxis,new CC(pd))};CC.createGeometry=function(e){return fd.createGeometry(e._ellipseGeometry)};var fz=CC;var o4t=_(T(),1);var YQt=_(T(),1),uPe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Mr=Object.freeze(uPe);var HQt=_(T(),1),mPe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},yo=Object.freeze(mPe);var JQt=_(T(),1),pz;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?pz=function(){return performance.now()}:pz=function(){return Date.now()};var xi=pz;function bz(e){e=e??Y.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=q.clone(t):l(n)?t=q.clone(n):l(i)?t=q.addDays(i,-1,new q):t=q.now(),l(n)?n=q.clone(n):n=q.clone(t),l(i)?i=q.clone(i):i=q.addDays(n,1,new q),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??Mr.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new be,this.onStop=new be,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=xi(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??yo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(bz.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){q.equals(this._currentTime,e)||(this._clockStep===yo.SYSTEM_CLOCK&&(this._clockStep=yo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===yo.SYSTEM_CLOCK&&(this._clockStep=yo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===yo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=q.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===yo.SYSTEM_CLOCK&&(this._clockStep=yo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});bz.prototype.tick=function(){let e=xi(),t=q.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===yo.SYSTEM_CLOCK)t=q.now(t);else{let i=this._multiplier;if(n===yo.TICK_DEPENDENT)t=q.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=q.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===Mr.CLAMPED)q.lessThan(t,r)?t=q.clone(r,t):q.greaterThan(t,s)&&(t=q.clone(s,t),this.onStop.raiseEvent(this));else if(o===Mr.LOOP_STOP)for(q.lessThan(t,r)&&(t=q.clone(r,t));q.greaterThan(t,s);)t=q.addSeconds(r,q.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Am=bz;var l4t=_(T(),1);function VC(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([D.floatToByte(e),D.floatToByte(t),D.floatToByte(n),D.floatToByte(i)])}Object.defineProperties(VC.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});VC.fromColor=function(e){return new VC(e.red,e.green,e.blue,e.alpha)};VC.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};VC.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 Kt=VC;var m4t=_(T(),1);function LC(e){this._value=e,this._valueType=so.getPointType(e)}Object.defineProperties(LC.prototype,{value:{get:function(){return this._value}}});LC.prototype.findTimeInterval=function(e){};LC.prototype.wrapTime=function(e){return 0};LC.prototype.clampTime=function(e){return 0};LC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var ZE=LC;var Bjt=_(T(),1);var y4t=_(T(),1);var GE={},hPe=new m,Oie=new m,Bie=new m,Yie=new m,zie=new Xn;GE.validOutline=function(e){let n=Xn.fromPoints(e,zie).halfAxes,i=$.getColumn(n,0,Oie),o=$.getColumn(n,1,Bie),r=$.getColumn(n,2,Yie),s=m.magnitude(i),a=m.magnitude(o),c=m.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};GE.computeProjectTo2DArguments=function(e,t,n,i){let o=Xn.fromPoints(e,zie),r=o.halfAxes,s=$.getColumn(r,0,Oie),a=$.getColumn(r,1,Bie),c=$.getColumn(r,2,Yie),d=m.magnitude(s),u=m.magnitude(a),h=m.magnitude(c),p=Math.min(d,u,h);if(d===0&&(u===0||h===0)||u===0&&h===0)return!1;let g,f;return(p===u||p===h)&&(g=s),p===d?g=a:p===h&&(f=a),(p===d||p===u)&&(f=c),m.normalize(g,n),m.normalize(f,i),m.clone(o.center,t),!0};function Hie(e,t,n,i,o){let r=m.subtract(e,t,hPe),s=m.dot(n,r),a=m.dot(i,r);return U.fromElements(s,a,o)}GE.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Hie(i[r],e,t,n);return o}};GE.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Hie(i,e,t,n,o)}};var wp=GE;var xjt=_(T(),1);var L4t=_(T(),1);function yz(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,d=n,u=Math.sin(2*d),h=Math.sin(4*d),p=Math.sin(6*d),g=Math.sin(8*d),f=Math.sin(10*d),y=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*y)}function fPe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,d=c*c,u=d*c,h=u*c,p=h*c,g=p*c,f=Math.sin(2*i),y=Math.cos(2*i),x=Math.sin(4*i),S=Math.cos(4*i),C=Math.sin(6*i),V=Math.cos(6*i),L=Math.sin(8*i),Z=Math.cos(8*i),E=Math.sin(10*i),P=Math.cos(10*i),W=Math.sin(12*i);return i+i*c/4+7*i*d/64+15*i*u/256+579*i*h/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*y+(21*i*u/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*S+(151*i*h/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*V+(1097*i*p/65536+42783*i*g/1048576)*Z+8011*i*g/1048576*P+(3*c/8+3*d/16+213*u/2048-3*o*u/64+255*h/4096-33*o*h/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*f+(21*d/256+21*u/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*x+(151*u/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*C+(1097*h/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*L+(8011*p/2621440+8011*g/1048576)*E+293393*g/251658240*W}function RC(e,t){if(e===0)return Math.log(Math.tan(.5*(X.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(X.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function pPe(e,t,n,i,o){let r=RC(e._ellipticity,n),s=RC(e._ellipticity,o);return Math.atan2(X.negativePiToPi(i-t),s-r)}function bPe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,d=0;if(X.equalsEpsilon(Math.abs(a),X.PI_OVER_TWO,X.EPSILON8))if(t===n)d=t*Math.cos(o)*X.negativePiToPi(c);else{let u=Math.sin(o);d=t*Math.cos(o)*X.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=yz(e._ellipticity,t,o);d=(yz(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var gPe=new m,gz=new m;function Kie(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,gz),gPe),r=m.normalize(i.cartographicToCartesian(n,gz),gz),s=i.maximumRadius,a=i.minimumRadius,c=s*s,d=a*a;e._ellipticitySquared=(c-d)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=pPe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=bPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Jie(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,c,d;if(Math.abs(X.PI_OVER_TWO-Math.abs(t))>X.EPSILON8){let u=yz(o,i,e.latitude),h=n*Math.cos(t),p=u+h;if(c=fPe(p,o,i),Math.abs(t)<X.EPSILON10)a=X.negativePiToPi(e.longitude);else{let g=RC(o,e.latitude),f=RC(o,c);d=Math.tan(t)*(f-g),a=X.negativePiToPi(e.longitude+d)}}else{c=e.latitude;let u;if(o===0)u=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);u=i*Math.cos(e.latitude)/Math.sqrt(1-s*h*h)}d=n/u,t>0?a=X.negativePiToPi(e.longitude+d):a=X.negativePiToPi(e.longitude-d)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new he(a,c,0)}function Fp(e,t,n){let i=n??ne.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Kie(this,e,t,i)}Object.defineProperties(Fp.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}}});Fp.fromStartHeadingDistance=function(e,t,n,i,o){let r=i??ne.default,s=r.maximumRadius,a=r.minimumRadius,c=s*s,d=a*a,u=Math.sqrt((c-d)/c);t=X.negativePiToPi(t);let h=Jie(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new Fp(e,h,r):(o.setEndPoints(e,h),o)};Fp.prototype.setEndPoints=function(e,t){Kie(this,e,t,this._ellipsoid)};Fp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Fp.prototype.interpolateUsingSurfaceDistance=function(e,t){return Jie(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Fp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=X.negativePiToPi(e),X.equalsEpsilon(Math.abs(e),Math.PI,X.EPSILON14)&&(e=X.sign(r.longitude)*Math.PI),l(t)||(t=new he),Math.abs(X.PI_OVER_TWO-o)<=X.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(X.equalsEpsilon(Math.abs(X.PI_OVER_TWO-o),X.PI_OVER_TWO,X.EPSILON8))return X.equalsEpsilon(e,r.longitude,X.EPSILON12)?void 0:(t.longitude=e,t.latitude=X.PI_OVER_TWO*X.sign(X.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(X.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,h;do{h=u;let p=n*Math.sin(h),g=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(g/d,n/2))-X.PI_OVER_TWO}while(!X.equalsEpsilon(u,h,X.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};Fp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(X.equalsEpsilon(Math.abs(i),X.PI_OVER_TWO,X.EPSILON8))return;let r=RC(n,o.latitude),s=RC(n,e),a=Math.tan(i)*(s-r),c=X.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Ma=Fp;var G4t=_(T(),1);function yPe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Na=yPe;var Y4t=_(T(),1);var I4t=_(T(),1);function Tz(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=jie(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,d;if(i&&(r=CPe(e,t,r,n)),e.length>80*n){a=1/0,c=1/0;let u=-1/0,h=-1/0;for(let p=n;p<o;p+=n){let g=e[p],f=e[p+1];g<a&&(a=g),f<c&&(c=f),g>u&&(u=g),f>h&&(h=f)}d=Math.max(u-a,h-c),d=d!==0?32767/d:0}return IE(r,s,n,a,c,d,0),s}function jie(e,t,n,i,o){let r;if(o===vPe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=Qie(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=Qie(s/i|0,e[s],e[s+1],r);return r&&ZC(r,r.next)&&(WE(r),r=r.next),r}function vx(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(ZC(n,n.next)||Nr(n.prev,n,n.next)===0)){if(WE(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function IE(e,t,n,i,o,r,s){if(!e)return;!s&&r&&GPe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?_Pe(e,i,o,r):xPe(e)){t.push(c.i,e.i,d.i),WE(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=TPe(vx(e),t),IE(e,t,n,i,o,r,2)):s===2&&SPe(e,t,n,i,o,r):IE(vx(e),t,n,i,o,r,1);break}}}function xPe(e){let t=e.prev,n=e,i=e.next;if(Nr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,d=i.y,u=Math.min(o,r,s),h=Math.min(a,c,d),p=Math.max(o,r,s),g=Math.max(a,c,d),f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=g&&EE(o,a,r,c,s,d,f.x,f.y)&&Nr(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function _Pe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Nr(o,r,s)>=0)return!1;let a=o.x,c=r.x,d=s.x,u=o.y,h=r.y,p=s.y,g=Math.min(a,c,d),f=Math.min(u,h,p),y=Math.max(a,c,d),x=Math.max(u,h,p),S=xz(g,f,t,n,i),C=xz(y,x,t,n,i),V=e.prevZ,L=e.nextZ;for(;V&&V.z>=S&&L&&L.z<=C;){if(V.x>=g&&V.x<=y&&V.y>=f&&V.y<=x&&V!==o&&V!==s&&EE(a,u,c,h,d,p,V.x,V.y)&&Nr(V.prev,V,V.next)>=0||(V=V.prevZ,L.x>=g&&L.x<=y&&L.y>=f&&L.y<=x&&L!==o&&L!==s&&EE(a,u,c,h,d,p,L.x,L.y)&&Nr(L.prev,L,L.next)>=0))return!1;L=L.nextZ}for(;V&&V.z>=S;){if(V.x>=g&&V.x<=y&&V.y>=f&&V.y<=x&&V!==o&&V!==s&&EE(a,u,c,h,d,p,V.x,V.y)&&Nr(V.prev,V,V.next)>=0)return!1;V=V.prevZ}for(;L&&L.z<=C;){if(L.x>=g&&L.x<=y&&L.y>=f&&L.y<=x&&L!==o&&L!==s&&EE(a,u,c,h,d,p,L.x,L.y)&&Nr(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function TPe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!ZC(i,o)&&$ie(i,n,n.next,o)&&XE(i,o)&&XE(o,i)&&(t.push(i.i,n.i,o.i),WE(n),WE(n.next),n=e=o),n=n.next}while(n!==e);return vx(n)}function SPe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&XPe(s,a)){let c=eoe(s,a);s=vx(s,s.next),c=vx(c,c.next),IE(s,t,n,i,o,r,0),IE(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function CPe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,d=jie(e,a,c,i,!1);d===d.next&&(d.steiner=!0),o.push(IPe(d))}o.sort(VPe);for(let r=0;r<o.length;r++)n=LPe(o[r],n);return n}function VPe(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),o=(t.next.y-t.y)/(t.next.x-t.x);n=i-o}return n}function LPe(e,t){let n=RPe(e,t);if(!n)return t;let i=eoe(n,e);return vx(i,i.next),vx(n,n.next)}function RPe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(ZC(e,n))return n;do{if(ZC(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>r&&(r=h,s=n.x<n.next.x?n:n.next,h===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,d=s.y,u=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&qie(o<d?i:r,o,c,d,o<d?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);XE(n,e)&&(h<u||h===u&&(n.x>s.x||n.x===s.x&&ZPe(s,n)))&&(s=n,u=h)}n=n.next}while(n!==a);return s}function ZPe(e,t){return Nr(e.prev,e,t.prev)<0&&Nr(t.next,e,e.next)<0}function GPe(e,t,n,i){let o=e;do o.z===0&&(o.z=xz(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,EPe(o)}function EPe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let d=0;d<n&&(a++,s=s.nextZ,!!s);d++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function xz(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 IPe(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 qie(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function EE(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&qie(e,t,n,i,o,r,s,a)}function XPe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!WPe(e,t)&&(XE(e,t)&&XE(t,e)&&PPe(e,t)&&(Nr(e.prev,e,t.prev)||Nr(e,t.prev,t))||ZC(e,t)&&Nr(e.prev,e,e.next)>0&&Nr(t.prev,t,t.next)>0)}function Nr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ZC(e,t){return e.x===t.x&&e.y===t.y}function $ie(e,t,n,i){let o=G5(Nr(e,t,n)),r=G5(Nr(e,t,i)),s=G5(Nr(n,i,e)),a=G5(Nr(n,i,t));return!!(o!==r&&s!==a||o===0&&Z5(e,n,t)||r===0&&Z5(e,i,t)||s===0&&Z5(n,e,i)||a===0&&Z5(n,t,i))}function Z5(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 G5(e){return e>0?1:e<0?-1:0}function WPe(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&&$ie(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function XE(e,t){return Nr(e.prev,e,e.next)<0?Nr(e,t,e.next)>=0&&Nr(e,e.prev,t)>=0:Nr(e,t,e.prev)<0||Nr(e,e.next,t)<0}function PPe(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 eoe(e,t){let n=_z(e.i,e.x,e.y),i=_z(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 Qie(e,t,n,i){let o=_z(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 WE(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 _z(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function vPe(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var wPe=new m,FPe=new m,tg={};tg.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};tg.computeWindingOrder2D=function(e){return tg.computeArea2D(e)>0?fs.COUNTER_CLOCKWISE:fs.CLOCKWISE};tg.triangulate=function(e,t){let n=U.packArray(e);return Tz(n,t,2)};var ooe=new m,roe=new m,soe=new m,toe=new m,noe=new m,ioe=new m,Ap=new m,aoe=new U,coe=new U,loe=new U,GC=new U;tg.computeSubdivision=function(e,t,n,i,o){o=o??X.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),h=0,p=0;for(a=0;a<c;a++){let V=t[a];if(d[h++]=V.x,d[h++]=V.y,d[h++]=V.z,r){let L=i[a];u[p++]=L.x,u[p++]=L.y}}let g=[],f={},y=e.maximumRadius,x=X.chordLength(o,y),S=x*x;for(;s.length>0;){let V=s.pop(),L=s.pop(),Z=s.pop(),E=m.fromArray(d,Z*3,ooe),P=m.fromArray(d,L*3,roe),W=m.fromArray(d,V*3,soe),v,A,b;r&&(v=U.fromArray(u,Z*2,aoe),A=U.fromArray(u,L*2,coe),b=U.fromArray(u,V*2,loe));let R=m.multiplyByScalar(m.normalize(E,toe),y,toe),G=m.multiplyByScalar(m.normalize(P,noe),y,noe),I=m.multiplyByScalar(m.normalize(W,ioe),y,ioe),w=m.magnitudeSquared(m.subtract(R,G,Ap)),M=m.magnitudeSquared(m.subtract(G,I,Ap)),O=m.magnitudeSquared(m.subtract(I,R,Ap)),k=Math.max(w,M,O),B,N,z;k>S?w===k?(B=`${Math.min(Z,L)} ${Math.max(Z,L)}`,a=f[B],l(a)||(N=m.add(E,P,Ap),m.multiplyByScalar(N,.5,N),d.push(N.x,N.y,N.z),a=d.length/3-1,f[B]=a,r&&(z=U.add(v,A,GC),U.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(Z,a,V),s.push(a,L,V)):M===k?(B=`${Math.min(L,V)} ${Math.max(L,V)}`,a=f[B],l(a)||(N=m.add(P,W,Ap),m.multiplyByScalar(N,.5,N),d.push(N.x,N.y,N.z),a=d.length/3-1,f[B]=a,r&&(z=U.add(A,b,GC),U.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(L,a,Z),s.push(a,V,Z)):O===k&&(B=`${Math.min(V,Z)} ${Math.max(V,Z)}`,a=f[B],l(a)||(N=m.add(W,E,Ap),m.multiplyByScalar(N,.5,N),d.push(N.x,N.y,N.z),a=d.length/3-1,f[B]=a,r&&(z=U.add(b,v,GC),U.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(V,a,L),s.push(a,Z,L)):(g.push(Z),g.push(L),g.push(V))}let C={attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:Ae.TRIANGLES};return r&&(C.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new ht(C)};var APe=new he,MPe=new he,NPe=new he,Sz=new he;tg.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??X.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),h=0,p=0;for(a=0;a<c;a++){let Z=t[a];if(d[h++]=Z.x,d[h++]=Z.y,d[h++]=Z.z,r){let E=i[a];u[p++]=E.x,u[p++]=E.y}}let g=[],f={},y=e.maximumRadius,x=X.chordLength(o,y),S=new Ma(void 0,void 0,e),C=new Ma(void 0,void 0,e),V=new Ma(void 0,void 0,e);for(;s.length>0;){let Z=s.pop(),E=s.pop(),P=s.pop(),W=m.fromArray(d,P*3,ooe),v=m.fromArray(d,E*3,roe),A=m.fromArray(d,Z*3,soe),b,R,G;r&&(b=U.fromArray(u,P*2,aoe),R=U.fromArray(u,E*2,coe),G=U.fromArray(u,Z*2,loe));let I=e.cartesianToCartographic(W,APe),w=e.cartesianToCartographic(v,MPe),M=e.cartesianToCartographic(A,NPe);S.setEndPoints(I,w);let O=S.surfaceDistance;C.setEndPoints(w,M);let k=C.surfaceDistance;V.setEndPoints(M,I);let B=V.surfaceDistance,N=Math.max(O,k,B),z,K,te,H,j;N>x?O===N?(z=`${Math.min(P,E)} ${Math.max(P,E)}`,a=f[z],l(a)||(K=S.interpolateUsingFraction(.5,Sz),te=(I.height+w.height)*.5,H=m.fromRadians(K.longitude,K.latitude,te,e,Ap),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&(j=U.add(b,R,GC),U.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(P,a,Z),s.push(a,E,Z)):k===N?(z=`${Math.min(E,Z)} ${Math.max(E,Z)}`,a=f[z],l(a)||(K=C.interpolateUsingFraction(.5,Sz),te=(w.height+M.height)*.5,H=m.fromRadians(K.longitude,K.latitude,te,e,Ap),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&(j=U.add(R,G,GC),U.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(E,a,P),s.push(a,Z,P)):B===N&&(z=`${Math.min(Z,P)} ${Math.max(Z,P)}`,a=f[z],l(a)||(K=V.interpolateUsingFraction(.5,Sz),te=(M.height+I.height)*.5,H=m.fromRadians(K.longitude,K.latitude,te,e,Ap),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&(j=U.add(G,b,GC),U.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(Z,a,E),s.push(a,P,E)):(g.push(P),g.push(E),g.push(Z))}let L={attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:Ae.TRIANGLES};return r&&(L.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new ht(L)};tg.scaleToGeodeticHeight=function(e,t,n,i){n=n??ne.default;let o=wPe,r=FPe;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)m.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),m.multiplyByScalar(o,t,o),m.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var ri=tg;var H4t=_(T(),1);function ng(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(ng.prototype,{length:{get:function(){return this._length}}});ng.prototype.enqueue=function(e){this._array.push(e),this._length++};ng.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};ng.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};ng.prototype.contains=function(e){return this._array.indexOf(e)!==-1};ng.prototype.clear=function(){this._array.length=this._offset=this._length=0};ng.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var ig=ng;var jo={};jo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};jo.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let d=0;d<c;++d,n+=i.packedLength)i.pack(s[d],t,n)}if(l(a)){let c=a.length;for(let d=0;d<c;++d)o.push(a[d])}}return n};jo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=jo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var wx=new U;function moe(e,t,n,i){return U.subtract(t,e,wx),U.multiplyByScalar(wx,n/i,wx),U.add(e,wx,wx),[wx.x,wx.y]}var og=new m;function kPe(e,t,n,i){return m.subtract(t,e,og),m.multiplyByScalar(og,n/i,og),m.add(e,og,og),[og.x,og.y,og.z]}jo.subdivideLineCount=function(e,t,n){let o=m.distance(e,t)/n,r=Math.max(0,Math.ceil(X.log2(o)));return Math.pow(2,r)};var I5=new he,X5=new he,UPe=new he,DPe=new m,E5=new Ma;jo.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,I5),r=e.cartesianToCartographic(n,X5),a=new Ma(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(X.log2(a)));return Math.pow(2,c)};jo.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=jo.subdivideLineCount(n,i,o),a=U.distance(e,t),c=a/s,d=r;d.length=s*2;let u=0;for(let h=0;h<s;h++){let p=moe(e,t,h*c,a);d[u++]=p[0],d[u++]=p[1]}return d};jo.subdivideLine=function(e,t,n,i){let o=jo.subdivideLineCount(e,t,n),r=m.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let d=0;d<o;d++){let u=kPe(e,t,d*s,r);a[c++]=u[0],a[c++]=u[1],a[c++]=u[2]}return a};jo.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,I5),c=n.cartesianToCartographic(o,X5);E5.setEndPoints(a,c);let d=E5.surfaceDistance/r,u=Math.max(0,Math.ceil(X.log2(d))),h=Math.pow(2,u),p=U.distance(e,t),g=p/h,f=s;f.length=h*2;let y=0;for(let x=0;x<h;x++){let S=moe(e,t,x*g,p);f[y++]=S[0],f[y++]=S[1]}return f};jo.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,I5),s=e.cartesianToCartographic(n,X5),a=new Ma(r,s,e);if(l(o)||(o=[]),a.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let c=a.surfaceDistance/i,d=Math.max(0,Math.ceil(X.log2(c))),u=Math.pow(2,d),h=a.surfaceDistance/u,p=o;p.length=u*3;let g=0;for(let f=0;f<u;f++){let y=a.interpolateUsingSurfaceDistance(f*h,UPe),x=e.cartographicToCartesian(y,DPe);p[g++]=x.x,p[g++]=x.y,p[g++]=x.z}return p};var OPe=new m,BPe=new m,YPe=new m,zPe=new m;jo.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??ne.default;let r=OPe,s=BPe,a=YPe,c=zPe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let d=e.attributes.position.values,u=d.length/2;for(let h=0;h<u;h+=3)m.fromArray(d,h,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=m.multiplyByScalar(r,n,s),s=m.add(c,s,s),d[h+u]=s.x,d[h+1+u]=s.y,d[h+2+u]=s.z,o&&(c=m.clone(a,c)),s=m.multiplyByScalar(r,t,s),s=m.add(c,s,s),d[h]=s.x,d[h+1]=s.y,d[h+2]=s.z}return e};jo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new ig;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),d=c.positions;if(t)for(a=d.length,r=0;r<a;r++)n.scaleToGeodeticSurface(d[r],d[r]);if(d=Co(d,m.equalsEpsilon,!0),d.length<3)continue;let u=c.holes?c.holes.length:0;for(r=0;r<u;r++){let h=c.holes[r],p=h.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Co(p,m.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(h.holes)&&(g=h.holes.length),s=0;s<g;s++)o.enqueue(h.holes[s])}i.push(d)}return i};var HPe=new he;function KPe(e,t,n){let i=n.cartesianToCartographic(e,I5),o=n.cartesianToCartographic(t,X5);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;E5.setEndPoints(i,o);let r=E5.findIntersectionWithLatitude(0,HPe);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>X.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function JPe(e,t,n,i){if(i===on.RHUMB)return KPe(e,t,n);let o=ei.lineSegmentPlane(e,t,dn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var QPe=new he;function jPe(e,t,n){let i=[],o,r,s,a,c,d=0;for(;d<e.length;){o=e[d],r=e[(d+1)%e.length],s=X.sign(o.z),a=X.sign(r.z);let u=h=>t.cartesianToCartographic(h,QPe).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=JPe(o,r,t,n),++d,!l(c))continue;e.splice(d,0,c),i.push({position:d,type:s,visited:!1,next:a,theta:u(c)})}++d}return i}function hoe(e,t,n,i,o,r,s){let a=[],c=r,d=h=>p=>p.position===h,u=[];do{let h=n[c];a.push(h);let p=i.findIndex(d(c)),g=i[p];if(!l(g)){++c;continue}let{visited:f,type:y,next:x}=g;if(g.visited=!0,y===0){if(x===0){let L=i[p-(s?1:-1)];if(L?.position===c+1)L.visited=!0;else{++c;continue}}if(!f&&s&&x>0||r===c&&!s&&x<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}f||u.push(c);let C=p+(s?1:-1),V=i[C];if(!l(V)){++c;continue}c=V.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let h of u)t=hoe(e,++t,n,i,0,h,!s);return t}jo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=jPe(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((d,u)=>d.theta-u.theta);let c=s[0].z>=0;o=hoe(i,o,s,a,1,0,c)}return i};jo.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new ig;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),h=u.positions,p=u.holes,g,f;if(i)for(f=h.length,g=0;g<f;g++)o.scaleToGeodeticSurface(h[g],h[g]);if(t||(h=Co(h,m.equalsEpsilon,!0)),h.length<3)continue;let y=n(h);if(!l(y))continue;let x=[],S=ri.computeWindingOrder2D(y);if(S===fs.CLOCKWISE&&(y.reverse(),h=h.slice().reverse()),d){d=!1;let E=[h];if(E=r(E,E),E.length>1){for(let P of E)c.enqueue(new Na(P,p));continue}}let C=h.slice(),V=l(p)?p.length:0,L=[],Z;for(g=0;g<V;g++){let E=p[g],P=E.positions;if(i)for(f=P.length,Z=0;Z<f;++Z)o.scaleToGeodeticSurface(P[Z],P[Z]);if(t||(P=Co(P,m.equalsEpsilon,!0)),P.length<3)continue;let W=n(P);if(!l(W))continue;S=ri.computeWindingOrder2D(W),S===fs.CLOCKWISE&&(W.reverse(),P=P.slice().reverse()),L.push(P),x.push(C.length),C=C.concat(P),y=y.concat(W);let v=0;for(l(E.holes)&&(v=E.holes.length),Z=0;Z<v;Z++)c.enqueue(E.holes[Z])}s.push({outerRing:h,holes:L}),a.push({positions:C,positions2D:y,holes:x})}return{hierarchy:s,polygons:a}};var qPe=new U,$Pe=new m,e2e=new we,t2e=new $;jo.computeBoundingRectangle=function(e,t,n,i,o){let r=we.fromAxisAngle(e,i,e2e),s=$.fromQuaternion(r,t2e),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=n.length;for(let p=0;p<h;++p){let g=m.clone(n[p],$Pe);$.multiplyByVector(s,g,g);let f=t(g,qPe);l(f)&&(a=Math.min(a,f.x),c=Math.max(c,f.x),d=Math.min(d,f.y),u=Math.max(u,f.y))}return o.x=a,o.y=d,o.width=c-a,o.height=u-d,o};jo.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=ri.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,d=l(n),u=d?n.positions:void 0;if(o){let h=c.length,p=new Array(h*3),g=0;for(let x=0;x<h;x++){let S=c[x];p[g++]=S.x,p[g++]=S.y,p[g++]=S.z}let f={attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Ae.TRIANGLES};d&&(f.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:U.packArray(u)}));let y=new ht(f);return r.normal?An.computeNormal(y):y}if(s===on.GEODESIC)return ri.computeSubdivision(e,c,a,u,i);if(s===on.RHUMB)return ri.computeRhumbLineSubdivision(e,c,a,u,i)};var doe=[],uoe=[],n2e=new m,i2e=new m;jo.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,d,u,h,p,g,f,y=e.length,x=0,S=0,C=l(t),V=C?t.positions:void 0;if(o)for(a=y*3*2,s=new Array(a*2),C&&(f=y*2*2,g=new Array(f*2)),c=0;c<y;c++)d=e[c],u=e[(c+1)%y],s[x]=s[x+a]=d.x,++x,s[x]=s[x+a]=d.y,++x,s[x]=s[x+a]=d.z,++x,s[x]=s[x+a]=u.x,++x,s[x]=s[x+a]=u.y,++x,s[x]=s[x+a]=u.z,++x,C&&(h=V[c],p=V[(c+1)%y],g[S]=g[S+f]=h.x,++S,g[S]=g[S+f]=h.y,++S,g[S]=g[S+f]=p.x,++S,g[S]=g[S+f]=p.y,++S);else{let W=X.chordLength(i,n.maximumRadius),v=0;if(r===on.GEODESIC)for(c=0;c<y;c++)v+=jo.subdivideLineCount(e[c],e[(c+1)%y],W);else if(r===on.RHUMB)for(c=0;c<y;c++)v+=jo.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],W);for(a=(v+y)*3,s=new Array(a*2),C&&(f=(v+y)*2,g=new Array(f*2)),c=0;c<y;c++){d=e[c],u=e[(c+1)%y];let A,b;C&&(h=V[c],p=V[(c+1)%y]),r===on.GEODESIC?(A=jo.subdivideLine(d,u,W,uoe),C&&(b=jo.subdivideTexcoordLine(h,p,d,u,W,doe))):r===on.RHUMB&&(A=jo.subdivideRhumbLine(n,d,u,W,uoe),C&&(b=jo.subdivideTexcoordRhumbLine(h,p,n,d,u,W,doe)));let R=A.length;for(let G=0;G<R;++G,++x)s[x]=A[G],s[x+a]=A[G];if(s[x]=u.x,s[x+a]=u.x,++x,s[x]=u.y,s[x+a]=u.y,++x,s[x]=u.z,s[x+a]=u.z,++x,C){let G=b.length;for(let I=0;I<G;++I,++S)g[S]=b[I],g[S+f]=b[I];g[S]=p.x,g[S+f]=p.x,++S,g[S]=p.y,g[S+f]=p.y,++S}}}y=s.length;let L=Ne.createTypedArray(y/3,y-e.length*6),Z=0;for(y/=6,c=0;c<y;c++){let W=c,v=W+1,A=W+y,b=A+1;d=m.fromArray(s,W*3,n2e),u=m.fromArray(s,v*3,i2e),!m.equalsEpsilon(d,u,X.EPSILON10,X.EPSILON10)&&(L[Z++]=W,L[Z++]=A,L[Z++]=v,L[Z++]=v,L[Z++]=A,L[Z++]=b)}let E={attributes:new pn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),indices:L,primitiveType:Ae.TRIANGLES};return C&&(E.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:g})),new ht(E)};var Un=jo;var o2e=new m,r2e=new ze,s2e=new U,a2e=new U,c2e=new m,l2e=new m,d2e=new m,PE=new m,u2e=new m,m2e=new m,foe=new we,h2e=new $,f2e=new $,p2e=new m;function b2e(e,t,n,i,o,r,s,a,c){let d=e.positions,u=ri.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let h=Ne.createTypedArray(d.length,u.length);h.set(u);let p=h2e;if(i!==0){let b=we.fromAxisAngle(s,i,foe);if(p=$.fromQuaternion(b,p),t.tangent||t.bitangent){b=we.fromAxisAngle(s,-i,foe);let R=$.fromQuaternion(b,f2e);a=m.normalize($.multiplyByVector(R,a,a),a),t.bitangent&&(c=m.normalize(m.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=a2e;t.st&&(g.x=n.x,g.y=n.y);let f=d.length,y=f*3,x=new Float64Array(y),S=t.normal?new Float32Array(y):void 0,C=t.tangent?new Float32Array(y):void 0,V=t.bitangent?new Float32Array(y):void 0,L=t.st?new Float32Array(f*2):void 0,Z=0,E=0,P=0,W=0,v=0;for(let b=0;b<f;b++){let R=d[b];if(x[Z++]=R.x,x[Z++]=R.y,x[Z++]=R.z,t.st)if(l(o)&&o.positions.length===f)L[v++]=o.positions[b].x,L[v++]=o.positions[b].y;else{let G=$.multiplyByVector(p,R,o2e),I=r(G,s2e);U.subtract(I,g,I);let w=X.clamp(I.x/n.width,0,1),M=X.clamp(I.y/n.height,0,1);L[v++]=w,L[v++]=M}t.normal&&(S[E++]=s.x,S[E++]=s.y,S[E++]=s.z),t.tangent&&(C[W++]=a.x,C[W++]=a.y,C[W++]=a.z),t.bitangent&&(V[P++]=c.x,V[P++]=c.y,V[P++]=c.z)}let A=new pn;return t.position&&(A.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:x})),t.normal&&(A.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:S})),t.tangent&&(A.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:C})),t.bitangent&&(A.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:V})),t.st&&(A.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:L})),new ht({attributes:A,indices:h,primitiveType:Ae.TRIANGLES})}function Fx(e){e=e??Y.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Xe.DEFAULT;this._vertexFormat=Xe.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Un.computeHierarchyPackedLength(t,m)+Xe.packedLength+ne.packedLength+(l(n)?Un.computeHierarchyPackedLength(n,U):1)+2}Fx.fromPositions=function(e){e=e??Y.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new Fx(t)};Fx.pack=function(e,t,n){return n=n??0,n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,m),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Un.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n++]=e.packedLength,t};var g2e=ne.clone(ne.UNIT_SPHERE),y2e=new Xe,x2e={polygonHierarchy:{}};Fx.unpack=function(e,t,n){t=t??0;let i=Un.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,g2e);t+=ne.packedLength;let r=Xe.unpack(e,t,y2e);t+=Xe.packedLength;let s=e[t++],a=e[t]===-1?void 0:Un.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new Fx(x2e)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};Fx.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=Co(s,m.equalsEpsilon,!0),s.length<3)return;let a=c2e,c=l2e,d=d2e,u=u2e,h=m2e;if(!wp.computeProjectTo2DArguments(s,PE,u,h))return;if(a=m.cross(u,h,a),a=m.normalize(a,a),!m.equalsEpsilon(PE,m.ZERO,X.EPSILON6)){let v=e._ellipsoid.geodeticSurfaceNormal(PE,p2e);m.dot(a,v)<0&&(a=m.negate(a,a),u=m.negate(u,u))}let g=wp.createProjectPointsTo2DFunction(PE,u,h),f=wp.createProjectPointTo2DFunction(PE,u,h);t.tangent&&(c=m.clone(u,c)),t.bitangent&&(d=m.clone(h,d));let y=Un.polygonsFromHierarchy(n,r,g,!1),x=y.hierarchy,S=y.polygons,C=function(v){return v},V=r?Un.polygonsFromHierarchy(o,!0,C,!1).polygons:void 0;if(x.length===0)return;s=x[0].outerRing;let L=de.fromPoints(s),Z=Un.computeBoundingRectangle(a,f,s,i,r2e),E=[];for(let v=0;v<S.length;v++){let A=new Xt({geometry:b2e(S[v],t,Z,i,r?V[v]:void 0,f,a,c,d)});E.push(A)}let P=An.combineInstances(E)[0];P.attributes.position.values=new Float64Array(P.attributes.position.values),P.indices=Ne.createTypedArray(P.attributes.position.values.length/3,P.indices);let W=P.attributes;return t.position||delete W.position,new ht({attributes:W,indices:P.indices,primitiveType:P.primitiveType,boundingSphere:L})};var vE=Fx;var a8t=_(T(),1);function _2e(e){let t=e.length,n=new Float64Array(t*3),i=Ne.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new pn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n})});return new ht({attributes:s,indices:i,primitiveType:Ae.LINES})}function Ax(e){e=e??Y.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Un.computeHierarchyPackedLength(t,m)+1}Ax.fromPositions=function(e){e=e??Y.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new Ax(t)};Ax.pack=function(e,t,n){return n=n??0,n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,m),t[n]=e.packedLength,t};var T2e={polygonHierarchy:{}};Ax.unpack=function(e,t,n){t=t??0;let i=Un.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new Ax(T2e)),n._polygonHierarchy=i,n.packedLength=o,n};Ax.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Co(n,m.equalsEpsilon,!0),n.length<3||!wp.validOutline(n))return;let o=Un.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let d=new Xt({geometry:_2e(o[c])});r.push(d)}let s=An.combineInstances(r)[0],a=de.fromPoints(t.positions);return new ht({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Vu=Ax;var l8t=_(T(),1),S2e={ROUNDED:0,MITERED:1,BEVELED:2},vi=Object.freeze(S2e);var V7t=_(T(),1);var n7t=_(T(),1);var G8t=_(T(),1);var b8t=_(T(),1);function C2e(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),d=c*a,u=Math.atan2(a,r),h=c*s,p=h*h,g=1-p,f=Math.sqrt(g),y=t/4,x=y*y,S=x*y,C=x*x,V=1+y-3*x/4+5*S/4-175*C/64,L=1-y+15*x/8-35*S/8,Z=1-3*y+35*x/4,E=1-5*y,P=V*u-L*Math.sin(2*u)*y/2-Z*Math.sin(4*u)*x/16-E*Math.sin(6*u)*S/48-Math.sin(8*u)*5*C/512,W=e._constants;W.a=n,W.b=i,W.f=o,W.cosineHeading=r,W.sineHeading=s,W.tanU=a,W.cosineU=c,W.sineU=d,W.sigma=u,W.sineAlpha=h,W.sineSquaredAlpha=p,W.cosineSquaredAlpha=g,W.cosineAlpha=f,W.u2Over4=y,W.u4Over16=x,W.u6Over64=S,W.u8Over256=C,W.a0=V,W.a1=L,W.a2=Z,W.a3=E,W.distanceRatio=P}function V2e(e,t){return e*t*(4+e*(4-3*t))/16}function poe(e,t,n,i,o,r,s){let a=V2e(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function L2e(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,d=Math.atan((1-a)*Math.tan(o)),u=Math.atan((1-a)*Math.tan(s)),h=Math.cos(d),p=Math.sin(d),g=Math.cos(u),f=Math.sin(u),y=h*g,x=h*f,S=p*f,C=p*g,V=c,L=X.TWO_PI,Z=Math.cos(V),E=Math.sin(V),P,W,v,A,b;do{Z=Math.cos(V),E=Math.sin(V);let N=x-C*Z;v=Math.sqrt(g*g*E*E+N*N),W=S+y*Z,P=Math.atan2(v,W);let z;v===0?(z=0,A=1):(z=y*E/v,A=1-z*z),L=V,b=W-2*S/A,isFinite(b)||(b=0),V=c+poe(a,z,A,P,v,W,b)}while(Math.abs(V-L)>X.EPSILON12);let R=A*(t*t-n*n)/(n*n),G=1+R*(4096+R*(R*(320-175*R)-768))/16384,I=R*(256+R*(R*(74-47*R)-128))/1024,w=b*b,M=I*v*(b+I*(W*(2*w-1)-I*b*(4*v*v-3)*(4*w-3)/6)/4),O=n*G*(P-M),k=Math.atan2(g*E,x-C*Z),B=Math.atan2(h*E,x*Z-C);e._distance=O,e._startHeading=k,e._endHeading=B,e._uSquared=R}var R2e=new m,Cz=new m;function boe(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,Cz),R2e),r=m.normalize(i.cartographicToCartesian(n,Cz),Cz);L2e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,C2e(e)}function wE(e,t,n){let i=n??ne.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&boe(this,e,t,i)}Object.defineProperties(wE.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}}});wE.prototype.setEndPoints=function(e,t){boe(this,e,t,this._ellipsoid)};wE.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};wE.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),h=i*i,p=i*h,g=n.u8Over256,f=n.u2Over4,y=n.u6Over64,x=n.u4Over16,S=2*p*g*o/3+i*(1-f+7*x/4-15*y/4+579*g/64-(x-15*y/4+187*g/16)*o-(5*y/4-115*g/16)*r-29*g*s/16)+(f/2-x+71*y/32-85*g/16)*a+(5*x/16-5*y/4+383*g/96)*c-h*((y-11*g/2)*a+5*g*c/2)+(29*y/96-29*g/16)*d+539*g*u/1536,C=Math.asin(Math.sin(S)*n.cosineAlpha),V=Math.atan(n.a/n.b*Math.tan(C));S=S-n.sigma;let L=Math.cos(2*n.sigma+S),Z=Math.sin(S),E=Math.cos(S),P=n.cosineU*E,W=n.sineU*Z,A=Math.atan2(Z*n.sineHeading,P-W*n.cosineHeading)-poe(n.f,n.sineAlpha,n.cosineSquaredAlpha,S,Z,E,L);return l(t)?(t.longitude=this._start.longitude+A,t.latitude=V,t.height=0,t):new he(this._start.longitude+A,V,0)};var Mp=wE;var Kc={};Kc.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};Kc.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 Z2e=new he;Kc.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,Z2e).height}return i};var G2e=new F,E2e=new m,goe=new m,I2e=new dn(m.UNIT_X,0),yoe=new m,X2e=new dn(m.UNIT_X,0),W2e=new m,P2e=new m,Lz=[];function _oe(e,t,n){let i=Lz;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var P5=new he,W5=new he,rg=new m,Rz=new m,v2e=new m,Vz=new Mp,FE=new Ma;function w2e(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,Rz),d=i.scaleToGeodeticSurface(t,v2e),u=Kc.numberOfPoints(e,t,n),h=i.cartesianToCartographic(c,P5),p=i.cartesianToCartographic(d,W5),g=_oe(u,o,r);Vz.setEndPoints(h,p);let f=Vz.surfaceDistance/u,y=a;h.height=o;let x=i.cartographicToCartesian(h,rg);m.pack(x,s,y),y+=3;for(let S=1;S<u;S++){let C=Vz.interpolateUsingSurfaceDistance(S*f,W5);C.height=g[S],x=i.cartographicToCartesian(C,rg),m.pack(x,s,y),y+=3}return y}function F2e(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,P5),d=i.cartesianToCartographic(t,W5),u=Kc.numberOfPointsRhumbLine(c,d,n);c.height=0,d.height=0;let h=_oe(u,o,r);FE.ellipsoid.equals(i)||(FE=new Ma(void 0,void 0,i)),FE.setEndPoints(c,d);let p=FE.surfaceDistance/u,g=a;c.height=o;let f=i.cartographicToCartesian(c,rg);m.pack(f,s,g),g+=3;for(let y=1;y<u;y++){let x=FE.interpolateUsingSurfaceDistance(y*p,W5);x.height=h[y],f=i.cartographicToCartesian(x,rg),m.pack(f,s,g),g+=3}return g}Kc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??F.IDENTITY;let o=F.inverseTransformation(t,G2e),r=F.multiplyByPoint(o,m.ZERO,E2e),s=m.normalize(F.multiplyByPointAsVector(o,m.UNIT_Y,goe),goe),a=dn.fromPointNormal(r,s,I2e),c=m.normalize(F.multiplyByPointAsVector(o,m.UNIT_X,yoe),yoe),d=dn.fromPointNormal(r,c,X2e),u=1;n.push(m.clone(e[0]));let h=n[0],p=e.length;for(let g=1;g<p;++g){let f=e[g];if(dn.getPointDistance(d,h)<0||dn.getPointDistance(d,f)<0){let y=ei.lineSegmentPlane(h,f,a,W2e);if(l(y)){let x=m.multiplyByScalar(s,5e-9,P2e);dn.getPointDistance(a,h)<0&&m.negate(x,x),n.push(m.add(y,x,new m)),i.push(u+1),m.negate(x,x),n.push(m.add(y,x,new m)),u=1}}n.push(m.clone(e[g])),u++,h=f}i.push(u)}return{positions:n,lengths:i}};Kc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ne.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],Rz);if(o=r?o[0]:o,o!==0){let x=i.geodeticSurfaceNormal(y,rg);m.multiplyByScalar(x,o,x),m.add(y,x,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??X.RADIANS_PER_DEGREE;s=X.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Kc.numberOfPoints(t[c],t[c+1],s);let d=(a+1)*3,u=new Array(d),h=0;for(c=0;c<n-1;c++){let y=t[c],x=t[c+1],S=r?o[c]:o,C=r?o[c+1]:o;h=w2e(y,x,s,i,S,C,u,h)}Lz.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,P5);g.height=r?o[n-1]:o;let f=i.cartographicToCartesian(g,rg);return m.pack(f,u,d-3),u};var xoe=new he,A2e=new he;Kc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ne.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let S=i.scaleToGeodeticSurface(t[0],Rz);if(o=r?o[0]:o,o!==0){let C=i.geodeticSurfaceNormal(S,rg);m.multiplyByScalar(C,o,C),m.add(S,C,S)}return[S.x,S.y,S.z]}let s=e.granularity??X.RADIANS_PER_DEGREE,a=0,c,d=i.cartesianToCartographic(t[0],xoe),u;for(c=0;c<n-1;c++)u=i.cartesianToCartographic(t[c+1],A2e),a+=Kc.numberOfPointsRhumbLine(d,u,s),d=he.clone(u,xoe);let h=(a+1)*3,p=new Array(h),g=0;for(c=0;c<n-1;c++){let S=t[c],C=t[c+1],V=r?o[c]:o,L=r?o[c+1]:o;g=F2e(S,C,s,i,V,L,p,g)}Lz.length=0;let f=t[n-1],y=i.cartesianToCartographic(f,P5);y.height=r?o[n-1]:o;let x=i.cartographicToCartesian(y,rg);return m.pack(x,p,h-3),p};Kc.generateCartesianArc=function(e){let t=Kc.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=m.unpack(t,o*3);return i};Kc.generateCartesianRhumbArc=function(e){let t=Kc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=m.unpack(t,o*3);return i};var wi=Kc;var z8t=_(T(),1);var X8t=_(T(),1);var Toe={};function AE(e,t){l(Toe[e])||(Toe[e]=!0,console.warn(t??e))}AE.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.";AE.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";AE.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";AE.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Vt=AE;var ga=[new m,new m],M2e=new m,N2e=new m,k2e=new m,U2e=new m,D2e=new m,O2e=new m,B2e=new m,Y2e=new m,z2e=new m,EC=new m,v5=new m,ME={},Zz=new he;function H2e(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];Zz=t.cartesianToCartographic(o,Zz),n[i]=Zz.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function Gz(e,t,n,i){let o=e[0],r=e[1],s=m.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),d;if(t===n){for(d=0;d<a;d++)c[d]=t;return c.push(n),c}let h=(n-t)/a;for(d=1;d<a;d++){let p=t+d*h;c[d]=p}return c[0]=t,c.push(n),c}var w5=new m,F5=new m;function K2e(e,t,n,i){let o=new $r(n,i),r=o.projectPointOntoPlane(m.add(n,e,w5),w5),s=o.projectPointOntoPlane(m.add(n,t,F5),F5),a=U.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var J2e=new m(-1,0,0),Mx=new F,Q2e=new F,Ez=new $,j2e=$.IDENTITY.clone(),q2e=new m,$2e=new re,Soe=new m;function Np(e,t,n,i,o,r,s,a){let c=q2e,d=$2e;Mx=Ft.eastNorthUpToFixedFrame(e,o,Mx),c=F.multiplyByPointAsVector(Mx,J2e,c),c=m.normalize(c,c);let u=K2e(c,t,e,o);Ez=$.fromRotationZ(u,Ez),Soe.z=r,Mx=F.multiplyTransformation(Mx,F.fromRotationTranslation(Ez,Soe,Q2e),Mx);let h=j2e;h[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)d=m.fromArray(n,g,d),d=$.multiplyByVector(h,d,d),d=F.multiplyByPoint(Mx,d,d),i.push(d.x,d.y,d.z);return i}var eve=new m;function Iz(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=m.fromArray(e,a,eve);i=Np(c,t,n,i,o,r[a/3],s,1)}return i}function tve(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let d=a.x-r,u=a.y-s;i[o++]=d,i[o++]=0,i[o++]=u,i[o++]=d,i[o++]=0,i[o++]=u}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function Coe(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var Voe=new we,Loe=new m,Roe=new $;function Zoe(e,t,n,i,o,r,s,a,c,d){let u=m.angleBetween(m.subtract(t,e,EC),m.subtract(n,e,v5)),h=i===vi.BEVELED?0:Math.ceil(u/X.toRadians(5)),p;o?p=$.fromQuaternion(we.fromAxisAngle(m.negate(e,EC),u/(h+1),Voe),Roe):p=$.fromQuaternion(we.fromAxisAngle(e,u/(h+1),Voe),Roe);let g,f;if(t=m.clone(t,Loe),h>0){let y=d?2:1;for(let x=0;x<h;x++)t=$.multiplyByVector(p,t,t),g=m.subtract(t,e,EC),g=m.normalize(g,g),o||(g=m.negate(g,g)),f=r.scaleToGeodeticSurface(t,v5),s=Np(f,g,a,s,r,c,1,y)}else g=m.subtract(t,e,EC),g=m.normalize(g,g),o||(g=m.negate(g,g)),f=r.scaleToGeodeticSurface(t,v5),s=Np(f,g,a,s,r,c,1,1),n=m.clone(n,Loe),g=m.subtract(n,e,EC),g=m.normalize(g,g),o||(g=m.negate(g,g)),f=r.scaleToGeodeticSurface(n,v5),s=Np(f,g,a,s,r,c,1,1);return s}ME.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];U.equals(r,s)||n.push(s)}return n};ME.angleIsGreaterThanPi=function(e,t,n,i){let o=new $r(n,i),r=o.projectPointOntoPlane(m.add(n,e,w5),w5),s=o.projectPointOntoPlane(m.add(n,t,F5),F5);return s.x*r.y-s.y*r.x>=0};var nve=new m,ive=new m;ME.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=H2e(e,r),a=i._granularity,c=i._cornerType,d=o?tve(t,n):Coe(t,n),u=o?Coe(t,n):void 0,h=n.height/2,p=n.width/2,g=e.length,f=[],y=o?[]:void 0,x=M2e,S=N2e,C=k2e,V=U2e,L=D2e,Z=O2e,E=B2e,P=Y2e,W=z2e,v=e[0],A=e[1];V=r.geodeticSurfaceNormal(v,V),x=m.subtract(A,v,x),x=m.normalize(x,x),P=m.cross(V,x,P),P=m.normalize(P,P);let b=s[0],R=s[1];o&&(y=Np(v,P,u,y,r,b+h,1,1)),W=m.clone(v,W),v=A,S=m.negate(x,S);let G,I;for(let O=1;O<g-1;O++){let k=o?2:1;if(A=e[O+1],v.equals(A)){Vt("Positions are too close and are considered equivalent with rounding error.");continue}x=m.subtract(A,v,x),x=m.normalize(x,x),V=r.geodeticSurfaceNormal(v,V);let B=m.multiplyByScalar(V,m.dot(x,V),nve);m.subtract(x,B,B),m.normalize(B,B);let N=m.multiplyByScalar(V,m.dot(S,V),ive);if(m.subtract(S,N,N),m.normalize(N,N),!X.equalsEpsilon(Math.abs(m.dot(B,N)),1,X.EPSILON7)){C=m.add(x,S,C),C=m.normalize(C,C),C=m.cross(C,V,C),C=m.cross(V,C,C),C=m.normalize(C,C);let K=1/Math.max(.25,m.magnitude(m.cross(C,S,EC))),te=ME.angleIsGreaterThanPi(x,S,v,r);te?(L=m.add(v,m.multiplyByScalar(C,K*p,C),L),Z=m.add(L,m.multiplyByScalar(P,p,Z),Z),ga[0]=m.clone(W,ga[0]),ga[1]=m.clone(Z,ga[1]),G=Gz(ga,b+h,R+h,a),I=wi.generateArc({positions:ga,granularity:a,ellipsoid:r}),f=Iz(I,P,d,f,r,G,1),P=m.cross(V,x,P),P=m.normalize(P,P),E=m.add(L,m.multiplyByScalar(P,p,E),E),c===vi.ROUNDED||c===vi.BEVELED?Zoe(L,Z,E,c,te,r,f,d,R+h,o):(C=m.negate(C,C),f=Np(v,C,d,f,r,R+h,K,k)),W=m.clone(E,W)):(L=m.add(v,m.multiplyByScalar(C,K*p,C),L),Z=m.add(L,m.multiplyByScalar(P,-p,Z),Z),ga[0]=m.clone(W,ga[0]),ga[1]=m.clone(Z,ga[1]),G=Gz(ga,b+h,R+h,a),I=wi.generateArc({positions:ga,granularity:a,ellipsoid:r}),f=Iz(I,P,d,f,r,G,1),P=m.cross(V,x,P),P=m.normalize(P,P),E=m.add(L,m.multiplyByScalar(P,-p,E),E),c===vi.ROUNDED||c===vi.BEVELED?Zoe(L,Z,E,c,te,r,f,d,R+h,o):f=Np(v,C,d,f,r,R+h,K,k),W=m.clone(E,W)),S=m.negate(x,S)}else f=Np(W,P,d,f,r,b+h,1,1),W=v;b=R,R=s[O+1],v=A}ga[0]=m.clone(W,ga[0]),ga[1]=m.clone(v,ga[1]),G=Gz(ga,b+h,R+h,a),I=wi.generateArc({positions:ga,granularity:a,ellipsoid:r}),f=Iz(I,P,d,f,r,G,1),o&&(y=Np(v,P,u,y,r,R+h,1,1)),g=f.length;let w=o?g+y.length:g,M=new Float64Array(w);return M.set(f),o&&M.set(y,g),M};var Mm=ME;var Wz={},IC=new m,Woe=new m,ove=new m,Goe=new m,Jc=[new m,new m],Poe=new m,voe=new m,woe=new m,rve=new m,sve=new m,ave=new m,cve=new m,lve=new m,dve=new m,uve=new m,Eoe=new we,Ioe=new $;function A5(e,t,n,i,o){let r=m.angleBetween(m.subtract(t,e,IC),m.subtract(n,e,Woe)),s=i===vi.BEVELED?1:Math.ceil(r/X.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let d;o?d=$.fromQuaternion(we.fromAxisAngle(m.negate(e,IC),r/s,Eoe),Ioe):d=$.fromQuaternion(we.fromAxisAngle(e,r/s,Eoe),Ioe);let u=0;t=m.clone(t,IC);for(let h=0;h<s;h++)t=$.multiplyByVector(d,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function mve(e){let t=Poe,n=voe,i=woe,o=e[1];n=m.fromArray(e[1],o.length-3,n),i=m.fromArray(e[0],0,i),t=m.midpoint(n,i,t);let r=A5(t,n,i,vi.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=m.fromArray(a,a.length-3,n),i=m.fromArray(o,0,i),t=m.midpoint(n,i,t);let c=A5(t,n,i,vi.ROUNDED,!1);return[r,c]}function Xoe(e,t,n,i){let o=IC;return i?o=m.add(e,t,o):(t=m.negate(t,t),o=m.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function Xz(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=m.multiplyByScalar(t,n,IC),a=m.negate(s,Woe),c=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let h=m.fromArray(e,u,ove),p=m.add(h,a,Goe);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let g=m.add(h,s,Goe);r[d--]=g.z,r[d--]=g.y,r[d--]=g.x}return i.push(o,r),i}Wz.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var hve=new m,fve=new m;Wz.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Poe,c=voe,d=woe,u=rve,h=sve,p=ave,g=cve,f=lve,y=dve,x=uve,S=[],C=s?[]:void 0,V=s?[]:void 0,L=n[0],Z=n[1];c=m.normalize(m.subtract(Z,L,c),c),a=i.geodeticSurfaceNormal(L,a),u=m.normalize(m.cross(a,c,u),u),s&&(C.push(u.x,u.y,u.z),V.push(a.x,a.y,a.z)),g=m.clone(L,g),L=Z,d=m.negate(c,d);let E,P=[],W,v=n.length;for(W=1;W<v-1;W++){a=i.geodeticSurfaceNormal(L,a),Z=n[W+1],c=m.normalize(m.subtract(Z,L,c),c);let b=m.multiplyByScalar(a,m.dot(c,a),hve);m.subtract(c,b,b),m.normalize(b,b);let R=m.multiplyByScalar(a,m.dot(d,a),fve);if(m.subtract(d,R,R),m.normalize(R,R),!X.equalsEpsilon(Math.abs(m.dot(b,R)),1,X.EPSILON7)){h=m.normalize(m.add(c,d,h),h),h=m.cross(h,a,h),h=m.cross(a,h,h),h=m.normalize(h,h);let I=o/Math.max(.25,m.magnitude(m.cross(h,d,IC))),w=Mm.angleIsGreaterThanPi(c,d,L,i);h=m.multiplyByScalar(h,I,h),w?(f=m.add(L,h,f),x=m.add(f,m.multiplyByScalar(u,o,x),x),y=m.add(f,m.multiplyByScalar(u,o*2,y),y),Jc[0]=m.clone(g,Jc[0]),Jc[1]=m.clone(x,Jc[1]),E=wi.generateArc({positions:Jc,granularity:t,ellipsoid:i}),S=Xz(E,u,o,S),s&&(C.push(u.x,u.y,u.z),V.push(a.x,a.y,a.z)),p=m.clone(y,p),u=m.normalize(m.cross(a,c,u),u),y=m.add(f,m.multiplyByScalar(u,o*2,y),y),g=m.add(f,m.multiplyByScalar(u,o,g),g),r===vi.ROUNDED||r===vi.BEVELED?P.push({leftPositions:A5(f,p,y,r,w)}):P.push({leftPositions:Xoe(L,m.negate(h,h),y,w)})):(y=m.add(L,h,y),x=m.add(y,m.negate(m.multiplyByScalar(u,o,x),x),x),f=m.add(y,m.negate(m.multiplyByScalar(u,o*2,f),f),f),Jc[0]=m.clone(g,Jc[0]),Jc[1]=m.clone(x,Jc[1]),E=wi.generateArc({positions:Jc,granularity:t,ellipsoid:i}),S=Xz(E,u,o,S),s&&(C.push(u.x,u.y,u.z),V.push(a.x,a.y,a.z)),p=m.clone(f,p),u=m.normalize(m.cross(a,c,u),u),f=m.add(y,m.negate(m.multiplyByScalar(u,o*2,f),f),f),g=m.add(y,m.negate(m.multiplyByScalar(u,o,g),g),g),r===vi.ROUNDED||r===vi.BEVELED?P.push({rightPositions:A5(y,p,f,r,w)}):P.push({rightPositions:Xoe(L,h,f,w)})),d=m.negate(c,d)}L=Z}a=i.geodeticSurfaceNormal(L,a),Jc[0]=m.clone(g,Jc[0]),Jc[1]=m.clone(L,Jc[1]),E=wi.generateArc({positions:Jc,granularity:t,ellipsoid:i}),S=Xz(E,u,o,S),s&&(C.push(u.x,u.y,u.z),V.push(a.x,a.y,a.z));let A;return r===vi.ROUNDED&&(A=mve(S)),{positions:S,corners:P,lefts:C,normals:V,endPositions:A}};var Ui=Wz;var Moe=new m,Noe=new m,M5=new m,N5=new m,pve=new m,koe=new m,sg=new m,XC=new m;function Uoe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Nm(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,d=m.normalize(m.cross(n,t,sg),sg);r.normal&&Ui.addAttribute(s,t,i,o),r.tangent&&Ui.addAttribute(a,d,i,o),r.bitangent&&Ui.addAttribute(c,n,i,o)}function Doe(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new pn,d,u=0,h=0,p,g=0,f;for(p=0;p<i.length;p+=2)f=i[p].length-3,u+=f,g+=f*2,h+=i[p+1].length-3;for(u+=3,h+=3,p=0;p<o.length;p++){d=o[p];let ee=o[p].leftPositions;l(ee)?(f=ee.length,u+=f,g+=f):(f=o[p].rightPositions.length,h+=f,g+=f)}let y=l(r),x;y&&(x=r[0].length-3,u+=x,h+=x,x/=3,g+=x*6);let S=u+h,C=new Float64Array(S),V=t.normal?new Float32Array(S):void 0,L=t.tangent?new Float32Array(S):void 0,Z=t.bitangent?new Float32Array(S):void 0,E={normals:V,tangents:L,bitangents:Z},P=0,W=S-1,v,A,b,R,G=Moe,I=Noe,w,M,O=x/2,k=Ne.createTypedArray(S/3,g),B=0;if(y){M=M5,w=N5;let ee=r[0];for(G=m.fromArray(a,0,G),I=m.fromArray(s,0,I),p=0;p<O;p++)M=m.fromArray(ee,(O-1-p)*3,M),w=m.fromArray(ee,(O+p)*3,w),Ui.addAttribute(C,w,P),Ui.addAttribute(C,M,void 0,W),Nm(E,G,I,P,W,t),A=P/3,R=A+1,v=(W-2)/3,b=v-1,k[B++]=v,k[B++]=A,k[B++]=b,k[B++]=b,k[B++]=A,k[B++]=R,P+=3,W-=3}let N=0,z=0,K=i[N++],te=i[N++];C.set(K,P),C.set(te,W-te.length+1),I=m.fromArray(s,z,I);let H,j;for(f=te.length-3,p=0;p<f;p+=3)H=n.geodeticSurfaceNormal(m.fromArray(K,p,sg),sg),j=n.geodeticSurfaceNormal(m.fromArray(te,f-p,XC),XC),G=m.normalize(m.add(H,j,G),G),Nm(E,G,I,P,W,t),A=P/3,R=A+1,v=(W-2)/3,b=v-1,k[B++]=v,k[B++]=A,k[B++]=b,k[B++]=b,k[B++]=A,k[B++]=R,P+=3,W-=3;for(H=n.geodeticSurfaceNormal(m.fromArray(K,f,sg),sg),j=n.geodeticSurfaceNormal(m.fromArray(te,f,XC),XC),G=m.normalize(m.add(H,j,G),G),z+=3,p=0;p<o.length;p++){let ee;d=o[p];let pe=d.leftPositions,_e=d.rightPositions,ae,ye,Se=koe,Ee=M5,Ie=N5;if(G=m.fromArray(a,z,G),l(pe)){for(Nm(E,G,I,void 0,W,t),W-=3,ae=R,ye=b,ee=0;ee<pe.length/3;ee++)Se=m.fromArray(pe,ee*3,Se),k[B++]=ae,k[B++]=ye-ee-1,k[B++]=ye-ee,Ui.addAttribute(C,Se,void 0,W),Ee=m.fromArray(C,(ye-ee-1)*3,Ee),Ie=m.fromArray(C,ae*3,Ie),I=m.normalize(m.subtract(Ee,Ie,I),I),Nm(E,G,I,void 0,W,t),W-=3;Se=m.fromArray(C,ae*3,Se),Ee=m.subtract(m.fromArray(C,ye*3,Ee),Se,Ee),Ie=m.subtract(m.fromArray(C,(ye-ee)*3,Ie),Se,Ie),I=m.normalize(m.add(Ee,Ie,I),I),Nm(E,G,I,P,void 0,t),P+=3}else{for(Nm(E,G,I,P,void 0,t),P+=3,ae=b,ye=R,ee=0;ee<_e.length/3;ee++)Se=m.fromArray(_e,ee*3,Se),k[B++]=ae,k[B++]=ye+ee,k[B++]=ye+ee+1,Ui.addAttribute(C,Se,P),Ee=m.fromArray(C,ae*3,Ee),Ie=m.fromArray(C,(ye+ee)*3,Ie),I=m.normalize(m.subtract(Ee,Ie,I),I),Nm(E,G,I,P,void 0,t),P+=3;Se=m.fromArray(C,ae*3,Se),Ee=m.subtract(m.fromArray(C,(ye+ee)*3,Ee),Se,Ee),Ie=m.subtract(m.fromArray(C,ye*3,Ie),Se,Ie),I=m.normalize(m.negate(m.add(Ie,Ee,I),I),I),Nm(E,G,I,void 0,W,t),W-=3}for(K=i[N++],te=i[N++],K.splice(0,3),te.splice(te.length-3,3),C.set(K,P),C.set(te,W-te.length+1),f=te.length-3,z+=3,I=m.fromArray(s,z,I),ee=0;ee<te.length;ee+=3)H=n.geodeticSurfaceNormal(m.fromArray(K,ee,sg),sg),j=n.geodeticSurfaceNormal(m.fromArray(te,f-ee,XC),XC),G=m.normalize(m.add(H,j,G),G),Nm(E,G,I,P,W,t),R=P/3,A=R-1,b=(W-2)/3,v=b+1,k[B++]=v,k[B++]=A,k[B++]=b,k[B++]=b,k[B++]=A,k[B++]=R,P+=3,W-=3;P-=3,W+=3}if(G=m.fromArray(a,a.length-3,G),Nm(E,G,I,P,W,t),y){P+=3,W-=3,M=M5,w=N5;let ee=r[1];for(p=0;p<O;p++)M=m.fromArray(ee,(x-p-1)*3,M),w=m.fromArray(ee,p*3,w),Ui.addAttribute(C,M,void 0,W),Ui.addAttribute(C,w,P),Nm(E,G,I,P,W,t),R=P/3,A=R-1,b=(W-2)/3,v=b+1,k[B++]=v,k[B++]=A,k[B++]=b,k[B++]=b,k[B++]=A,k[B++]=R,P+=3,W-=3}if(c.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:C}),t.st){let ee=new Float32Array(S/3*2),pe,_e,ae=0;if(y){u/=3,h/=3;let ye=Math.PI/(x+1);_e=1/(u-x+1),pe=1/(h-x+1);let Se,Ee=x/2;for(p=Ee+1;p<x+1;p++)Se=X.PI_OVER_TWO+ye*p,ee[ae++]=pe*(1+Math.cos(Se)),ee[ae++]=.5*(1+Math.sin(Se));for(p=1;p<h-x+1;p++)ee[ae++]=p*pe,ee[ae++]=0;for(p=x;p>Ee;p--)Se=X.PI_OVER_TWO-p*ye,ee[ae++]=1-pe*(1+Math.cos(Se)),ee[ae++]=.5*(1+Math.sin(Se));for(p=Ee;p>0;p--)Se=X.PI_OVER_TWO-ye*p,ee[ae++]=1-_e*(1+Math.cos(Se)),ee[ae++]=.5*(1+Math.sin(Se));for(p=u-x;p>0;p--)ee[ae++]=p*_e,ee[ae++]=1;for(p=1;p<Ee+1;p++)Se=X.PI_OVER_TWO+ye*p,ee[ae++]=_e*(1+Math.cos(Se)),ee[ae++]=.5*(1+Math.sin(Se))}else{for(u/=3,h/=3,_e=1/(u-1),pe=1/(h-1),p=0;p<h;p++)ee[ae++]=p*pe,ee[ae++]=0;for(p=u;p>0;p--)ee[ae++]=(p-1)*_e,ee[ae++]=1}c.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(c.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:E.normals})),t.tangent&&(c.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:E.tangents})),t.bitangent&&(c.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:E.bitangents})),{attributes:c,indices:k}}function bve(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,h=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Moe,f=Noe,y=M5,x=N5,S=pve,C=koe,V=c;for(d=0;d<s;d+=3){let L=V+c;g=m.fromArray(n,d,g),f=m.fromArray(n,d+s,f),y=m.fromArray(n,(d+3)%s,y),f=m.subtract(f,g,f),y=m.subtract(y,g,y),x=m.normalize(m.cross(f,y,x),x),t.normal&&(Ui.addAttribute(u,x,L),Ui.addAttribute(u,x,L+3),Ui.addAttribute(u,x,V),Ui.addAttribute(u,x,V+3)),(t.tangent||t.bitangent)&&(C=m.fromArray(i,d,C),t.bitangent&&(Ui.addAttribute(p,C,L),Ui.addAttribute(p,C,L+3),Ui.addAttribute(p,C,V),Ui.addAttribute(p,C,V+3)),t.tangent&&(S=m.normalize(m.cross(C,x,S),S),Ui.addAttribute(h,S,L),Ui.addAttribute(h,S,L+3),Ui.addAttribute(h,S,V),Ui.addAttribute(h,S,V+3))),V+=6}if(t.normal){for(u.set(i),d=0;d<s;d+=3)u[d+s]=-i[d],u[d+s+1]=-i[d+1],u[d+s+2]=-i[d+2];e.normal.values=u}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let L=e.tangent.values;h.set(L),h.set(L,s),e.tangent.values=h}}if(t.st){let u=e.st.values,h=new Float32Array(a*6);h.set(u),h.set(u,a);let p=a*2;for(let g=0;g<2;g++){for(h[p++]=u[0],h[p++]=u[1],d=2;d<a;d+=2){let f=u[d],y=u[d+1];h[p++]=f,h[p++]=y,h[p++]=f,h[p++]=y}h[p++]=u[0],h[p++]=u[1]}e.st.values=h}return e}function Pz(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function gve(e,t){let n=new Xe({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=Ui.computePositions(e),r=Doe(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,d=r.indices,u=c.position.values,h=u.length,p=new Float64Array(h*6),g=new Float64Array(h);g.set(u);let f=new Float64Array(h*4);u=ri.scaleToGeodeticHeight(u,s,i),f=Pz(u,0,f),g=ri.scaleToGeodeticHeight(g,a,i),f=Pz(g,h*2,f),p.set(u),p.set(g,h),p.set(f,h*2),c.position.values=p,c=bve(c,t);let y,x=h/3;if(e.shadowVolume){let v=c.normal.values;h=v.length;let A=new Float32Array(h*6);for(y=0;y<h;y++)v[y]=-v[y];A.set(v,h),A=Pz(v,h*4,A),c.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:A}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let v=new Uint8Array(x*6);if(e.offsetAttribute===ln.TOP)v=v.fill(1,0,x).fill(1,x*2,x*4);else{let A=e.offsetAttribute===ln.NONE?0:1;v=v.fill(A)}c.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})}let S=d.length,C=x+x,V=Ne.createTypedArray(p.length/3,S*2+C*3);V.set(d);let L=S;for(y=0;y<S;y+=3){let v=d[y],A=d[y+1],b=d[y+2];V[L++]=b+x,V[L++]=A+x,V[L++]=v+x}let Z,E,P,W;for(y=0;y<C;y+=2)Z=y+C,E=Z+C,P=Z+1,W=E+1,V[L++]=Z,V[L++]=E,V[L++]=P,V[L++]=P,V[L++]=E,V[L++]=W;return{attributes:c,indices:V}}var Foe=new m,NE=new m,Ru=new he;function Aoe(e,t,n,i,o,r){let s=m.subtract(t,e,Foe);m.normalize(s,s);let a=n.geodeticSurfaceNormal(e,NE),c=m.cross(s,a,Foe);m.multiplyByScalar(c,i,c);let d=o.latitude,u=o.longitude,h=r.latitude,p=r.longitude;m.add(e,c,NE),n.cartesianToCartographic(NE,Ru);let g=Ru.latitude,f=Ru.longitude;d=Math.min(d,g),u=Math.min(u,f),h=Math.max(h,g),p=Math.max(p,f),m.subtract(e,c,NE),n.cartesianToCartographic(NE,Ru),g=Ru.latitude,f=Ru.longitude,d=Math.min(d,g),u=Math.min(u,f),h=Math.max(h,g),p=Math.max(p,f),o.latitude=d,o.longitude=u,r.latitude=h,r.longitude=p}var Lu=new m,kE=new m,Pl=new he,vl=new he;function Ooe(e,t,n,i,o){e=Uoe(e,t);let r=Co(e,m.equalsEpsilon),s=r.length;if(s<2||n<=0)return new le;let a=n*.5;Pl.latitude=Number.POSITIVE_INFINITY,Pl.longitude=Number.POSITIVE_INFINITY,vl.latitude=Number.NEGATIVE_INFINITY,vl.longitude=Number.NEGATIVE_INFINITY;let c,d;if(i===vi.ROUNDED){let p=r[0];m.subtract(p,r[1],Lu),m.normalize(Lu,Lu),m.multiplyByScalar(Lu,a,Lu),m.add(p,Lu,kE),t.cartesianToCartographic(kE,Ru),c=Ru.latitude,d=Ru.longitude,Pl.latitude=Math.min(Pl.latitude,c),Pl.longitude=Math.min(Pl.longitude,d),vl.latitude=Math.max(vl.latitude,c),vl.longitude=Math.max(vl.longitude,d)}for(let p=0;p<s-1;++p)Aoe(r[p],r[p+1],t,a,Pl,vl);let u=r[s-1];m.subtract(u,r[s-2],Lu),m.normalize(Lu,Lu),m.multiplyByScalar(Lu,a,Lu),m.add(u,Lu,kE),Aoe(u,kE,t,a,Pl,vl),i===vi.ROUNDED&&(t.cartesianToCartographic(kE,Ru),c=Ru.latitude,d=Ru.longitude,Pl.latitude=Math.min(Pl.latitude,c),Pl.longitude=Math.min(Pl.longitude,d),vl.latitude=Math.max(vl.latitude,c),vl.longitude=Math.max(vl.longitude,d));let h=l(o)?o:new le;return h.north=vl.latitude,h.south=Pl.latitude,h.east=vl.longitude,h.west=Pl.longitude,h}function Up(e){e=e??Y.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._vertexFormat=Xe.clone(e.vertexFormat??Xe.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??vi.ROUNDED,this._granularity=e.granularity??X.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*m.packedLength+ne.packedLength+Xe.packedLength+7}Up.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=m.packedLength)m.pack(i[r],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.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 Boe=ne.clone(ne.UNIT_SPHERE),Yoe=new Xe,kp={positions:void 0,ellipsoid:Boe,vertexFormat:Yoe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Up.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let f=0;f<i;++f,t+=m.packedLength)o[f]=m.unpack(e,t);let r=ne.unpack(e,t,Boe);t+=ne.packedLength;let s=Xe.unpack(e,t,Yoe);t+=Xe.packedLength;let a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=o,n._ellipsoid=ne.clone(r,n._ellipsoid),n._vertexFormat=Xe.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=d,n._cornerType=u,n._granularity=h,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(kp.positions=o,kp.width=a,kp.height=c,kp.extrudedHeight=d,kp.cornerType=u,kp.granularity=h,kp.shadowVolume=p,kp.offsetAttribute=g===-1?void 0:g,new Up(kp))};Up.computeRectangle=function(e,t){e=e??Y.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??ne.default,r=e.cornerType??vi.ROUNDED;return Ooe(n,o,i,r,t)};Up.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Uoe(t,i);let o=Co(t,m.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!X.equalsEpsilon(r,s,0,X.EPSILON2),c=e._vertexFormat,d={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},u;if(a)d.height=r,d.extrudedHeight=s,d.shadowVolume=e._shadowVolume,d.offsetAttribute=e._offsetAttribute,u=gve(d,c);else{let g=Ui.computePositions(d);if(u=Doe(g,c,i),u.attributes.position.values=ri.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let f=e._offsetAttribute===ln.NONE?0:1,y=u.attributes.position.values.length,x=new Uint8Array(y/3).fill(f);u.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let h=u.attributes,p=de.fromVertices(h.position.values,void 0,3);return c.position||(u.attributes.position.values=void 0),new ht({attributes:h,indices:u.indices,primitiveType:Ae.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Up.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Up({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Up.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Ooe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var Nx=Up;var O7t=_(T(),1);var zoe=new m,Hoe=new m,yve=new m;function xve(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Koe(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new pn,a,c=0,d=0,u,h=0,p;for(u=0;u<i.length;u+=2)p=i[u].length-3,c+=p,h+=p/3*4,d+=i[u+1].length-3;for(c+=3,d+=3,u=0;u<o.length;u++){a=o[u];let w=o[u].leftPositions;l(w)?(p=w.length,c+=p,h+=p/3*2):(p=o[u].rightPositions.length,d+=p,h+=p/3*2)}let g=l(r),f;g&&(f=r[0].length-3,c+=f,d+=f,f/=3,h+=f*4);let y=c+d,x=new Float64Array(y),S=0,C=y-1,V,L,Z,E,P,W,v=f/2,A=Ne.createTypedArray(y/3,h+4),b=0;if(A[b++]=S/3,A[b++]=(C-2)/3,g){n.push(S/3),W=zoe,P=Hoe;let w=r[0];for(u=0;u<v;u++)W=m.fromArray(w,(v-1-u)*3,W),P=m.fromArray(w,(v+u)*3,P),Ui.addAttribute(x,P,S),Ui.addAttribute(x,W,void 0,C),L=S/3,E=L+1,V=(C-2)/3,Z=V-1,A[b++]=V,A[b++]=Z,A[b++]=L,A[b++]=E,S+=3,C-=3}let R=0,G=i[R++],I=i[R++];for(x.set(G,S),x.set(I,C-I.length+1),p=I.length-3,n.push(S/3,(C-2)/3),u=0;u<p;u+=3)L=S/3,E=L+1,V=(C-2)/3,Z=V-1,A[b++]=V,A[b++]=Z,A[b++]=L,A[b++]=E,S+=3,C-=3;for(u=0;u<o.length;u++){let w;a=o[u];let M=a.leftPositions,O=a.rightPositions,k,B=yve;if(l(M)){for(C-=3,k=Z,n.push(E),w=0;w<M.length/3;w++)B=m.fromArray(M,w*3,B),A[b++]=k-w-1,A[b++]=k-w,Ui.addAttribute(x,B,void 0,C),C-=3;n.push(k-Math.floor(M.length/6)),t===vi.BEVELED&&n.push((C-2)/3+1),S+=3}else{for(S+=3,k=E,n.push(Z),w=0;w<O.length/3;w++)B=m.fromArray(O,w*3,B),A[b++]=k+w,A[b++]=k+w+1,Ui.addAttribute(x,B,S),S+=3;n.push(k+Math.floor(O.length/6)),t===vi.BEVELED&&n.push(S/3-1),C-=3}for(G=i[R++],I=i[R++],G.splice(0,3),I.splice(I.length-3,3),x.set(G,S),x.set(I,C-I.length+1),p=I.length-3,w=0;w<I.length;w+=3)E=S/3,L=E-1,Z=(C-2)/3,V=Z+1,A[b++]=V,A[b++]=Z,A[b++]=L,A[b++]=E,S+=3,C-=3;S-=3,C+=3,n.push(S/3,(C-2)/3)}if(g){S+=3,C-=3,W=zoe,P=Hoe;let w=r[1];for(u=0;u<v;u++)W=m.fromArray(w,(f-u-1)*3,W),P=m.fromArray(w,u*3,P),Ui.addAttribute(x,W,void 0,C),Ui.addAttribute(x,P,S),E=S/3,L=E-1,Z=(C-2)/3,V=Z+1,A[b++]=V,A[b++]=Z,A[b++]=L,A[b++]=E,S+=3,C-=3;n.push(S/3)}else n.push(S/3,(C-2)/3);return A[b++]=S/3,A[b++]=(C-2)/3,s.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:x}),{attributes:s,indices:A,wallIndices:n}}function _ve(e){let t=e.ellipsoid,n=Ui.computePositions(e),i=Koe(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,d=a.position.values,u=d.length,h=new Float64Array(u);h.set(d);let p=new Float64Array(u*2);if(d=ri.scaleToGeodeticHeight(d,r,t),h=ri.scaleToGeodeticHeight(h,s,t),p.set(d),p.set(h,u),a.position.values=p,u/=3,l(e.offsetAttribute)){let V=new Uint8Array(u*2);if(e.offsetAttribute===ln.TOP)V=V.fill(1,0,u);else{let L=e.offsetAttribute===ln.NONE?0:1;V=V.fill(L)}a.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}let g,f=c.length,y=Ne.createTypedArray(p.length/3,(f+o.length)*2);y.set(c);let x=f;for(g=0;g<f;g+=2){let V=c[g],L=c[g+1];y[x++]=V+u,y[x++]=L+u}let S,C;for(g=0;g<o.length;g++)S=o[g],C=S+u,y[x++]=S,y[x++]=C;return{attributes:a,indices:y}}function UE(e){e=e??Y.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??vi.ROUNDED,this._granularity=e.granularity??X.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*m.packedLength+ne.packedLength+6}UE.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=m.packedLength)m.pack(i[r],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.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 Joe=ne.clone(ne.UNIT_SPHERE),ag={positions:void 0,ellipsoid:Joe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};UE.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=m.packedLength)o[p]=m.unpack(e,t);let r=ne.unpack(e,t,Joe);t+=ne.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t];return l(n)?(n._positions=o,n._ellipsoid=ne.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=d,n._granularity=u,n._offsetAttribute=h===-1?void 0:h,n):(ag.positions=o,ag.width=s,ag.height=a,ag.extrudedHeight=c,ag.cornerType=d,ag.granularity=u,ag.offsetAttribute=h===-1?void 0:h,new UE(ag))};UE.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=xve(t,i);let o=Co(t,m.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!X.equalsEpsilon(r,s,0,X.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},d;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,d=_ve(c);else{let p=Ui.computePositions(c);if(d=Koe(p,c.cornerType),d.attributes.position.values=ri.scaleToGeodeticHeight(d.attributes.position.values,r,i),l(e._offsetAttribute)){let g=d.attributes.position.values.length,f=e._offsetAttribute===ln.NONE?0:1,y=new Uint8Array(g/3).fill(f);d.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let u=d.attributes,h=de.fromVertices(u.position.values,void 0,3);return new ht({attributes:u,indices:d.indices,primitiveType:Ae.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var DE=UE;var H7t=_(T(),1);function Tve(e){return e=e??Y.EMPTY_OBJECT,Xx.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var OE=Tve;var q7t=_(T(),1);function Sve(e){return e=e??Y.EMPTY_OBJECT,Xx.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ne.WGS84})}var kx=Sve;var c6t=_(T(),1);function WC(e){e=e??Y.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??ne.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=es.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new Gt(n)),this._credit=n}Object.defineProperties(WC.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}}});WC.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Fa({buffer:c,width:r,height:s})})};WC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};WC.prototype.getTileDataAvailable=function(e,t,n){};WC.prototype.loadTileDataAvailability=function(e,t,n){};var vz=WC;var G6t=_(T(),1);var u6t=_(T(),1);var Qoe={};Qoe.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,d=new Float64Array(c*3),u,h=0,p=0,g=o?a*3:0,f=o?(a+i)*3:i*3;for(u=0;u<i;u++){let y=u/i*X.TWO_PI,x=Math.cos(y),S=Math.sin(y),C=x*n,V=S*n,L=x*t,Z=S*t;d[p+g]=C,d[p+g+1]=V,d[p+g+2]=s,d[p+f]=L,d[p+f+1]=Z,d[p+f+2]=r,p+=3,o&&(d[h++]=C,d[h++]=V,d[h++]=s,d[h++]=L,d[h++]=Z,d[h++]=r)}return d};var Ux=Qoe;var wz=new U,Cve=new m,Vve=new m,Lve=new m,Rve=new m;function Dp(e){e=e??Y.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??Xe.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Xe.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Dp.packedLength=Xe.packedLength+5;Dp.pack=function(e,t,n){return n=n??0,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var joe=new Xe,PC={vertexFormat:joe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Dp.unpack=function(e,t,n){t=t??0;let i=Xe.unpack(e,t,joe);t+=Xe.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Xe.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(PC.length=o,PC.topRadius=r,PC.bottomRadius=s,PC.slices=a,PC.offsetAttribute=c===-1?void 0:c,new Dp(PC))};Dp.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,d=Ux.computePositions(t,n,i,r,!0),u=o.st?new Float32Array(c*2):void 0,h=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,g=o.bitangent?new Float32Array(c*3):void 0,f,y=o.normal||o.tangent||o.bitangent;if(y){let P=o.tangent||o.bitangent,W=0,v=0,A=0,b=Math.atan2(i-n,t),R=Cve;R.z=Math.sin(b);let G=Math.cos(b),I=Lve,w=Vve;for(f=0;f<r;f++){let M=f/r*X.TWO_PI,O=G*Math.cos(M),k=G*Math.sin(M);y&&(R.x=O,R.y=k,P&&(I=m.normalize(m.cross(m.UNIT_Z,R,I),I)),o.normal&&(h[W++]=R.x,h[W++]=R.y,h[W++]=R.z,h[W++]=R.x,h[W++]=R.y,h[W++]=R.z),o.tangent&&(p[v++]=I.x,p[v++]=I.y,p[v++]=I.z,p[v++]=I.x,p[v++]=I.y,p[v++]=I.z),o.bitangent&&(w=m.normalize(m.cross(R,I,w),w),g[A++]=w.x,g[A++]=w.y,g[A++]=w.z,g[A++]=w.x,g[A++]=w.y,g[A++]=w.z))}for(f=0;f<r;f++)o.normal&&(h[W++]=0,h[W++]=0,h[W++]=-1),o.tangent&&(p[v++]=1,p[v++]=0,p[v++]=0),o.bitangent&&(g[A++]=0,g[A++]=-1,g[A++]=0);for(f=0;f<r;f++)o.normal&&(h[W++]=0,h[W++]=0,h[W++]=1),o.tangent&&(p[v++]=1,p[v++]=0,p[v++]=0),o.bitangent&&(g[A++]=0,g[A++]=1,g[A++]=0)}let x=12*r-12,S=Ne.createTypedArray(c,x),C=0,V=0;for(f=0;f<r-1;f++)S[C++]=V,S[C++]=V+2,S[C++]=V+3,S[C++]=V,S[C++]=V+3,S[C++]=V+1,V+=2;for(S[C++]=s-2,S[C++]=0,S[C++]=1,S[C++]=s-2,S[C++]=1,S[C++]=s-1,f=1;f<r-1;f++)S[C++]=s+f+1,S[C++]=s+f,S[C++]=s;for(f=1;f<r-1;f++)S[C++]=a,S[C++]=a+f,S[C++]=a+f+1;let L=0;if(o.st){let P=Math.max(n,i);for(f=0;f<c;f++){let W=m.fromArray(d,f*3,Rve);u[L++]=(W.x+P)/(2*P),u[L++]=(W.y+P)/(2*P)}}let Z=new pn;o.position&&(Z.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})),o.normal&&(Z.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(Z.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(Z.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(Z.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),wz.x=t*.5,wz.y=Math.max(i,n);let E=new de(m.ZERO,U.magnitude(wz));if(l(e._offsetAttribute)){t=d.length;let P=e._offsetAttribute===ln.NONE?0:1,W=new Uint8Array(t/3).fill(P);Z.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:W})}return new ht({attributes:Z,indices:S,primitiveType:Ae.TRIANGLES,boundingSphere:E,offsetAttribute:e._offsetAttribute})};var Fz;Dp.getUnitCylinder=function(){return l(Fz)||(Fz=Dp.createGeometry(new Dp({topRadius:1,bottomRadius:1,length:1,vertexFormat:Xe.POSITION_ONLY}))),Fz};var BE=Dp;var O6t=_(T(),1);var Az=new U;function vC(e){e=e??Y.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"}vC.packedLength=6;vC.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 Dx={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};vC.unpack=function(e,t,n){t=t??0;let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(Dx.length=i,Dx.topRadius=o,Dx.bottomRadius=r,Dx.slices=s,Dx.numberOfVerticalLines=a,Dx.offsetAttribute=c===-1?void 0:c,new vC(Dx))};vC.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=Ux.computePositions(t,n,i,o,!1),c=o*2,d;if(r>0){let y=Math.min(r,o);d=Math.round(o/y),c+=y}let u=Ne.createTypedArray(s,c*2),h=0,p;for(p=0;p<o-1;p++)u[h++]=p,u[h++]=p+1,u[h++]=p+o,u[h++]=p+1+o;if(u[h++]=o-1,u[h++]=0,u[h++]=o+o-1,u[h++]=o,r>0)for(p=0;p<o;p+=d)u[h++]=p,u[h++]=p+o;let g=new pn;g.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:a}),Az.x=t*.5,Az.y=Math.max(i,n);let f=new de(m.ZERO,U.magnitude(Az));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===ln.NONE?0:1,x=new Uint8Array(t/3).fill(y);g.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}return new ht({attributes:g,indices:u,primitiveType:Ae.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var YE=vC;var z6t=_(T(),1);var Zve=1953029805,Gve=2917034100;function Mz(e,t){if(Mz.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new ce("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===Zve||o===Gve)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,d=n,u,h=8;for(;s<c;)for(h=(h+8)%24,u=h;s<c&&u<d;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=d&&(h=(h+8)%24,u=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}Mz.passThroughDataForTesting=!1;var zE=Mz;var q6t=_(T(),1);var Nz=32767,Eve=new he,Ive=new m;function Xve(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);Fn.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let h=s[u],p=a[u],g=c[u],f=X.lerp(t.west,t.east,h/Nz),y=X.lerp(t.south,t.north,p/Nz),x=X.lerp(n,i,g/Nz),S=he.fromRadians(f,y,x,Eve),C=o.cartographicToCartesian(S,Ive);m.pack(C,d,u*3)}return d}var HE=Xve;var eqt=_(T(),1);function qoe(e){this.proxy=e}qoe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var kz=qoe;var aqt=_(T(),1);var iqt=_(T(),1);function Wve(e,t){Vt(e,t)}var Is=Wve;function $oe(e,t){return Is("defaultValue","defaultValue has been deprecated and will be removed in Cesium 1.134. Use the nullish coalescing operator instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing"),e??t}Object.defineProperty($oe,"EMPTY_OBJECT",{get:function(){return Is("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),Y.EMPTY_OBJECT}});var Uz=$oe;var dqt=_(T(),1);function bd(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(bd.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}}});bd.packedLength=2;bd.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};bd.unpack=function(e,t,n){return t=t??0,l(n)||(n=new bd),n.near=e[t++],n.far=e[t],n};bd.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};bd.clone=function(e,t){if(l(e))return l(t)||(t=new bd),t.near=e.near,t.far=e.far,t};bd.prototype.clone=function(e){return bd.clone(this,e)};bd.prototype.equals=function(e){return bd.equals(this,e)};var At=bd;var fqt=_(T(),1);function KE(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(KE.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});KE.fromDistanceDisplayCondition=function(e){return new KE(e.near,e.far)};KE.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Dn=KE;var yqt=_(T(),1);function km(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(km.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}}});km.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new km({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};km.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};km.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)ere(this,t)};km.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++,ere(this,i),t};km.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],tre(this,0)),this._array[e-1]=void 0,t};km.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=Dz(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&tre(this,n)}return this._array[e-1]=void 0,t};km.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};km.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Dz(this,1,2)?1:2]};function k5(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function JE(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Dz(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function ere(e,t){if(t===0)return;let n=Math.floor(X.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=JE(e,t,i);for(o!==n&&(k5(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(JE(e,t,r)!==o)break;k5(e,t,r),t=r}}function tre(e,t){let n=e._length,i=Math.floor(X.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){JE(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let d=0;d<c;d++){let u=a+d;JE(e,u,r)===i&&(r=u)}}if(JE(e,r,t)===i&&(k5(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);Dz(e,r,a)===i&&k5(e,r,a)}t=r}}var Ox=km;var Tqt=_(T(),1);function QE(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(QE.prototype,{length:{get:function(){return this._length}}});function Pve(e,t,n){this.item=e,this.previous=t,this.next=n}QE.prototype.add=function(e){let t=new Pve(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 nre(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}QE.prototype.remove=function(e){l(e)&&(nre(this,e),--this._length)};QE.prototype.splice=function(e,t){if(e===t)return;nre(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 jE=QE;var Wqt=_(T(),1);var Eqt=_(T(),1),Fi=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-Fi.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?Fi.Bounce.In(e*2)*.5:Fi.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}}}}),qE=function(){return performance.now()},vve=function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=qE()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e}(),wC={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=wC.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=wC.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=wC.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=wC.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},ire=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Oz=new vve,ore=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=Fi.Linear.None,this._interpolationFunction=wC.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ire.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=Oz,Oz.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=qE()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),d=c?"array":typeof a,u=!c&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var h=i[s];if(h.length===0)continue;for(var p=[a],g=0,f=h.length;g<f;g+=1){var y=this._handleRelativeValue(a,h[g]);if(isNaN(y)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}u&&(i[s]=p)}if((d==="object"||c)&&a&&!u){n[s]=c?[]:{};var x=a;for(var S in x)n[s][S]=x[S];o[s]=c?[]:{};var h=i[s];if(!this._isDynamic){var C={};for(var S in h)C[S]=h[S];i[s]=h=C}this._setupProperties(x,n[s],h,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=qE()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=qE()),!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=Fi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=wC.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=qE()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,d=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),x=s-y*a,S=Math.min(x/i._duration,1);return S===0&&s===i._duration?1:S},u=d(),h=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,f=this._chainedTweens.length;g<f;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),d=Array.isArray(a),u=!c&&d;u?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var Sqt=ire.nextId,gf=Oz,Cqt=gf.getAll.bind(gf),Vqt=gf.removeAll.bind(gf),Lqt=gf.add.bind(gf),Rqt=gf.remove.bind(gf),Zqt=gf.update.bind(gf);var wve={LINEAR_NONE:Fi.Linear.None,QUADRATIC_IN:Fi.Quadratic.In,QUADRATIC_OUT:Fi.Quadratic.Out,QUADRATIC_IN_OUT:Fi.Quadratic.InOut,CUBIC_IN:Fi.Cubic.In,CUBIC_OUT:Fi.Cubic.Out,CUBIC_IN_OUT:Fi.Cubic.InOut,QUARTIC_IN:Fi.Quartic.In,QUARTIC_OUT:Fi.Quartic.Out,QUARTIC_IN_OUT:Fi.Quartic.InOut,QUINTIC_IN:Fi.Quintic.In,QUINTIC_OUT:Fi.Quintic.Out,QUINTIC_IN_OUT:Fi.Quintic.InOut,SINUSOIDAL_IN:Fi.Sinusoidal.In,SINUSOIDAL_OUT:Fi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Fi.Sinusoidal.InOut,EXPONENTIAL_IN:Fi.Exponential.In,EXPONENTIAL_OUT:Fi.Exponential.Out,EXPONENTIAL_IN_OUT:Fi.Exponential.InOut,CIRCULAR_IN:Fi.Circular.In,CIRCULAR_OUT:Fi.Circular.Out,CIRCULAR_IN_OUT:Fi.Circular.InOut,ELASTIC_IN:Fi.Elastic.In,ELASTIC_OUT:Fi.Elastic.Out,ELASTIC_IN_OUT:Fi.Elastic.InOut,BACK_IN:Fi.Back.In,BACK_OUT:Fi.Back.Out,BACK_IN_OUT:Fi.Back.InOut,BOUNCE_IN:Fi.Bounce.In,BOUNCE_OUT:Fi.Bounce.Out,BOUNCE_IN_OUT:Fi.Bounce.InOut},kr=Object.freeze(wve);var Jqt=_(T(),1);var Fve=new m,Ave=new m,Mve=new m,Nve=new m,kve=new m,Uve=new m(1,1,1),rre=Math.cos,sre=Math.sin;function Op(e){e=e??Y.EMPTY_OBJECT;let t=e.radii??Uve,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??X.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??X.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),d=e.vertexFormat??Xe.DEFAULT;this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Xe.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Op.packedLength=2*m.packedLength+Xe.packedLength+7;Op.pack=function(e,t,n){return n=n??0,m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.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 are=new m,cre=new m,lre=new Xe,cg={radii:are,innerRadii:cre,vertexFormat:lre,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Op.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,are);t+=m.packedLength;let o=m.unpack(e,t,cre);t+=m.packedLength;let r=Xe.unpack(e,t,lre);t+=Xe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=d,n._stackPartitions=u,n._slicePartitions=h,n._offsetAttribute=p===-1?void 0:p,n):(cg.minimumClock=s,cg.maximumClock=a,cg.minimumCone=c,cg.maximumCone=d,cg.stackPartitions=u,cg.slicePartitions=h,cg.offsetAttribute=p===-1?void 0:p,new Op(cg))};Op.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,d=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/X.TWO_PI),d=Math.round(d*Math.abs(s-r)/X.PI),c<2&&(c=2),d<2&&(d=2);let u,h,p=0,g=[r],f=[i];for(u=0;u<d;u++)g.push(r+u*(s-r)/(d-1));for(g.push(s),h=0;h<c;h++)f.push(i+h*(o-i)/(c-1));f.push(o);let y=g.length,x=f.length,S=0,C=1,V=n.x!==t.x||n.y!==t.y||n.z!==t.z,L=!1,Z=!1,E=!1;V&&(C=2,r>0&&(L=!0,S+=c-1),s<Math.PI&&(Z=!0,S+=c-1),(o-i)%X.TWO_PI?(E=!0,S+=(d-1)*2+1):S+=1);let P=x*y*C,W=new Float64Array(P*3),v=new Array(P).fill(!1),A=new Array(P).fill(!1),b=c*d*C,R=6*(b+S+1-(c+d)*C),G=Ne.createTypedArray(b,R),I=a.normal?new Float32Array(P*3):void 0,w=a.tangent?new Float32Array(P*3):void 0,M=a.bitangent?new Float32Array(P*3):void 0,O=a.st?new Float32Array(P*2):void 0,k=new Array(y),B=new Array(y);for(u=0;u<y;u++)k[u]=sre(g[u]),B[u]=rre(g[u]);let N=new Array(x),z=new Array(x);for(h=0;h<x;h++)z[h]=rre(f[h]),N[h]=sre(f[h]);for(u=0;u<y;u++)for(h=0;h<x;h++)W[p++]=t.x*k[u]*z[h],W[p++]=t.y*k[u]*N[h],W[p++]=t.z*B[u];let K=P/2;if(V)for(u=0;u<y;u++)for(h=0;h<x;h++)W[p++]=n.x*k[u]*z[h],W[p++]=n.y*k[u]*N[h],W[p++]=n.z*B[u],v[K]=!0,u>0&&u!==y-1&&h!==0&&h!==x-1&&(A[K]=!0),K++;p=0;let te,H;for(u=1;u<y-2;u++)for(te=u*x,H=(u+1)*x,h=1;h<x-2;h++)G[p++]=H+h,G[p++]=H+h+1,G[p++]=te+h+1,G[p++]=H+h,G[p++]=te+h+1,G[p++]=te+h;if(V){let ct=y*x;for(u=1;u<y-2;u++)for(te=ct+u*x,H=ct+(u+1)*x,h=1;h<x-2;h++)G[p++]=H+h,G[p++]=te+h,G[p++]=te+h+1,G[p++]=H+h,G[p++]=te+h+1,G[p++]=H+h+1}let j,ee;if(V){if(L)for(ee=y*x,u=1;u<x-2;u++)G[p++]=u,G[p++]=u+1,G[p++]=ee+u+1,G[p++]=u,G[p++]=ee+u+1,G[p++]=ee+u;if(Z)for(j=y*x-x,ee=y*x*C-x,u=1;u<x-2;u++)G[p++]=j+u+1,G[p++]=j+u,G[p++]=ee+u,G[p++]=j+u+1,G[p++]=ee+u,G[p++]=ee+u+1}if(E){for(u=1;u<y-2;u++)ee=x*y+x*u,j=x*u,G[p++]=ee,G[p++]=j+x,G[p++]=j,G[p++]=ee,G[p++]=ee+x,G[p++]=j+x;for(u=1;u<y-2;u++)ee=x*y+x*(u+1)-1,j=x*(u+1)-1,G[p++]=j+x,G[p++]=ee,G[p++]=j,G[p++]=j+x,G[p++]=ee+x,G[p++]=ee}let pe=new pn;a.position&&(pe.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:W}));let _e=0,ae=0,ye=0,Se=0,Ee=P/2,Ie,Fe=ne.fromCartesian3(t),ve=ne.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<P;u++){Ie=v[u]?ve:Fe;let ct=m.fromArray(W,u*3,Fve),Je=Ie.geodeticSurfaceNormal(ct,Ave);if(A[u]&&m.negate(Je,Je),a.st){let bt=U.negate(Je,kve);O[_e++]=Math.atan2(bt.y,bt.x)/X.TWO_PI+.5,O[_e++]=Math.asin(Je.z)/Math.PI+.5}if(a.normal&&(I[ae++]=Je.x,I[ae++]=Je.y,I[ae++]=Je.z),a.tangent||a.bitangent){let bt=Mve,Qe=0,Tt;if(v[u]&&(Qe=Ee),!L&&u>=Qe&&u<Qe+x*2?Tt=m.UNIT_X:Tt=m.UNIT_Z,m.cross(Tt,Je,bt),m.normalize(bt,bt),a.tangent&&(w[ye++]=bt.x,w[ye++]=bt.y,w[ye++]=bt.z),a.bitangent){let ft=m.cross(Je,bt,Nve);m.normalize(ft,ft),M[Se++]=ft.x,M[Se++]=ft.y,M[Se++]=ft.z}}}a.st&&(pe.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:O})),a.normal&&(pe.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(pe.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:w})),a.bitangent&&(pe.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:M}))}if(l(e._offsetAttribute)){let ct=W.length,Je=e._offsetAttribute===ln.NONE?0:1,bt=new Uint8Array(ct/3).fill(Je);pe.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:bt})}return new ht({attributes:pe,indices:G,primitiveType:Ae.TRIANGLES,boundingSphere:de.fromEllipsoid(Fe),offsetAttribute:e._offsetAttribute})};var Bz;Op.getUnitEllipsoid=function(){return l(Bz)||(Bz=Op.createGeometry(new Op({radii:new m(1,1,1),vertexFormat:Xe.POSITION_ONLY}))),Bz};var Ks=Op;var d$t=_(T(),1);var Dve=new m(1,1,1),U5=Math.cos,D5=Math.sin;function FC(e){e=e??Y.EMPTY_OBJECT;let t=e.radii??Dve,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??X.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??X.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),d=Math.round(e.subdivisions??128);this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=d,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}FC.packedLength=2*m.packedLength+8;FC.pack=function(e,t,n){return n=n??0,m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var dre=new m,ure=new m,Bp={radii:dre,innerRadii:ure,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};FC.unpack=function(e,t,n){t=t??0;let i=m.unpack(e,t,dre);t+=m.packedLength;let o=m.unpack(e,t,ure);t+=m.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=d,n._slicePartitions=u,n._subdivisions=h,n._offsetAttribute=p===-1?void 0:p,n):(Bp.minimumClock=r,Bp.maximumClock=s,Bp.minimumCone=a,Bp.maximumCone=c,Bp.stackPartitions=d,Bp.slicePartitions=u,Bp.subdivisions=h,Bp.offsetAttribute=p===-1?void 0:p,new FC(Bp))};FC.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ne.fromCartesian3(t),d=e._slicePartitions+1,u=e._stackPartitions+1;d=Math.round(d*Math.abs(o-i)/X.TWO_PI),u=Math.round(u*Math.abs(s-r)/X.PI),d<2&&(d=2),u<2&&(u=2);let h=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,f=!1,y=!1;g&&(p=2,r>0&&(f=!0,h+=d),s<Math.PI&&(y=!0,h+=d));let x=a*p*(u+d),S=new Float64Array(x*3),C=2*(x+h-(d+u)*p),V=Ne.createTypedArray(x,C),L,Z,E,P,W=0,v=new Array(u),A=new Array(u);for(L=0;L<u;L++)P=r+L*(s-r)/(u-1),v[L]=D5(P),A[L]=U5(P);let b=new Array(a),R=new Array(a);for(L=0;L<a;L++)E=i+L*(o-i)/(a-1),b[L]=D5(E),R[L]=U5(E);for(L=0;L<u;L++)for(Z=0;Z<a;Z++)S[W++]=t.x*v[L]*R[Z],S[W++]=t.y*v[L]*b[Z],S[W++]=t.z*A[L];if(g)for(L=0;L<u;L++)for(Z=0;Z<a;Z++)S[W++]=n.x*v[L]*R[Z],S[W++]=n.y*v[L]*b[Z],S[W++]=n.z*A[L];for(v.length=a,A.length=a,L=0;L<a;L++)P=r+L*(s-r)/(a-1),v[L]=D5(P),A[L]=U5(P);for(b.length=d,R.length=d,L=0;L<d;L++)E=i+L*(o-i)/(d-1),b[L]=D5(E),R[L]=U5(E);for(L=0;L<a;L++)for(Z=0;Z<d;Z++)S[W++]=t.x*v[L]*R[Z],S[W++]=t.y*v[L]*b[Z],S[W++]=t.z*A[L];if(g)for(L=0;L<a;L++)for(Z=0;Z<d;Z++)S[W++]=n.x*v[L]*R[Z],S[W++]=n.y*v[L]*b[Z],S[W++]=n.z*A[L];for(W=0,L=0;L<u*p;L++){let w=L*a;for(Z=0;Z<a-1;Z++)V[W++]=w+Z,V[W++]=w+Z+1}let G=u*a*p;for(L=0;L<d;L++)for(Z=0;Z<a-1;Z++)V[W++]=G+L+Z*d,V[W++]=G+L+(Z+1)*d;if(g)for(G=u*a*p+d*a,L=0;L<d;L++)for(Z=0;Z<a-1;Z++)V[W++]=G+L+Z*d,V[W++]=G+L+(Z+1)*d;if(g){let w=u*a*p,M=w+a*d;if(f)for(L=0;L<d;L++)V[W++]=w+L,V[W++]=M+L;if(y)for(w+=a*d-d,M+=a*d-d,L=0;L<d;L++)V[W++]=w+L,V[W++]=M+L}let I=new pn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:S})});if(l(e._offsetAttribute)){let w=S.length,M=e._offsetAttribute===ln.NONE?0:1,O=new Uint8Array(w/3).fill(M);I.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}return new ht({attributes:I,indices:V,primitiveType:Ae.LINES,boundingSphere:de.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var gd=FC;var x$t=_(T(),1);function AC(e){e=e??Y.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??ne.default})),this._levelZeroMaximumGeometricError=es.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(AC.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(){}}});AC.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Fa({buffer:new Uint8Array(16*16),width:16,height:16}))};AC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};AC.prototype.getTileDataAvailable=function(e,t,n){};AC.prototype.loadTileDataAvailability=function(e,t,n){};var Bx=AC;var T$t=_(T(),1);function Yz(){this._removalFunctions=[]}Yz.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)}};Yz.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var dr=Yz;var C$t=_(T(),1),Ove={NONE:0,HOLD:1,EXTRAPOLATE:2},yd=Object.freeze(Ove);var ten=_(T(),1);var M$t=_(T(),1);var W$t=_(T(),1);function yf(e){e=e??Y.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new bs,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function zz(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(yf.prototype,{projectionMatrix:{get:function(){return zz(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return zz(this),this._infinitePerspective}}});var Bve=new m,Yve=new m,zve=new m,Hve=new m;yf.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=m.cross(t,n,Bve),h=Yve;m.multiplyByScalar(t,c,h),m.add(e,h,h);let p=zve;m.multiplyByScalar(t,d,p),m.add(e,p,p);let g=Hve;m.multiplyByScalar(u,a,g),m.add(h,g,g),m.subtract(g,e,g),m.normalize(g,g),m.cross(g,n,g),m.normalize(g,g);let f=i[0];return l(f)||(f=i[0]=new re),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(u,s,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(n,g,g),m.normalize(g,g),f=i[1],l(f)||(f=i[1]=new re),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(n,r,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(u,g,g),m.normalize(g,g),f=i[2],l(f)||(f=i[2]=new re),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(n,o,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(g,u,g),m.normalize(g,g),f=i[3],l(f)||(f=i[3]=new re),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),f=i[4],l(f)||(f=i[4]=new re),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-m.dot(t,h),m.negate(t,g),f=i[5],l(f)||(f=i[5]=new re),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,p),this._cullingVolume};yf.prototype.getPixelDimensions=function(e,t,n,i,o){zz(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};yf.prototype.clone=function(e){return l(e)||(e=new yf),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};yf.prototype.equals=function(e){return l(e)&&e instanceof yf&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};yf.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof yf&&X.equalsEpsilon(this.right,e.right,t,n)&&X.equalsEpsilon(this.left,e.left,t,n)&&X.equalsEpsilon(this.top,e.top,t,n)&&X.equalsEpsilon(this.bottom,e.bottom,t,n)&&X.equalsEpsilon(this.near,e.near,t,n)&&X.equalsEpsilon(this.far,e.far,t,n)};var Qc=yf;function wl(e){e=e??Y.EMPTY_OBJECT,this._offCenterFrustum=new Qc,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}wl.packedLength=6;wl.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};wl.unpack=function(e,t,n){return t=t??0,l(n)||(n=new wl),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 Um(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(wl.prototype,{projectionMatrix:{get:function(){return Um(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Um(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Um(this),this._fovy}},sseDenominator:{get:function(){return Um(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Um(this),this._offCenterFrustum}}});wl.prototype.computeCullingVolume=function(e,t,n){return Um(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};wl.prototype.getPixelDimensions=function(e,t,n,i,o){return Um(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};wl.prototype.clone=function(e){return l(e)||(e=new wl),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};wl.prototype.equals=function(e){return!l(e)||!(e instanceof wl)?!1:(Um(this),Um(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};wl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof wl)?!1:(Um(this),Um(e),X.equalsEpsilon(this.fov,e.fov,t,n)&&X.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ci=wl;var O5=0,Kve=1;function Yx(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Xe.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof Ci?(s=O5,a=Ci.packedLength):t instanceof un&&(s=Kve,a=un.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=we.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+we.packedLength+Xe.packedLength}Yx.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===O5?(Ci.pack(o,t,n),n+=Ci.packedLength):(un.pack(o,t,n),n+=un.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,we.pack(e._orientation,t,n),n+=we.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n]=e._drawNearPlane?1:0,t};var Jve=new Ci,Qve=new un,jve=new we,qve=new m,$ve=new Xe;Yx.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===O5?(o=Ci.unpack(e,t,Jve),t+=Ci.packedLength):(o=un.unpack(e,t,Qve),t+=un.packedLength);let r=m.unpack(e,t,qve);t+=m.packedLength;let s=we.unpack(e,t,jve);t+=we.packedLength;let a=Xe.unpack(e,t,$ve);t+=Xe.packedLength;let c=e[t]===1;if(!l(n))return new Yx({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let d=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(d),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=we.clone(s,n._orientation),n._vertexFormat=Xe.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function MC(e,t,n,i,o,r,s,a){let c=e/3*2;for(let d=0;d<4;++d)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var ewe=new $,twe=new F,Hz=new F,mre=new m,hre=new m,fre=new m,nwe=new m,iwe=new m,owe=new m,lg=new Array(3),$E=new Array(4);$E[0]=new re(-1,-1,1,1);$E[1]=new re(1,-1,1,1);$E[2]=new re(1,1,1,1);$E[3]=new re(-1,1,1,1);var pre=new Array(4);for(let e=0;e<4;++e)pre[e]=new re;Yx._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,ewe),d=r??mre,u=s??hre,h=a??fre;d=$.getColumn(c,0,d),u=$.getColumn(c,1,u),h=$.getColumn(c,2,h),m.normalize(d,d),m.normalize(u,u),m.normalize(h,h),m.negate(d,d);let p=F.computeView(e,h,u,d,twe),g,f,y=i.projectionMatrix;if(n===O5){let x=F.multiply(y,p,Hz);f=F.inverse(x,Hz)}else g=F.inverseTransformation(p,Hz);l(f)?(lg[0]=i.near,lg[1]=i.far):(lg[0]=0,lg[1]=i.near,lg[2]=i.far);for(let x=0;x<2;++x)for(let S=0;S<4;++S){let C=re.clone($E[S],pre[S]);if(l(f)){C=F.multiplyByVector(f,C,C);let V=1/C.w;m.multiplyByScalar(C,V,C),m.subtract(C,e,C),m.normalize(C,C);let L=m.dot(h,C);m.multiplyByScalar(C,lg[x]/L,C),m.add(C,e,C)}else{let V=i.offCenterFrustum;l(V)&&(i=V);let L=lg[x],Z=lg[x+1];C.x=(C.x*(i.right-i.left)+i.left+i.right)*.5,C.y=(C.y*(i.top-i.bottom)+i.bottom+i.top)*.5,C.z=(C.z*(L-Z)-L-Z)*.5,C.w=1,F.multiplyByVector(g,C,C)}o[12*x+S*3]=C.x,o[12*x+S*3+1]=C.y,o[12*x+S*3+2]=C.z}};Yx.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);Yx._computeNearFarPlanes(i,o,t,n,c);let d=3*4*2;c[d]=c[3*4],c[d+1]=c[3*4+1],c[d+2]=c[3*4+2],c[d+3]=c[0],c[d+4]=c[1],c[d+5]=c[2],c[d+6]=c[3*3],c[d+7]=c[3*3+1],c[d+8]=c[3*3+2],c[d+9]=c[3*7],c[d+10]=c[3*7+1],c[d+11]=c[3*7+2],d+=3*4,c[d]=c[3*5],c[d+1]=c[3*5+1],c[d+2]=c[3*5+2],c[d+3]=c[3],c[d+4]=c[4],c[d+5]=c[5],c[d+6]=c[0],c[d+7]=c[1],c[d+8]=c[2],c[d+9]=c[3*4],c[d+10]=c[3*4+1],c[d+11]=c[3*4+2],d+=3*4,c[d]=c[3],c[d+1]=c[4],c[d+2]=c[5],c[d+3]=c[3*5],c[d+4]=c[3*5+1],c[d+5]=c[3*5+2],c[d+6]=c[3*6],c[d+7]=c[3*6+1],c[d+8]=c[3*6+2],c[d+9]=c[3*2],c[d+10]=c[3*2+1],c[d+11]=c[3*2+2],d+=3*4,c[d]=c[3*2],c[d+1]=c[3*2+1],c[d+2]=c[3*2+2],c[d+3]=c[3*6],c[d+4]=c[3*6+1],c[d+5]=c[3*6+2],c[d+6]=c[3*7],c[d+7]=c[3*7+1],c[d+8]=c[3*7+2],c[d+9]=c[3*3],c[d+10]=c[3*3+1],c[d+11]=c[3*3+2],r||(c=c.subarray(3*4));let u=new pn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,f=l(s.bitangent)?new Float32Array(3*4*a):void 0,y=l(s.st)?new Float32Array(2*4*a):void 0,x=mre,S=hre,C=fre,V=m.negate(x,nwe),L=m.negate(S,iwe),Z=m.negate(C,owe);d=0,r&&(MC(d,p,g,f,y,Z,x,S),d+=3*4),MC(d,p,g,f,y,C,V,S),d+=3*4,MC(d,p,g,f,y,V,Z,S),d+=3*4,MC(d,p,g,f,y,L,Z,V),d+=3*4,MC(d,p,g,f,y,x,C,S),d+=3*4,MC(d,p,g,f,y,S,C,V),l(p)&&(u.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(u.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),l(f)&&(u.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),l(y)&&(u.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:y}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,f=p*4;h[g]=f,h[g+1]=f+1,h[g+2]=f+2,h[g+3]=f,h[g+4]=f+2,h[g+5]=f+3}return new ht({attributes:u,indices:h,primitiveType:Ae.TRIANGLES,boundingSphere:de.fromVertices(c)})};var zx=Yx;var pen=_(T(),1);var Kz=0,rwe=1;function eI(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof Ci?(r=Kz,s=Ci.packedLength):t instanceof un&&(r=rwe,s=un.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=we.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+we.packedLength}eI.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Kz?(Ci.pack(o,t,n),n+=Ci.packedLength):(un.pack(o,t,n),n+=un.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,we.pack(e._orientation,t,n),n+=we.packedLength,t[n]=e._drawNearPlane?1:0,t};var swe=new Ci,awe=new un,cwe=new we,lwe=new m;eI.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===Kz?(o=Ci.unpack(e,t,swe),t+=Ci.packedLength):(o=un.unpack(e,t,awe),t+=un.packedLength);let r=m.unpack(e,t,lwe);t+=m.packedLength;let s=we.unpack(e,t,cwe);t+=we.packedLength;let a=e[t]===1;if(!l(n))return new eI({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=we.clone(s,n._orientation),n._drawNearPlane=a,n};eI.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);zx._computeNearFarPlanes(i,o,t,n,s);let a=new pn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),c,d,u=r?2:1,h=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,d=p*4,h[c]=d,h[c+1]=d+1,h[c+2]=d+1,h[c+3]=d+2,h[c+4]=d+2,h[c+5]=d+3,h[c+6]=d+3,h[c+7]=d;for(p=0;p<2;++p)c=(u+p)*8,d=p*4,h[c]=d,h[c+1]=d+4,h[c+2]=d+1,h[c+3]=d+5,h[c+4]=d+2,h[c+5]=d+6,h[c+6]=d+3,h[c+7]=d+7;return new ht({attributes:a,indices:h,primitiveType:Ae.LINES,boundingSphere:de.fromVertices(s)})};var tI=eI;var _en=_(T(),1);function B5(){fe.throwInstantiationError()}Object.defineProperties(B5.prototype,{credit:{get:fe.throwInstantiationError}});B5.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Gt.getIonCredit)};B5.prototype.geocode=fe.throwInstantiationError;var NC=B5;var Sen=_(T(),1),dwe={SEARCH:0,AUTOCOMPLETE:1},dg=Object.freeze(dwe);var Len=_(T(),1);function bre(){fe.throwInstantiationError()}bre.createGeometry=function(e){fe.throwInstantiationError()};var Jz=bre;var Gen=_(T(),1);function uwe(e){e=e??Y.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var uc=uwe;var Ien=_(T(),1),gre=_(cd(),1);function mwe(e){let t=new gre.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Yp=mwe;var Wen=_(T(),1);function hwe(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 nI=hwe;var wen=_(T(),1);function fwe(e,t){return t=t??0,Xl(e,t,Math.min(4,e.length))}var Dm=fwe;var ttn=_(T(),1),_we=_(Qz(),1);var Den=_(T(),1);var Men=_(T(),1);function pwe(e,t){return(e&t)!==0}var mc=pwe;var bwe=[1,2,4,8],yre=15,gwe=16,ywe=64,xwe=128;function xf(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}xf.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 xf(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};xf.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};xf.prototype.hasSubtree=function(){return mc(this._bits,gwe)};xf.prototype.hasImagery=function(){return mc(this._bits,ywe)};xf.prototype.hasTerrain=function(){return mc(this._bits,xwe)};xf.prototype.hasChildren=function(){return mc(this._bits,yre)};xf.prototype.hasChild=function(e){return mc(this._bits,bwe[e])};xf.prototype.getChildBitmask=function(){return this._bits&yre};var iI=xf;function Twe(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 Swe=Twe(`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\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DA\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 xd(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=X.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(xd.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});xd.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Re)&&(t=e.url);let n=Re.createIfNeeded(t);n.appendForwardSlash();let i=new xd;i._resource=n;try{await Cwe(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${_re(i,"",1).url}: ${o}`;throw new ce(r)}return i};xd.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;mc(t,r)?mc(e,r)&&(s|=1):(s|=2,mc(e,r)||(s|=1)),i+=s}return i};xd.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];mc(s,2)?mc(s,1)||(t|=r):(n|=r,mc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};xd.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 xre=new yi("decodeGoogleEarthEnterprisePacket");xd.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=_re(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return xre.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,h=-1;if(e!==""){h=e.length+1;let f=d[e];u=r[e],u._bits|=f._bits,delete d[e]}let p=Object.keys(d);p.sort(function(f,y){return f.length-y.length});let g=p.length;for(let f=0;f<g;++f){let y=p[f];if(d[y]!==null){let S=iI.clone(d[y]),C=y.length;if(C===h)S.setParent(u);else if(C>1){let V=r[y.substring(0,y.length-1)];S.setParent(V)}r[y]=S}else r[y]=null}})})};xd.prototype.populateSubtree=function(e,t,n,i){let o=xd.tileXYToQuadKey(e,t,n);return $z(this,o,i)};function $z(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new Ho({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),$z(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new ce(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new Ho({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),$z(e,t,s)}).finally(function(){delete a[o]})}xd.prototype.getTileInformation=function(e,t,n){let i=xd.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};xd.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function _re(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var jz,qz;function Cwe(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(qz)){let n=sn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;qz=ox(n).then(function(){jz=window.cesiumGoogleEarthDbRootParser(_we),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return qz.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=jz.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return xre.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=jz.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.copyrightString;l(d)&&(o[c.providerId]=new Gt(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=Swe})}var zp=xd;var ytn=_(T(),1);function Hx(e){e=e??Y.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(Hx.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Cre="createVerticesFromGoogleEarthEnterpriseBuffer",Vwe=new yi(Cre),Lwe=new yi(Cre,Wm.maximumAsynchronousTasks),Tre=new le,eH=new le;Hx.prototype.createMesh=function(e){e=e??Y.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,Tre),t.tileXYToRectangle(n,i,o,eH);let d=c.cartographicToCartesian(le.center(eH)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let g=(a?Lwe:Vwe).scheduleTask({buffer:this._buffer,nativeRectangle:Tre,rectangle:eH,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let f=this;return g.then(function(y){return f._mesh=new Cu(d,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,de.clone(y.boundingSphere3D),m.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,Xn.clone(y.orientedBoundingBox),lc.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),f._minimumHeight=y.minimumHeight,f._maximumHeight=y.maximumHeight,f._buffer=void 0,f._mesh})};Hx.prototype.interpolateHeight=function(e,t,n){let i=X.clamp((t-e.west)/e.width,0,1),o=X.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?Iwe(this,i,o):Pwe(this,i,o,e)};var Rwe=new yi("upsampleQuantizedTerrainMesh",Wm.maximumAsynchronousTasks);Hx.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=Rwe.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:h,ellipsoid:u});if(!l(p))return;let g=this;return p.then(function(f){let y=new Uint16Array(f.vertices),x=Ne.createTypedArray(y.length/3,f.indices),S=g._skirtHeight;return new Ix({quantizedVertices:y,indices:x,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:de.clone(f.boundingSphere),orientedBoundingBox:Xn.clone(f.orientedBoundingBox),horizonOcclusionPoint:m.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:S,southSkirtHeight:S,eastSkirtHeight:S,northSkirtHeight:S,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};Hx.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};Hx.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Zwe=new U,Gwe=new U,Ewe=new U,Vre=new m;function Iwe(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,d,Zwe),g=r.decodeTextureCoordinates(o,u,Gwe),f=r.decodeTextureCoordinates(o,h,Ewe),y=Wp.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,Vre);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let x=r.decodeHeight(o,d),S=r.decodeHeight(o,u),C=r.decodeHeight(o,h);return y.x*x+y.y*S+y.z*C}}}var Xwe=Uint16Array.BYTES_PER_ELEMENT,Sre=Uint32Array.BYTES_PER_ELEMENT,tH=Int32Array.BYTES_PER_ELEMENT,Wwe=Float32Array.BYTES_PER_ELEMENT,nH=Float64Array.BYTES_PER_ELEMENT;function Pwe(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),d=0;for(let Z=0;Z<r;++Z)d+=c.getUint32(d,!0),d+=Sre;d+=Sre,d+=2*nH;let u=X.toRadians(c.getFloat64(d,!0)*180);d+=nH;let h=X.toRadians(c.getFloat64(d,!0)*180);d+=nH;let p=i.width/u/2,g=i.height/h/2,f=c.getInt32(d,!0);d+=tH;let y=c.getInt32(d,!0)*3;d+=tH,d+=tH;let x=new Array(f),S=new Array(f),C=new Array(f),V;for(V=0;V<f;++V)x[V]=s+c.getUint8(d++)*p,S[V]=a+c.getUint8(d++)*g,C[V]=c.getFloat32(d,!0)*6371010,d+=Wwe;let L=new Array(y);for(V=0;V<y;++V)L[V]=c.getUint16(d,!0),d+=Xwe;for(V=0;V<y;V+=3){let Z=L[V],E=L[V+1],P=L[V+2],W=x[Z],v=x[E],A=x[P],b=S[Z],R=S[E],G=S[P],I=Wp.computeBarycentricCoordinates(t,n,W,b,v,R,A,G,Vre);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*C[Z]+I.y*C[E]+I.z*C[P]}}var kC=Hx;var Ftn=_(T(),1);var Zu={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},Y5=new q;function z5(){this._terrainCache={},this._lastTidy=q.now()}z5.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:q.now()}};z5.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};z5.prototype.tidy=function(){if(q.now(Y5),q.secondsDifference(Y5,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];q.secondsDifference(Y5,r.timestamp)>10&&delete e[o]}q.clone(Y5,this._lastTidy)}};function ug(e){e=e??Y.EMPTY_OBJECT,this._tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new le(-X.PI,-X.PI,X.PI,X.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Gt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new z5,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(ug.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(){}}});ug.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ce(`The server ${e.url} doesn't have terrain`);let n=new ug(t);return n._metadata=e,n};var vwe=new yi("decodeGoogleEarthEnterprisePacket");function Lre(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Zu.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}ug.prototype.requestTileGeometry=function(e,t,n,i){let o=zp.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new ce("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Zu.UNKNOWN);let d=r.get(o);if(l(d)){let S=s.providers[a.terrainProvider];return Promise.resolve(new kC({buffer:d,childTileMask:Lre(o,a,s),credits:l(S)?[S]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Zu.NONE)return Promise.reject(new ce("Terrain tile doesn't exist"))}else return Promise.resolve(new Fa({buffer:new Uint8Array(16*16),width:16,height:16}));let u,h=o,p=-1;switch(c){case Zu.SELF:p=a.terrainVersion;break;case Zu.PARENT:h=h.substring(0,h.length-1),u=s.getTileInformationFromQuadKey(h),p=u.terrainVersion;break;case Zu.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),u=s.getTileInformationFromQuadKey(h),l(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new ce("Terrain tile doesn't exist"));let g=this._terrainPromises,f=this._terrainRequests,y,x;if(l(g[h]))y=g[h],x=f[h];else{x=i;let S=wwe(this,h,p,x).fetchArrayBuffer();if(!l(S))return;y=S.then(function(C){return l(C)?vwe.scheduleTask({buffer:C,type:"Terrain",key:s.key},[C]).then(function(V){let L=s.getTileInformationFromQuadKey(h);L.terrainState=Zu.SELF,r.add(h,V[0]);let Z=L.terrainProvider,E=V.length-1;for(let P=0;P<E;++P){let W=h+P.toString(),v=s.getTileInformationFromQuadKey(W);l(v)&&(r.add(W,V[P+1]),v.terrainState=Zu.PARENT,v.terrainProvider===0&&(v.terrainProvider=Z))}}):Promise.reject(new ce("Failed to load terrain."))}),g[h]=y,f[h]=x,y=y.finally(function(){delete g[h],delete f[h]})}return y.then(function(){let S=r.get(o);if(l(S)){let C=s.providers[a.terrainProvider];return new kC({buffer:S,childTileMask:Lre(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ce("Failed to load terrain."))}).catch(function(S){return x.state===$n.CANCELLED?(i.state=x.state,Promise.reject(S)):(a.terrainState=Zu.NONE,Promise.reject(S))})};ug.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ug.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=zp.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===Zu.NONE)return!1;if((!l(s)||s===Zu.UNKNOWN)&&(r.terrainState=Zu.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Ho({throttle:!1,throttleByServer:!0,type:hs.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};ug.prototype.loadTileDataAvailability=function(e,t,n){};function wwe(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 iH=ug;var Otn=_(T(),1);var Fwe="https://maps.googleapis.com/maps/api/geocode/json",Rre='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function oH(e){e=e??Y.EMPTY_OBJECT;let t=e.key;this._resource=new Re({url:Fwe,queryParameters:{key:t}}),this._credit=new Gt(Rre,!0)}Object.defineProperties(oH.prototype,{credit:{get:function(){return this._credit}}});oH.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 ce(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:le.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:Rre,collapsible:!1}}})};var rH=oH;var Htn=_(T(),1);var H5={};H5.defaultApiKey=void 0;H5.mapTilesApiEndpoint=new Re({url:"https://tile.googleapis.com/v1/"});H5.getDefaultCredit=function(){return new Gt('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var Kx=H5;var ynn=_(T(),1);var hH=[Ii,Pi],Awe=hH.length,zre=Math.cos(X.toRadians(30)),Zre=Math.cos(X.toRadians(150)),Hre=0,Kre=1e3;function hg(e){e=e??Y.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??on.GEODESIC,this._ellipsoid=ne.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(hg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});hg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<Awe;i++)if(t instanceof hH[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var Mwe=new m,Gre=new m,Ere=new m;function mH(e,t,n,i,o){let r=jc(i,e,0,Mwe),s=jc(i,e,n,Gre),a=jc(i,t,0,Ere),c=Hp(s,r,Gre),d=Hp(a,r,Ere);return m.cross(d,c,o),m.normalize(o,o)}var Nwe=new he,kwe=new m,Uwe=new m,Dwe=new m;function sH(e,t,n,i,o,r,s,a,c,d,u){if(o===0)return;let h;r===on.GEODESIC?h=new Mp(e,t,s):r===on.RHUMB&&(h=new Ma(e,t,s));let p=h.surfaceDistance;if(p<o)return;let g=mH(e,t,i,s,Dwe),f=Math.ceil(p/o),y=p/f,x=y,S=f-1,C=a.length;for(let V=0;V<S;V++){let L=h.interpolateUsingSurfaceDistance(x,Nwe),Z=jc(s,L,n,kwe),E=jc(s,L,i,Uwe);m.pack(g,a,C),m.pack(Z,c,C),m.pack(E,d,C),u.push(L.latitude),u.push(L.longitude),C+=3,x+=y}}var aH=new he;function jc(e,t,n,i){return he.clone(t,aH),aH.height=n,he.toCartesian(aH,e,i)}hg.pack=function(e,t,n){let i=n??0,o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];m.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ne.pack(e._ellipsoid,t,i),i+=ne.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};hg.unpack=function(e,t,n){let i=t??0,o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=m.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],d=ne.unpack(e,i);i+=ne.packedLength;let u=e[i++],h=e[i++]===1;return l(n)||(n=new hg({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=d,n._projectionIndex=u,n._scene3DOnly=h,n};function Hp(e,t,n){return m.subtract(e,t,n),m.normalize(n,n),n}function Ire(e,t,n,i){return i=Hp(e,t,i),i=m.cross(i,n,i),i=m.normalize(i,i),i=m.cross(n,i,i),i}var Owe=new m,Bwe=new m,Ywe=new m,Jre=new m,zwe=0,Hwe=-1;function cH(e,t,n,i,o){let r=Hp(n,t,Jre),s=Ire(e,t,r,Owe),a=Ire(i,t,r,Bwe);if(X.equalsEpsilon(m.dot(s,a),Hwe,X.EPSILON5))return o=m.cross(r,s,o),o=m.normalize(o,o),o;o=m.add(a,s,o),o=m.normalize(o,o);let c=m.cross(r,o,Ywe);return m.dot(a,c)<zwe&&(o=m.negate(o,o)),o}var j5=dn.fromPointNormal(m.ZERO,m.UNIT_Y),Kwe=new m,Jwe=new m,Qwe=new m,jwe=new m,qwe=new m,K5=new m,J5=new he,Xre=new he,Wre=new he;hg.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new hH[e._projectionIndex](i),a=Hre,c=Kre,d,u,h=e._positions,p=h.length;p===2&&(n=!1);let g,f,y,x,S=new Ma(void 0,void 0,i),C,V,L,Z=[h[0]];for(u=0;u<p-1;u++)g=h[u],f=h[u+1],C=ei.lineSegmentPlane(g,f,j5,K5),l(C)&&!m.equalsEpsilon(C,g,X.EPSILON7)&&!m.equalsEpsilon(C,f,X.EPSILON7)&&(e.arcType===on.GEODESIC?Z.push(m.clone(C)):e.arcType===on.RHUMB&&(L=i.cartesianToCartographic(C,J5).longitude,y=i.cartesianToCartographic(g,J5),x=i.cartesianToCartographic(f,Xre),S.setEndPoints(y,x),V=S.findIntersectionWithLongitude(L,Wre),C=i.cartographicToCartesian(V,K5),l(C)&&!m.equalsEpsilon(C,g,X.EPSILON7)&&!m.equalsEpsilon(C,f,X.EPSILON7)&&Z.push(m.clone(C)))),Z.push(f);n&&(g=h[p-1],f=h[0],C=ei.lineSegmentPlane(g,f,j5,K5),l(C)&&!m.equalsEpsilon(C,g,X.EPSILON7)&&!m.equalsEpsilon(C,f,X.EPSILON7)&&(e.arcType===on.GEODESIC?Z.push(m.clone(C)):e.arcType===on.RHUMB&&(L=i.cartesianToCartographic(C,J5).longitude,y=i.cartesianToCartographic(g,J5),x=i.cartesianToCartographic(f,Xre),S.setEndPoints(y,x),V=S.findIntersectionWithLongitude(L,Wre),C=i.cartographicToCartesian(V,K5),l(C)&&!m.equalsEpsilon(C,g,X.EPSILON7)&&!m.equalsEpsilon(C,f,X.EPSILON7)&&Z.push(m.clone(C)))));let E=Z.length,P=new Array(E);for(u=0;u<E;u++){let K=he.fromCartesian(Z[u],i);K.height=0,P[u]=K}if(P=Co(P,he.equalsEpsilon),E=P.length,E<2)return;let W=[],v=[],A=[],b=[],R=Kwe,G=Jwe,I=Qwe,w=jwe,M=qwe,O=P[0],k=P[1],B=P[E-1];for(R=jc(i,B,a,R),w=jc(i,k,a,w),G=jc(i,O,a,G),I=jc(i,O,c,I),n?M=cH(R,G,I,w,M):M=mH(O,k,c,i,M),m.pack(M,v,0),m.pack(G,A,0),m.pack(I,b,0),W.push(O.latitude),W.push(O.longitude),sH(O,k,a,c,o,r,i,v,A,b,W),u=1;u<E-1;++u){R=m.clone(G,R),G=m.clone(w,G);let K=P[u];jc(i,K,c,I),jc(i,P[u+1],a,w),cH(R,G,I,w,M),d=v.length,m.pack(M,v,d),m.pack(G,A,d),m.pack(I,b,d),W.push(K.latitude),W.push(K.longitude),sH(P[u],P[u+1],a,c,o,r,i,v,A,b,W)}let N=P[E-1],z=P[E-2];if(G=jc(i,N,a,G),I=jc(i,N,c,I),n){let K=P[0];R=jc(i,z,a,R),w=jc(i,K,a,w),M=cH(R,G,I,w,M)}else M=mH(z,N,c,i,M);if(d=v.length,m.pack(M,v,d),m.pack(G,A,d),m.pack(I,b,d),W.push(N.latitude),W.push(N.longitude),n){for(sH(N,O,a,c,o,r,i,v,A,b,W),d=v.length,u=0;u<3;++u)v[d+u]=v[u],A[d+u]=A[u],b[d+u]=b[u];W.push(O.latitude),W.push(O.longitude)}return VFe(n,s,A,b,v,W,t)};var $we=new m,eFe=new $,tFe=new we;function Pre(e,t,n,i){let o=Hp(n,t,$we),r=m.dot(o,e);if(r>zre||r<Zre){let s=Hp(i,n,Jre),a=r<Zre?X.PI_OVER_TWO:-X.PI_OVER_TWO,c=we.fromAxisAngle(s,a,tFe),d=$.fromQuaternion(c,eFe);return $.multiplyByVector(d,e,e),!0}return!1}var vre=new he,nFe=new m,wre=new m;function oI(e,t,n,i,o){let r=he.toCartesian(t,e._ellipsoid,nFe),s=m.add(r,n,wre),a=!1,c=e._ellipsoid,d=c.cartesianToCartographic(s,vre);Math.abs(t.longitude-d.longitude)>X.PI_OVER_TWO&&(a=!0,s=m.subtract(r,n,wre),d=c.cartesianToCartographic(s,vre)),d.height=0;let u=e.project(d,o);return o=m.subtract(u,i,o),o.z=0,o=m.normalize(o,o),a&&m.negate(o,o),o}var iFe=new m,Fre=new m;function Are(e,t,n,i,o,r){let s=m.subtract(t,e,iFe);m.normalize(s,s);let a=n-Hre,c=m.multiplyByScalar(s,a,Fre);m.add(e,c,o);let d=i-Kre;c=m.multiplyByScalar(s,d,Fre),m.add(t,c,r)}var oFe=new m;function Q5(e,t){let n=dn.getPointDistance(j5,e),i=dn.getPointDistance(j5,t),o=oFe;X.equalsEpsilon(n,0,X.EPSILON2)?(o=Hp(t,e,o),m.multiplyByScalar(o,X.EPSILON2,o),m.add(e,o,e)):X.equalsEpsilon(i,0,X.EPSILON2)&&(o=Hp(e,t,o),m.multiplyByScalar(o,X.EPSILON2,o),m.add(t,o,t))}function rFe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(X.equalsEpsilon(n,X.PI,X.EPSILON11)){let o=X.sign(t.longitude);return e.longitude=o*(n-X.EPSILON11),1}else if(X.equalsEpsilon(i,X.PI,X.EPSILON11)){let o=X.sign(e.longitude);return t.longitude=o*(i-X.EPSILON11),2}return 0}var Qre=new he,jre=new he,Mre=new m,lH=new m,Nre=new m,kre=new m,sFe=new m,Ure=new m,aFe=[Qre,jre],cFe=new le,lFe=new m,dFe=new m,uFe=new m,mFe=new m,hFe=new m,fFe=new m,dH=new m,uH=new m,pFe=new m,bFe=new m,gFe=new m,Dre=new m,yFe=new m,xFe=new m,_Fe=new Yn,TFe=new Yn,Ore=new m,SFe=new m,Bre=new m,CFe=[new de,new de],qre=[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],Yre=qre.length;function VFe(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,h=u*8,p=h*4,g=u*36,f=h>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(h*3),x=new Float32Array(p),S=new Float32Array(p),C=new Float32Array(p),V=new Float32Array(p),L=new Float32Array(p),Z,E,P,W;s&&(Z=new Float32Array(p),E=new Float32Array(p),P=new Float32Array(p),W=new Float32Array(h*2));let v=r.length/2,A=0,b=Qre;b.height=0;let R=jre;R.height=0;let G=Mre,I=lH;if(s)for(c=0,a=1;a<v;a++)b.latitude=r[c],b.longitude=r[c+1],R.latitude=r[c+2],R.longitude=r[c+3],G=t.project(b,G),I=t.project(R,I),A+=m.distance(G,I),c+=2;let w=i.length/3;I=m.unpack(i,0,I);let M=0;for(c=3,a=1;a<w;a++)G=m.clone(I,G),I=m.unpack(i,c,I),M+=m.distance(G,I),c+=3;let O;c=3;let k=0,B=0,N=0,z=0,K=!1,te=m.unpack(n,0,kre),H=m.unpack(i,0,lH),j=m.unpack(o,0,Ure);if(e){let Ie=m.unpack(n,n.length-6,Nre);Pre(j,Ie,te,H)&&(j=m.negate(j,j))}let ee=0,pe=0,_e=0;for(a=0;a<u;a++){let Ie=m.clone(te,Nre),Fe=m.clone(H,Mre),ve=m.clone(j,sFe);K&&(ve=m.negate(ve,ve)),te=m.unpack(n,c,kre),H=m.unpack(i,c,lH),j=m.unpack(o,c,Ure),K=Pre(j,Ie,te,H),b.latitude=r[k],b.longitude=r[k+1],R.latitude=r[k+2],R.longitude=r[k+3];let ct,Je,bt,Qe;if(s){let Ei=rFe(b,R);ct=t.project(b,hFe),Je=t.project(R,fFe);let ha=Hp(Je,ct,Ore);ha.y=Math.abs(ha.y),bt=dH,Qe=uH,Ei===0||m.dot(ha,m.UNIT_Y)>zre?(bt=oI(t,b,ve,ct,dH),Qe=oI(t,R,j,Je,uH)):Ei===1?(Qe=oI(t,R,j,Je,uH),bt.x=0,bt.y=X.sign(b.longitude-Math.abs(R.longitude)),bt.z=0):(bt=oI(t,b,ve,ct,dH),Qe.x=0,Qe.y=X.sign(b.longitude-R.longitude),Qe.z=0)}let Tt=m.distance(Fe,H),ft=Yn.fromCartesian(Ie,_Fe),gt=m.subtract(te,Ie,pFe),En=m.normalize(gt,Dre),cn=m.subtract(Fe,Ie,bFe);cn=m.normalize(cn,cn);let Ce=m.cross(En,cn,Dre);Ce=m.normalize(Ce,Ce);let Le=m.cross(cn,ve,yFe);Le=m.normalize(Le,Le);let St=m.subtract(H,te,gFe);St=m.normalize(St,St);let mn=m.cross(j,St,xFe);mn=m.normalize(mn,mn);let to=Tt/M,He=ee/M,yr=0,cr,ma,Me,at=0,et=0;if(s){yr=m.distance(ct,Je),cr=Yn.fromCartesian(ct,TFe),ma=m.subtract(Je,ct,Ore),Me=m.normalize(ma,SFe);let Ei=Me.x;Me.x=Me.y,Me.y=-Ei,at=yr/A,et=pe/A}for(O=0;O<8;O++){let Ei=z+O*4,ha=B+O*2,jr=Ei+3,Tl=O<4?1:-1,Xo=O===2||O===3||O===6||O===7?1:-1;m.pack(ft.high,x,Ei),x[jr]=gt.x,m.pack(ft.low,S,Ei),S[jr]=gt.y,m.pack(Le,C,Ei),C[jr]=gt.z,m.pack(mn,V,Ei),V[jr]=to*Tl,m.pack(Ce,L,Ei);let xr=He*Xo;xr===0&&Xo<0&&(xr=9),L[jr]=xr,s&&(Z[Ei]=cr.high.x,Z[Ei+1]=cr.high.y,Z[Ei+2]=cr.low.x,Z[Ei+3]=cr.low.y,P[Ei]=-bt.y,P[Ei+1]=bt.x,P[Ei+2]=Qe.y,P[Ei+3]=-Qe.x,E[Ei]=ma.x,E[Ei+1]=ma.y,E[Ei+2]=Me.x,E[Ei+3]=Me.y,W[ha]=at*Tl,xr=et*Xo,xr===0&&Xo<0&&(xr=9),W[ha+1]=xr)}let qe=uFe,lt=mFe,Bt=lFe,xn=dFe,no=le.fromCartographicArray(aFe,cFe),zi=ui.getMinimumMaximumHeights(no,d),ms=zi.minimumTerrainHeight,lr=zi.maximumTerrainHeight;_e+=Math.abs(ms),_e+=Math.abs(lr),Are(Ie,Fe,ms,lr,qe,Bt),Are(te,H,ms,lr,lt,xn);let Gi=m.multiplyByScalar(Ce,X.EPSILON5,Bre);m.add(qe,Gi,qe),m.add(lt,Gi,lt),m.add(Bt,Gi,Bt),m.add(xn,Gi,xn),Q5(qe,lt),Q5(Bt,xn),m.pack(qe,y,N),m.pack(lt,y,N+3),m.pack(xn,y,N+6),m.pack(Bt,y,N+9),Gi=m.multiplyByScalar(Ce,-2*X.EPSILON5,Bre),m.add(qe,Gi,qe),m.add(lt,Gi,lt),m.add(Bt,Gi,Bt),m.add(xn,Gi,xn),Q5(qe,lt),Q5(Bt,xn),m.pack(qe,y,N+12),m.pack(lt,y,N+15),m.pack(xn,y,N+18),m.pack(Bt,y,N+21),k+=2,c+=3,B+=16,N+=24,z+=32,ee+=Tt,pe+=yr}c=0;let ae=0;for(a=0;a<u;a++){for(O=0;O<Yre;O++)f[c+O]=qre[O]+ae;ae+=8,c+=Yre}let ye=CFe;de.fromVertices(n,m.ZERO,3,ye[0]),de.fromVertices(i,m.ZERO,3,ye[1]);let Se=de.fromBoundingSpheres(ye);Se.radius+=_e/(u*2);let Ee={position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:mg(x),startLoAndForwardOffsetY:mg(S),startNormalAndForwardOffsetZ:mg(C),endNormalAndTextureCoordinateNormalizationX:mg(V),rightNormalAndTextureCoordinateNormalizationY:mg(L)};return s&&(Ee.startHiLo2D=mg(Z),Ee.offsetAndRight2D=mg(E),Ee.startEndNormals2D=mg(P),Ee.texcoordNormalization2D=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,normalize:!1,values:W})),new ht({attributes:Ee,indices:f,boundingSphere:Se})}function mg(e){return new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}hg._projectNormal=oI;var Jx=hg;var Tnn=_(T(),1);function fH(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}fH.clone=function(e,t){if(l(e))return l(t)||(t=new fH),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Gu=fH;var Lnn=_(T(),1);var LFe=X.factorial;function pH(e,t,n,i,o,r){let s=0,a,c,d;if(i>0){for(c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(r.push(c),s+=pH(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(s*=e-n[t[c]])}return s}var q5={type:"Hermite"};q5.getRequiredDataPoints=function(e,t){return t=t??0,Math.max(Math.floor((e+1)/(t+1)),2)};q5.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,d,u,h=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let x=new Array(h);for(p[r]=x,s=0;s<h;s++)x[s]=[]}let g=h,f=new Array(g);for(r=0;r<g;r++)f[r]=r;let y=h-1;for(c=0;c<i;c++){for(s=0;s<g;s++)u=f[s]*i+c,p[c][0].push(n[u]);for(r=1;r<g;r++){let x=!1;for(s=0;s<g-r;s++){let S=t[f[s]],C=t[f[s+r]],V;C-S<=0?(u=f[s]*i+i*r+c,V=n[u],p[c][r].push(V/LFe(r))):(V=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(V/(C-S))),x=x||V!==0}x||(y=r-1)}}for(a=0,d=0;a<=d;a++)for(r=a;r<=y;r++){let x=pH(e,f,t,a,r,[]);for(c=0;c<i;c++){let S=p[c][r][0];o[c+a*i]+=S*x}}return o};var RFe=[];q5.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let S=0;S<a;S++)s[S]=0;let c=t.length,d=new Array(c*(o+1)),u;for(u=0;u<c;u++)for(let S=0;S<o+1;S++)d[u*(o+1)+S]=u;let h=d.length,p=RFe,g=ZFe(p,d,t,n,i,o),f=[],y=h*(h+1)/2,x=Math.min(g,r);for(let S=0;S<=x;S++)for(u=S;u<=g;u++){f.length=0;let C=pH(e,d,t,S,u,f),V=Math.floor(u*(1-u)/2)+h*u;for(let L=0;L<i;L++){let Z=Math.floor(L*y),E=p[Z+V];s[L+S*i]+=E*C}}return s};function ZFe(e,t,n,i,o,r){let s,a,c=-1,d=t.length,u=d*(d+1)/2;for(let h=0;h<o;h++){let p=Math.floor(h*u);for(s=0;s<d;s++)a=t[s]*o*(r+1)+h,e[p+s]=i[a];for(let g=1;g<d;g++){let f=0,y=Math.floor(g*(1-g)/2)+d*g,x=!1;for(s=0;s<d-g;s++){let S=n[t[s]],C=n[t[s+g]],V,L;if(C-S<=0)a=t[s]*o*(r+1)+o*g+h,V=i[a],L=V/X.factorial(g),e[p+y+f]=L,f++;else{let Z=Math.floor((g-1)*(2-g)/2)+d*(g-1);V=e[p+Z+s+1]-e[p+Z+s],L=V/(C-S),e[p+y+f]=L,f++}x=x||V!==0}x&&(c=Math.max(c,g))}}return c}var rI=q5;var Znn=_(T(),1);var bH={};bH.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),$re(i,o,r,s);return c};bH.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),$re(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function $re(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 UC=bH;var Fnn=_(T(),1);var Enn=_(T(),1);function GFe(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var sI=GFe;var hse={},EFe=32.184,IFe=2451545,ese=-.0529921,tse=-.1059842,nse=13.0120009,ise=13.3407154,ose=.9856003,rse=26.4057084,sse=13.064993,ase=.3287146,cse=1.7484877,lse=-.1589763,dse=.0036096,use=.1643573,mse=12.9590088,gH=new q;hse.ComputeMoon=function(e,t){l(e)||(e=q.now()),gH=q.addSeconds(e,EFe,gH);let n=q.totalDays(gH)-IFe,i=n/Jn.DAYS_PER_JULIAN_CENTURY,o=(125.045+ese*n)*X.RADIANS_PER_DEGREE,r=(250.089+tse*n)*X.RADIANS_PER_DEGREE,s=(260.008+nse*n)*X.RADIANS_PER_DEGREE,a=(176.625+ise*n)*X.RADIANS_PER_DEGREE,c=(357.529+ose*n)*X.RADIANS_PER_DEGREE,d=(311.589+rse*n)*X.RADIANS_PER_DEGREE,u=(134.963+sse*n)*X.RADIANS_PER_DEGREE,h=(276.617+ase*n)*X.RADIANS_PER_DEGREE,p=(34.226+cse*n)*X.RADIANS_PER_DEGREE,g=(15.134+lse*n)*X.RADIANS_PER_DEGREE,f=(119.743+dse*n)*X.RADIANS_PER_DEGREE,y=(239.961+use*n)*X.RADIANS_PER_DEGREE,x=(25.053+mse*n)*X.RADIANS_PER_DEGREE,S=Math.sin(o),C=Math.sin(r),V=Math.sin(s),L=Math.sin(a),Z=Math.sin(c),E=Math.sin(d),P=Math.sin(u),W=Math.sin(h),v=Math.sin(p),A=Math.sin(g),b=Math.sin(f),R=Math.sin(y),G=Math.sin(x),I=Math.cos(o),w=Math.cos(r),M=Math.cos(s),O=Math.cos(a),k=Math.cos(c),B=Math.cos(d),N=Math.cos(u),z=Math.cos(h),K=Math.cos(p),te=Math.cos(g),H=Math.cos(f),j=Math.cos(y),ee=Math.cos(x),pe=(269.9949+.0031*i-3.8787*S-.1204*C+.07*V-.0172*L+.0072*E-.0052*A+.0043*G)*X.RADIANS_PER_DEGREE,_e=(66.5392+.013*i+1.5419*I+.0239*w-.0278*M+.0068*O-.0029*B+9e-4*N+8e-4*te-9e-4*ee)*X.RADIANS_PER_DEGREE,ae=(38.3213+13.17635815*n-14e-13*n*n+3.561*S+.1208*C-.0642*V+.0158*L+.0252*Z-.0066*E-.0047*P-.0046*W+.0028*v+.0052*A+.004*b+.0019*R-.0044*G)*X.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*I*ese+.1208*w*tse-.0642*M*nse+.0158*O*ise+.0252*k*ose-.0066*B*rse-.0047*N*sse-.0046*z*ase+.0028*K*cse+.0052*te*lse+.004*H*dse+.0019*j*use-.0044*ee*mse)/86400*X.RADIANS_PER_DEGREE;return l(t)||(t=new sI),t.rightAscension=pe,t.declination=_e,t.rotation=ae,t.rotationRate=ye,t};var aI=hse;var Ynn=_(T(),1);function fse(e){(!l(e)||typeof e!="function")&&(e=aI.ComputeMoon),this._computeFunction=e}var XFe=new m,WFe=new m,PFe=new m;function vFe(e,t,n){let i=XFe;i.x=Math.cos(e+X.PI_OVER_TWO),i.y=Math.sin(e+X.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=PFe;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=m.cross(r,i,WFe);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var wFe=new $,FFe=new we;fse.prototype.evaluate=function(e,t){l(e)||(e=q.now());let n=this._computeFunction(e),i=vFe(n.rightAscension,n.declination,t),o=X.zeroToTwoPi(n.rotation),r=we.fromAxisAngle(m.UNIT_Z,o,FFe),s=$.fromQuaternion(we.conjugate(r,r),wFe);return $.multiply(s,i,i)};var cI=fse;var Knn=_(T(),1);var lI={};lI.type=void 0;lI.getRequiredDataPoints=fe.throwInstantiationError;lI.interpolateOrderZero=fe.throwInstantiationError;lI.interpolate=fe.throwInstantiationError;var yH=lI;var Qnn=_(T(),1),AFe={STEP:0,LINEAR:1,CUBICSPLINE:2},Om=Object.freeze(AFe);var qnn=_(T(),1),MFe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},Kp=Object.freeze(MFe);var pin=_(T(),1);var rin=_(T(),1);function xH(e){this._url=Re.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(xH.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});xH.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===dg.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=le.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=m.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var dI=xH;function NFe(e){if(!Object.values(Kp).some(t=>t===e))throw new fe(`Invalid geocodeProviderType: "${e}"`)}var pse=Object.freeze({[Kp.GOOGLE]:"google",[Kp.BING]:"bing",[Kp.DEFAULT]:void 0});function kFe(e){return pse[e]}function UFe(e){return Object.entries(pse).find(t=>t[1]===e)[0]}function _H(e){e=e??Y.EMPTY_OBJECT;let t=e.geocodeProviderType??Kp.DEFAULT,n=e.accessToken??wm.defaultAccessToken,i=Re.createIfNeeded(e.server??wm.defaultServer);i.appendForwardSlash();let o=wm.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Gt.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 dI(r),this.geocodeProviderType=t}Object.defineProperties(_H.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return UFe(this._pelias.url.queryParameters.geocoder)},set:function(e){NFe(e);let t={...this._pelias.url.queryParameters,geocoder:kFe(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});_H.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var Qx=_H;var Lin=_(T(),1);var Tin=_(T(),1);function qo(e){e=e??Y.EMPTY_OBJECT,this.start=l(e.start)?q.clone(e.start):new q,this.stop=l(e.stop)?q.clone(e.stop):new q,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(qo.prototype,{isEmpty:{get:function(){let e=q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var DC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};qo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new fe("options.iso8601 is an invalid ISO 8601 interval.");let i=q.fromIso8601(n[0]),o=q.fromIso8601(n[1]),r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(DC.start=i,DC.stop=o,DC.isStartIncluded=r,DC.isStopIncluded=s,DC.data=a,new qo(DC))};qo.toIso8601=function(e,t){return`${q.toIso8601(e.start,t)}/${q.toIso8601(e.stop,t)}`};qo.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 qo(e)};qo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&q.equals(e.start,t.start)&&q.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};qo.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&&q.equalsEpsilon(e.start,t.start,n)&&q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};qo.intersect=function(e,t,n,i){if(!l(t))return qo.clone(qo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=q.greaterThanOrEquals(s,o)&&q.greaterThanOrEquals(r,s),d=!c&&q.lessThanOrEquals(s,o)&&q.lessThanOrEquals(o,a);if(!c&&!d)return qo.clone(qo.EMPTY,n);let u=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,f=q.lessThan(r,a);return l(n)||(n=new qo),n.start=c?s:o,n.isStartIncluded=u&&p||!q.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?h:h&&g||!q.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};qo.contains=function(e,t){if(e.isEmpty)return!1;let n=q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};qo.prototype.clone=function(e){return qo.clone(this,e)};qo.prototype.equals=function(e,t){return qo.equals(this,e,t)};qo.prototype.equalsEpsilon=function(e,t,n){return qo.equalsEpsilon(this,e,t,n)};qo.prototype.toString=function(){return qo.toIso8601(this)};qo.EMPTY=Object.freeze(new qo({start:new q,stop:new q,isStartIncluded:!1,isStopIncluded:!1}));var Rn=qo;var bse=Object.freeze(q.fromIso8601("0000-01-01T00:00:00Z")),gse=Object.freeze(q.fromIso8601("9999-12-31T24:00:00Z")),DFe=Object.freeze(new Rn({start:bse,stop:gse})),OFe={MINIMUM_VALUE:bse,MAXIMUM_VALUE:gse,MAXIMUM_INTERVAL:DFe},Oe=OFe;var Iin=_(T(),1);var gs={};gs.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});gs.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});gs.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});gs.defaultAccessToken=void 0;gs.defaultShareKey=void 0;gs._getAuthorizationHeader=function(){return l(gs.defaultShareKey)?`Basic ${gs.defaultShareKey}`:`Bearer ${gs.defaultAccessToken}`};gs.apiEndpoint=new Re({url:"https://api.bentley.com"});gs.getExports=async function(e){let t=new Re({url:`${gs.apiEndpoint}mesh-export`,headers:{Authorization:gs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:gs.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);throw n.statusCode===401?new ce(`Unauthorized, bad token, wrong scopes or headers bad. ${i.error.details[0].code}`):n.statusCode===403?(console.error(i.error.code,i.error.message),new ce("Not allowed, forbidden")):n.statusCode===422?new ce(`Unprocessable Entity:${i.error.code} ${i.error.message}`):n.statusCode===429?new ce("Too many requests"):new ce(`Unknown request failure ${n.statusCode}`)}};gs.getRealityDataMetadata=async function(e,t){let n=new Re({url:`${gs.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:gs._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);throw i.statusCode===401?new ce(`Unauthorized, bad token, wrong scopes or headers bad. ${o.error.details[0].code}`):i.statusCode===403?(console.error(o.error.code,o.error.message),new ce("Not allowed, forbidden")):i.statusCode===404?new ce(`Reality data not found: ${e}, ${t}`):i.statusCode===422?new ce(`Unprocessable Entity:${o.error.code} ${o.error.message}`):i.statusCode===429?new ce("Too many requests"):new ce(`Unknown request failure ${i.statusCode}`)}};gs.getRealityDataURL=async function(e,t,n){let i=new Re({url:`${gs.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:gs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);throw o.statusCode===401?new ce(`Unauthorized, bad token, wrong scopes or headers bad. ${r.error.details[0].code}`):o.statusCode===403?(console.error(r.error.code,r.error.message),new ce("Not allowed, forbidden")):o.statusCode===404?new ce(`Reality data not found: ${e}, ${t}`):o.statusCode===422?new ce(`Unprocessable Entity:${r.error.code} ${r.error.message}`):o.statusCode===429?new ce("Too many requests"):new ce(`Unknown request failure ${o.statusCode}`)}};var Xs=gs;var Win=_(T(),1),BFe={SHIFT:0,CTRL:1,ALT:2},Js=Object.freeze(BFe);var win=_(T(),1);var TH={type:"Lagrange"};TH.getRequiredDataPoints=function(e){return Math.max(e+1,2)};TH.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let d=t[r]-t[s];c*=(e-t[s])/d}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var uI=TH;var Min=_(T(),1);var SH={type:"Linear"};SH.getRequiredDataPoints=function(e){return 2};SH.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],d=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+d*s-c*a)/(d-c);return o};var jx=SH;var Din=_(T(),1);function YFe(e){let t=e.uint8Array,n=e.format,i=e.request,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return Re.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Re.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Re({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var qx=YFe;var Bin=_(T(),1);function _f(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(_f.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}}});_f.prototype.get=function(e){return this._array[e]};_f.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};_f.prototype.peek=function(){return this._array[this._length-1]};_f.prototype.push=function(e){let t=this.length++;this._array[t]=e};_f.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};_f.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};_f.prototype.resize=function(e){this.length=e};_f.prototype.trim=function(e){e=e??this._length,this._array.length=e};var qc=_f;var Hin=_(T(),1);function $5(){fe.throwInstantiationError()}Object.defineProperties($5.prototype,{ellipsoid:{get:fe.throwInstantiationError}});$5.prototype.project=fe.throwInstantiationError;$5.prototype.unproject=fe.throwInstantiationError;var CH=$5;var Jin=_(T(),1);var VH=[],LH=[];function zFe(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=VH,d=LH,u,h;for(u=0;u<s;++u)c[u]=e[i+u];for(h=0;h<a;++h)d[h]=e[o+h+1];u=0,h=0;for(let p=i;p<=r;++p){let g=c[u],f=d[h];u<s&&(h>=a||t(g,f,n)<=0)?(e[p]=g,++u):h<a&&(e[p]=f,++h)}}function RH(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);RH(e,t,n,i,r),RH(e,t,n,r+1,o),zFe(e,t,n,i,r,o)}function HFe(e,t,n){let i=e.length,o=Math.ceil(i*.5);VH.length=o,LH.length=o,RH(e,t,n,0,i-1),VH.length=0,LH.length=0}var Jp=HFe;var eon=_(T(),1);function OC(e){e=e??Y.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(OC.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});OC.prototype.findTimeInterval=so.prototype.findTimeInterval;OC.prototype.wrapTime=so.prototype.wrapTime;OC.prototype.clampTime=so.prototype.clampTime;OC.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var ZH=OC;var ion=_(T(),1);var mI={};function yse(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function GH(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function xse(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 EH(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}mI.encode2D=function(e,t){return(yse(e)|yse(t)<<1)>>>0};mI.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=xse(e),t[1]=xse(e>>1),t};mI.encode3D=function(e,t,n){return GH(e)|GH(t)<<1|GH(n)<<2};mI.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=EH(e),t[1]=EH(e>>1),t[2]=EH(e>>2),t};var fg=mI;var son=_(T(),1);function Eu(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Eu.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 Eu(e.near,e.nearValue,e.far,e.farValue)};Eu.packedLength=4;Eu.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};Eu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Eu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Eu.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};Eu.prototype.clone=function(e){return Eu.clone(this,e)};Eu.prototype.equals=function(e){return Eu.equals(this,e)};var Ot=Eu;var gon=_(T(),1);var con=_(T(),1),KFe={NONE:-1,PARTIAL:0,FULL:1},ur=Object.freeze(KFe);function hc(e,t){this._occluderPosition=m.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var ek=new m;Object.defineProperties(hc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,ek),n=m.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=m.multiplyByScalar(t,n,ek);let a=o*o*n;s=m.add(e,m.multiplyByScalar(r,a,ek),ek)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});hc.fromBoundingSphere=function(e,t,n){return l(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new hc(e,t)};var Tse=new m;hc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,Tse),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var JFe=new m;hc.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,JFe),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,Tse),o=this._occluderRadius-n;if(o=m.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),o*o+n*n>m.magnitudeSquared(i)):!1;if(o>0){i=m.subtract(t,this._cameraPosition,i);let r=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var QFe=new m;hc.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return ur.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,QFe),o=this._occluderRadius-n,r=m.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return o*o+n*n<s?ur.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?ur.FULL:ur.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?ur.PARTIAL:ur.FULL))}}return ur.NONE};var tk=new m;hc.computeOccludeePoint=function(e,t,n){let i=m.clone(t),o=m.clone(e.center),r=e.radius,s=n.length,a=m.normalize(m.subtract(i,o,tk),tk),c=-m.dot(a,o),d=hc._anyRotationVector(o,a,c),u=hc._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let h;for(let g=1;g<s;++g){if(h=hc._horizonToPlaneNormalDotProduct(e,a,c,d,n[g]),!h)return;h<u&&(u=h)}if(u<.0017453283658983088)return;let p=r/u;return m.add(o,m.multiplyByScalar(a,p,tk),tk)};var jFe=[];hc.computeOccludeePointFromRectangle=function(e,t){t=t??ne.default;let n=le.subsample(e,t,0,jFe),i=de.fromPoints(n),o=m.ZERO;if(!m.equals(o,i.center))return hc.computeOccludeePoint(new de(o,t.minimumRadius),i.center,n)};var qFe=new m;hc._anyRotationVector=function(e,t,n){let i=m.abs(t,qFe),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new m,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,r),i),e,i),i)};var $Fe=new m;hc._rotationVector=function(e,t,n,i,o){let r=m.subtract(i,e,$Fe);if(r=m.normalize(r,r),m.dot(t,r)<.9999999847691291){let s=m.cross(t,r,r);if(m.magnitude(s)>X.EPSILON13)return m.normalize(s,new m)}return o};var IH=new m,eAe=new m,nk=new m,_se=new m;hc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=m.clone(o,IH),s=m.clone(e.center,eAe),a=e.radius,c=m.subtract(s,r,nk),d=m.magnitudeSquared(c),u=a*a;if(d<u)return!1;let h=d-u,p=Math.sqrt(h),f=1/Math.sqrt(d),x=p*f*p;c=m.normalize(c,c);let S=m.add(r,m.multiplyByScalar(c,x,_se),_se),C=Math.sqrt(h-x*x),V=this._rotationVector(s,t,n,r,i),L=m.fromElements(V.x*V.x*c.x+(V.x*V.y-V.z)*c.y+(V.x*V.z+V.y)*c.z,(V.x*V.y+V.z)*c.x+V.y*V.y*c.y+(V.y*V.z-V.x)*c.z,(V.x*V.z-V.y)*c.x+(V.y*V.z+V.x)*c.y+V.z*V.z*c.z,IH);L=m.normalize(L,L);let Z=m.multiplyByScalar(L,C,IH);V=m.normalize(m.subtract(m.add(S,Z,nk),s,nk),nk);let E=m.dot(t,V);V=m.normalize(m.subtract(m.subtract(S,Z,V),s,V),V);let P=m.dot(t,V);return E<P?E:P};var hI=hc;var Ton=_(T(),1);function fI(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(fI.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});fI.fromCartesian3=function(e){return new fI(e.x,e.y,e.z)};fI.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 io=fI;var Eon=_(T(),1);function XH(e,t,n){e=Re.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new Gt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(XH.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});XH.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Rt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=le.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var WH=XH;var Won=_(T(),1);var tAe={packedLength:void 0,pack:fe.throwInstantiationError,unpack:fe.throwInstantiationError},PH=tAe;var won=_(T(),1);var nAe={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:fe.throwInstantiationError,unpackInterpolationResult:fe.throwInstantiationError},vH=nAe;var Hon=_(T(),1);var kon=_(T(),1);function iAe(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),d=100,u=r.width+d|0,h=3*a,p=h/2;c.width=u,c.height=h;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,d/2,p)),o&&(g.fillStyle="black",g.fillText(t,d/2,p));let f=g.getImageData(0,0,u,h).data,y=f.length,x=u*4,S,C,V,L;for(S=0;S<y;++S)if(f[S]!==255){V=S/x|0;break}for(S=y-1;S>=0;--S)if(f[S]!==255){L=S/x|0;break}let Z=-1;for(S=0;S<u&&Z===-1;++S)for(C=0;C<h;++C){let E=S*4+C*x;if(f[E]!==255||f[E+1]!==255||f[E+2]!==255||f[E+3]!==255){Z=S;break}}return{width:r.width,height:L-V,ascent:p-V,descent:L-p,minx:Z-d/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var $x;function oAe(e,t){if(e==="")return;t=t??Y.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??D.TRANSPARENT,a=t.padding??0,c=a*2,d=document.createElement("canvas");d.width=1,d.height=1,d.style.font=n;let u=d.getContext("2d",{willReadFrequently:!0});l($x)||(l(u.imageSmoothingEnabled)?$x="imageSmoothingEnabled":l(u.mozImageSmoothingEnabled)?$x="mozImageSmoothingEnabled":l(u.webkitImageSmoothingEnabled)?$x="webkitImageSmoothingEnabled":l(u.msImageSmoothingEnabled)&&($x="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[$x]=!1,d.style.visibility="hidden",document.body.appendChild(d);let h=iAe(u,e,n,i,o);d.dimensions=h,document.body.removeChild(d),d.style.visibility="";let p=-h.minx,g=Math.ceil(h.width)+p+c,f=h.height+c,y=f-h.ascent+a,x=f-y+c;if(d.width=g,d.height=f,u.font=n,u.lineJoin="round",u.lineWidth=r,u[$x]=!1,s!==D.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,d.width,d.height)),i){let S=t.strokeColor??D.BLACK;u.strokeStyle=S.toCssColorString(),u.strokeText(e,p+a,x)}if(o){let S=t.fillColor??D.WHITE;u.fillStyle=S.toCssColorString(),u.fillText(e,p+a,x)}return d}var e_=oAe;function bI(){this._cache={}}bI.prototype.fromColor=function(e,t){return ik(void 0,void 0,e,t,this._cache)};bI.prototype.fromUrl=function(e,t,n){return ik(e,void 0,t,n,this._cache)};bI.prototype.fromMakiIconId=function(e,t,n){return ik(sn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};bI.prototype.fromText=function(e,t,n){return ik(void 0,e,t,n,this._cache)};var rAe=new D;function sAe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,rAe).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 Sse(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=D.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=D.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var pI=new Array(4);function ik(e,t,n,i,o){pI[0]=e,pI[1]=t,pI[2]=n,pI[3]=i;let r=JSON.stringify(pI),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(sAe(c,n,i),l(e)){let u=Re.createIfNeeded(e).fetchImage().then(function(h){return Sse(c,h,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=e_(t,{font:`bold ${i}px sans-serif`});Sse(c,d,i)}return o[r]=a,a}var Qp=bI;var rrn=_(T(),1);function BC(e){e=e??Y.EMPTY_OBJECT;let t=e.vertexFormat??Xe.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}BC.packedLength=Xe.packedLength;BC.pack=function(e,t,n){return n=n??0,Xe.pack(e._vertexFormat,t,n),t};var Cse=new Xe,aAe={vertexFormat:Cse};BC.unpack=function(e,t,n){t=t??0;let i=Xe.unpack(e,t,Cse);return l(n)?(n._vertexFormat=Xe.clone(i,n._vertexFormat),n):new BC(aAe)};var ok=new m(-.5,-.5,0),rk=new m(.5,.5,0);BC.createGeometry=function(e){let t=e._vertexFormat,n=new pn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=ok.x,o[1]=ok.y,o[2]=0,o[3]=rk.x,o[4]=ok.y,o[5]=0,o[6]=rk.x,o[7]=rk.y,o[8]=0,o[9]=ok.x,o[10]=rk.y,o[11]=0,n.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new ht({attributes:n,indices:i,primitiveType:Ae.TRIANGLES,boundingSphere:new de(m.ZERO,Math.sqrt(2))})};var gI=BC;var prn=_(T(),1);function YC(){this._workerName="createPlaneOutlineGeometry"}YC.packedLength=0;YC.pack=function(e,t){return t};YC.unpack=function(e,t,n){return l(n)?n:new YC};var pg=new m(-.5,-.5,0),sk=new m(.5,.5,0);YC.createGeometry=function(){let e=new pn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=pg.x,n[1]=pg.y,n[2]=pg.z,n[3]=sk.x,n[4]=pg.y,n[5]=pg.z,n[6]=sk.x,n[7]=sk.y,n[8]=pg.z,n[9]=pg.x,n[10]=sk.y,n[11]=pg.z,e.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new ht({attributes:e,indices:t,primitiveType:Ae.LINES,boundingSphere:new de(m.ZERO,Math.sqrt(2))})};var yI=YC;var _rn=_(T(),1);var cAe=new m;function lAe(e,t,n,i){let o=hx(e,t,n,i,cAe);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var wH=lAe;var rsn=_(T(),1);var Xrn=_(T(),1);function Ur(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Ur.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Ur.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=U.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(X.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=X.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=X.TWO_PI),e}}});var zC=new he,dAe=new m;Ur.prototype.getLatitude=function(e){l(e)||(e=ne.default),zC.latitude=this.conformalLatitude,zC.longitude=this.longitude,zC.height=0;let t=this.ellipsoid.cartographicToCartesian(zC,dAe);return e.cartesianToCartographic(t,zC),zC.latitude};var uAe=new yn,mAe=new m,hAe=new m;Ur.fromCartesian=function(e,t){let n=X.signNotZero(e.z),i=Ur.NORTH_POLE_TANGENT_PLANE,o=Ur.SOUTH_POLE;n<0&&(i=Ur.SOUTH_POLE_TANGENT_PLANE,o=Ur.NORTH_POLE);let r=uAe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=m.subtract(r.origin,o,mAe),m.normalize(r.direction,r.direction);let s=ei.rayPlane(r,i.plane,hAe),a=m.subtract(s,o,s),c=m.dot(i.xAxis,a),d=n*m.dot(i.yAxis,a);return l(t)?(t.position=new U(c,d),t.tangentPlane=i,t):new Ur(new U(c,d),i)};Ur.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]=Ur.fromCartesian(e[i],t[i]);return t};Ur.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Ur(e.position,e.tangentPlane)};Ur.HALF_UNIT_SPHERE=Object.freeze(new ne(.5,.5,.5));Ur.NORTH_POLE=Object.freeze(new m(0,0,.5));Ur.SOUTH_POLE=Object.freeze(new m(0,0,-.5));Ur.NORTH_POLE_TANGENT_PLANE=Object.freeze(new $r(Ur.NORTH_POLE,Ur.HALF_UNIT_SPHERE));Ur.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new $r(Ur.SOUTH_POLE,Ur.HALF_UNIT_SPHERE));var fc=Ur;var fAe=new he,Vse=new he;function pAe(e,t,n,i){let r=i.cartesianToCartographic(e,fAe).height,s=i.cartesianToCartographic(t,Vse);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,Vse);a.height=r-100,i.cartographicToCartesian(a,n)}var Lse=new ze,bAe=new m,gAe=new m,yAe=new m,xAe=new m,_Ae=new m,TAe=new m,ak=new m,Tf=new m,HC=new m,SAe=new U,CAe=new U,VAe=new m,Rse=new we,LAe=new $,RAe=new $;function FH(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,d=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let u=e.boundingRectangle,h=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,f=e.stRotation,y=e.perPositionHeight,x=SAe;x.x=u.x,x.y=u.y;let S=t.st?new Float32Array(2*(s/3)):void 0,C;t.normal&&(y&&c&&!a?C=n.attributes.normal.values:C=new Float32Array(s));let V=t.tangent?new Float32Array(s):void 0,L=t.bitangent?new Float32Array(s):void 0,Z=i?new Float32Array(s):void 0,E=0,P=0,W=gAe,v=yAe,A=xAe,b=!0,R=LAe,G=RAe;if(f!==0){let M=we.fromAxisAngle(h,f,Rse);R=$.fromQuaternion(M,R),M=we.fromAxisAngle(h,-f,Rse),G=$.fromQuaternion(M,G)}else R=$.clone($.IDENTITY,R),G=$.clone($.IDENTITY,G);let I=0,w=0;c&&d&&(I=s/2,w=s/3,s/=2);for(let M=0;M<s;M+=3){let O=m.fromArray(o,M,VAe);if(t.st&&!l(r)){let k=$.multiplyByVector(R,O,bAe);k=g.scaleToGeodeticSurface(k,k);let B=p([k],CAe)[0];U.subtract(B,x,B);let N=X.clamp(B.x/u.width,0,1),z=X.clamp(B.y/u.height,0,1);d&&(S[E+w]=N,S[E+1+w]=z),c&&(S[E]=N,S[E+1]=z),E+=2}if(t.normal||t.tangent||t.bitangent||i){let k=P+1,B=P+2;if(a){if(M+3<s){let N=m.fromArray(o,M+3,_Ae);if(b){let z=m.fromArray(o,M+s,TAe);y&&pAe(O,N,z,g),m.subtract(N,O,N),m.subtract(z,O,z),W=m.normalize(m.cross(z,N,W),W),b=!1}m.equalsEpsilon(N,O,X.EPSILON10)&&(b=!0)}(t.tangent||t.bitangent)&&(A=g.geodeticSurfaceNormal(O,A),t.tangent&&(v=m.normalize(m.cross(A,W,v),v)))}else W=g.geodeticSurfaceNormal(O,W),(t.tangent||t.bitangent)&&(y&&(ak=m.fromArray(C,P,ak),Tf=m.cross(m.UNIT_Z,ak,Tf),Tf=m.normalize($.multiplyByVector(G,Tf,Tf),Tf),t.bitangent&&(HC=m.normalize(m.cross(ak,Tf,HC),HC))),v=m.cross(m.UNIT_Z,W,v),v=m.normalize($.multiplyByVector(G,v,v),v),t.bitangent&&(A=m.normalize(m.cross(W,v,A),A)));t.normal&&(e.wall?(C[P+I]=W.x,C[k+I]=W.y,C[B+I]=W.z):d&&(C[P+I]=-W.x,C[k+I]=-W.y,C[B+I]=-W.z),(c&&!y||a)&&(C[P]=W.x,C[k]=W.y,C[B]=W.z)),i&&(a&&(W=g.geodeticSurfaceNormal(O,W)),Z[P+I]=-W.x,Z[k+I]=-W.y,Z[B+I]=-W.z),t.tangent&&(e.wall?(V[P+I]=v.x,V[k+I]=v.y,V[B+I]=v.z):d&&(V[P+I]=-v.x,V[k+I]=-v.y,V[B+I]=-v.z),c&&(y?(V[P]=Tf.x,V[k]=Tf.y,V[B]=Tf.z):(V[P]=v.x,V[k]=v.y,V[B]=v.z))),t.bitangent&&(d&&(L[P+I]=A.x,L[k+I]=A.y,L[B+I]=A.z),c&&(y?(L[P]=HC.x,L[k]=HC.y,L[B]=HC.z):(L[P]=A.x,L[k]=A.y,L[B]=A.z))),P+=3}}t.st&&!l(r)&&(n.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:S})),t.normal&&(n.attributes.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(n.attributes.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:V})),t.bitangent&&(n.attributes.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:L})),i&&(n.attributes.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:Z}))}if(e.extrude&&l(e.offsetAttribute)){let u=o.length/3,h=new Uint8Array(u);if(e.offsetAttribute===ln.TOP)c&&d||a?h=h.fill(1,0,u/2):c&&(h=h.fill(1));else{let p=e.offsetAttribute===ln.NONE?0:1;h=h.fill(p)}n.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var Zse=[];function ZAe(e,t,n,i,o,r,s,a,c,d){let u={walls:[]},h;if(s||a){let C=Un.createGeometryFromPositions(e,t,n,i,r,c,d),V=C.attributes.position.values,L=C.indices,Z,E;if(s&&a){let P=V.concat(V);Z=P.length/3,E=Ne.createTypedArray(Z,L.length*2),E.set(L);let W=L.length,v=Z/2;for(h=0;h<W;h+=3){let A=E[h]+v,b=E[h+1]+v,R=E[h+2]+v;E[h+W]=R,E[h+1+W]=b,E[h+2+W]=A}if(C.attributes.position.values=P,r&&c.normal){let A=C.attributes.normal.values;C.attributes.normal.values=new Float32Array(P.length),C.attributes.normal.values.set(A)}if(c.st&&l(n)){let A=C.attributes.st.values;C.attributes.st.values=new Float32Array(Z*2),C.attributes.st.values=A.concat(A)}C.indices=E}else if(a){for(Z=V.length/3,E=Ne.createTypedArray(Z,L.length),h=0;h<L.length;h+=3)E[h]=L[h+2],E[h+1]=L[h+1],E[h+2]=L[h];C.indices=E}u.topAndBottom=new Xt({geometry:C})}let p=o.outerRing,g=$r.fromPoints(p,e),f=g.projectPointsOntoPlane(p,Zse),y=ri.computeWindingOrder2D(f);y===fs.CLOCKWISE&&(p=p.slice().reverse());let x=Un.computeWallGeometry(p,n,e,i,r,d);u.walls.push(new Xt({geometry:x}));let S=o.holes;for(h=0;h<S.length;h++){let C=S[h];f=g.projectPointsOntoPlane(C,Zse),y=ri.computeWindingOrder2D(f),y===fs.COUNTER_CLOCKWISE&&(C=C.slice().reverse()),x=Un.computeWallGeometry(C,n,e,i,r,d),u.walls.push(new Xt({geometry:x}))}return u}function Xu(e){let t=e.polygonHierarchy,n=e.vertexFormat??Xe.DEFAULT,i=e.ellipsoid??ne.default,o=e.granularity??X.RADIANS_PER_DEGREE,r=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),d=e.height??0,u=e.extrudedHeight??d;if(!c){let h=Math.max(d,u);u=Math.min(d,u),d=h}this._vertexFormat=Xe.clone(n),this._ellipsoid=ne.clone(i),this._granularity=o,this._stRotation=r,this._height=d,this._extrudedHeight=u,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??on.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Un.computeHierarchyPackedLength(t,m)+ne.packedLength+Xe.packedLength+(s?Un.computeHierarchyPackedLength(s,U):1)+12}Xu.fromPositions=function(e){e=e??Y.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 Xu(t)};Xu.pack=function(e,t,n){return n=n??0,n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,m),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.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=Un.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n++]=e.packedLength,t};var GAe=ne.clone(ne.UNIT_SPHERE),EAe=new Xe,IAe={polygonHierarchy:{}};Xu.unpack=function(e,t,n){t=t??0;let i=Un.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,GAe);t+=ne.packedLength;let r=Xe.unpack(e,t,EAe);t+=Xe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++]===1,h=e[t++]===1,p=e[t++]===1,g=e[t++]===1,f=e[t++]===1,y=e[t++],x=e[t++],S=e[t]===-1?void 0:Un.unpackPolygonHierarchy(e,t,U);l(S)?(t=S.startingIndex,delete S.startingIndex):t++;let C=e[t++];return l(n)||(n=new Xu(IAe)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=d,n._perPositionHeightExtrude=u,n._perPositionHeight=h,n._closeTop=p,n._closeBottom=g,n._shadowVolume=f,n._offsetAttribute=y===-1?void 0:y,n._arcType=x,n._textureCoordinates=S,n.packedLength=C,n};var XAe=new U,WAe=new U,PAe=new fc;function Gse(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+X.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),d=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==on.RHUMB){let p=U.subtract(t.position,e.position,XAe),g=U.dot(t.position,p)/U.dot(p,p);if(g>0&&g<1){let f=U.add(t.position,U.multiplyByScalar(p,-g,p),WAe),y=fc.clone(t,PAe);y.position=f;let x=y.getLatitude(n);r.south=Math.min(r.south,x),r.north=Math.max(r.north,x),Math.abs(c)>Math.abs(x)&&(d=x)}}let u=t.x*e.y-e.x*t.y,h=Math.sign(u);h!==0&&(h*=U.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=h),d<=0&&(o.southAngle+=h)}var Ese=new fc,vAe=new fc,Iu={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Xu.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new le),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,Iu.northAngle=0,Iu.southAngle=0,Iu.westOverIdl=Number.POSITIVE_INFINITY,Iu.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=fc.fromCartesian(e[0],vAe);for(let s=1;s<o;s++){let a=fc.fromCartesian(e[s],Ese);Gse(a,r,t,n,Iu,i),r=fc.clone(a,r)}return Gse(fc.fromCartesian(e[0],Ese),r,t,n,Iu,i),i.east-i.west>Iu.eastOverIdl-Iu.westOverIdl&&(i.west=Iu.westOverIdl,i.east=Iu.eastOverIdl,i.east>X.PI&&(i.east=i.east-X.TWO_PI),i.west>X.PI&&(i.west=i.west-X.TWO_PI)),X.equalsEpsilon(Math.abs(Iu.northAngle),X.TWO_PI,X.EPSILON10)&&(i.north=X.PI_OVER_TWO,i.east=X.PI,i.west=-X.PI),X.equalsEpsilon(Math.abs(Iu.southAngle),X.TWO_PI,X.EPSILON10)&&(i.south=-X.PI_OVER_TWO,i.east=X.PI,i.west=-X.PI),i};var wAe=new fc;function FAe(e,t,n){return e.height>=X.PI||e.width>=X.PI?fc.fromCartesian(t[0],wAe).tangentPlane:$r.fromPoints(t,n)}var Ise=new he;function AAe(e,t,n){return(i,o)=>{if(e.height>=X.PI||e.width>=X.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],Ise);o[s]=new U(a.longitude/X.PI,a.latitude/X.PI_OVER_TWO)}return o.length=i.length,o}return fc.fromCartesianArray(i,o)}return $r.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function MAe(e,t,n){if(e.height>=X.PI||e.width>=X.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,Ise);return l(r)||(r=new U),r.x=s.longitude/X.PI,r.y=s.latitude/X.PI_OVER_TWO,r}return fc.fromCartesian(o,r)};let i=$r.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function NAe(e,t,n,i){return(o,r)=>!i&&(e.height>=X.PI_OVER_TWO||e.width>=2*X.PI_OVER_THREE)?Un.splitPolygonsOnEquator(o,t,n,r):o}function kAe(e,t,n,i){if(t.height>=X.PI||t.width>=X.PI)return ze.fromRectangle(t,void 0,Lse);let o=e,r=$r.fromPoints(o,n);return Un.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Lse)}Xu.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,d=e._arcType,u=e._textureCoordinates,h=l(u),p=r.positions;if(p.length<3)return;let g=e.rectangle,f=Un.polygonsFromHierarchy(r,h,AAe(g,p,n),!s,n,NAe(g,n,d,s)),y=f.hierarchy,x=f.polygons,S=function(I){return I},C=h?Un.polygonsFromHierarchy(u,!0,S,!1,n).polygons:void 0;if(y.length===0)return;let V=y[0].outerRing,L=kAe(V,g,n,o),Z=[],E=e._height,P=e._extrudedHeight,W=e._perPositionHeightExtrude||!X.equalsEpsilon(E,P,0,X.EPSILON2),v={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:FAe(g,V,n).plane.normal,projectTo2d:MAe(g,V,n),boundingRectangle:L,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},A;if(W)for(v.extrude=!0,v.top=a,v.bottom=c,v.shadowVolume=e._shadowVolume,v.offsetAttribute=e._offsetAttribute,A=0;A<x.length;A++){let I=ZAe(n,x[A],h?C[A]:void 0,i,y[A],s,a,c,t,d),w;a&&c?(w=I.topAndBottom,v.geometry=Un.scaleToGeodeticHeightExtruded(w.geometry,E,P,n,s)):a?(w=I.topAndBottom,w.geometry.attributes.position.values=ri.scaleToGeodeticHeight(w.geometry.attributes.position.values,E,n,!s),v.geometry=w.geometry):c&&(w=I.topAndBottom,w.geometry.attributes.position.values=ri.scaleToGeodeticHeight(w.geometry.attributes.position.values,P,n,!0),v.geometry=w.geometry),(a||c)&&(v.wall=!1,w.geometry=FH(v),Z.push(w));let M=I.walls;v.wall=!0;for(let O=0;O<M.length;O++){let k=M[O];v.geometry=Un.scaleToGeodeticHeightExtruded(k.geometry,E,P,n,s),k.geometry=FH(v),Z.push(k)}}else for(A=0;A<x.length;A++){let I=new Xt({geometry:Un.createGeometryFromPositions(n,x[A],h?C[A]:void 0,i,s,t,d)});if(I.geometry.attributes.position.values=ri.scaleToGeodeticHeight(I.geometry.attributes.position.values,E,n,!s),v.geometry=I.geometry,I.geometry=FH(v),l(e._offsetAttribute)){let w=I.geometry.attributes.position.values.length,M=e._offsetAttribute===ln.NONE?0:1,O=new Uint8Array(w/3).fill(M);I.geometry.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}Z.push(I)}let b=An.combineInstances(Z)[0];b.attributes.position.values=new Float64Array(b.attributes.position.values),b.indices=Ne.createTypedArray(b.attributes.position.values.length/3,b.indices);let R=b.attributes,G=de.fromVertices(R.position.values);return t.position||delete R.position,new ht({attributes:R,indices:b.indices,primitiveType:b.primitiveType,boundingSphere:G,offsetAttribute:e._offsetAttribute})};Xu.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Xu({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function UAe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return ht._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(Xu.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Xu.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=UAe(this)),this._textureCoordinateRotationPoints}}});var jp=Xu;var Zsn=_(T(),1);var Xse=[],ck=[];function DAe(e,t,n,i,o){let s=$r.fromPoints(t,e).projectPointsOntoPlane(t,Xse);ri.computeWindingOrder2D(s)===fs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,h=0;if(i)for(c=new Float64Array(u*2*3),d=0;d<u;d++){let f=t[d],y=t[(d+1)%u];c[h++]=f.x,c[h++]=f.y,c[h++]=f.z,c[h++]=y.x,c[h++]=y.y,c[h++]=y.z}else{let f=0;if(o===on.GEODESIC)for(d=0;d<u;d++)f+=Un.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===on.RHUMB)for(d=0;d<u;d++)f+=Un.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(f*3),d=0;d<u;d++){let y;o===on.GEODESIC?y=Un.subdivideLine(t[d],t[(d+1)%u],n,ck):o===on.RHUMB&&(y=Un.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,ck));let x=y.length;for(let S=0;S<x;++S)c[h++]=y[S]}}u=c.length/3;let p=u*2,g=Ne.createTypedArray(u,p);for(h=0,d=0;d<u-1;d++)g[h++]=d,g[h++]=d+1;return g[h++]=u-1,g[h++]=0,new Xt({geometry:new ht({attributes:new pn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Ae.LINES})})}function OAe(e,t,n,i,o){let s=$r.fromPoints(t,e).projectPointsOntoPlane(t,Xse);ri.computeWindingOrder2D(s)===fs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,h=new Array(u),p=0;if(i)for(c=new Float64Array(u*2*3*2),d=0;d<u;++d){h[d]=p/3;let x=t[d],S=t[(d+1)%u];c[p++]=x.x,c[p++]=x.y,c[p++]=x.z,c[p++]=S.x,c[p++]=S.y,c[p++]=S.z}else{let x=0;if(o===on.GEODESIC)for(d=0;d<u;d++)x+=Un.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===on.RHUMB)for(d=0;d<u;d++)x+=Un.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(x*3*2),d=0;d<u;++d){h[d]=p/3;let S;o===on.GEODESIC?S=Un.subdivideLine(t[d],t[(d+1)%u],n,ck):o===on.RHUMB&&(S=Un.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,ck));let C=S.length;for(let V=0;V<C;++V)c[p++]=S[V]}}u=c.length/(3*2);let g=h.length,f=(u*2+g)*2,y=Ne.createTypedArray(u+g,f);for(p=0,d=0;d<u;++d)y[p++]=d,y[p++]=(d+1)%u,y[p++]=d+u,y[p++]=(d+1)%u+u;for(d=0;d<g;d++){let x=h[d];y[p++]=x,y[p++]=x+u}return new Xt({geometry:new ht({attributes:new pn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Ae.LINES})})}function t_(e){let t=e.polygonHierarchy,n=e.ellipsoid??ne.default,i=e.granularity??X.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&l(e.extrudedHeight),s=e.arcType??on.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!r){let d=Math.max(a,c);c=Math.min(a,c),a=d}this._ellipsoid=ne.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Un.computeHierarchyPackedLength(t,m)+ne.packedLength+8}t_.pack=function(e,t,n){return n=n??0,n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,m),ne.pack(e._ellipsoid,t,n),n+=ne.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 BAe=ne.clone(ne.UNIT_SPHERE),YAe={polygonHierarchy:{}};t_.unpack=function(e,t,n){t=t??0;let i=Un.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,BAe);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,d=e[t++]===1,u=e[t++],h=e[t++],p=e[t];return l(n)||(n=new t_(YAe)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=d,n._perPositionHeightExtrude=c,n._arcType=u,n._offsetAttribute=h===-1?void 0:h,n.packedLength=p,n};t_.fromPositions=function(e){e=e??Y.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 t_(t)};t_.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Un.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],d=X.chordLength(n,t.maximumRadius),u=e._height,h=e._extrudedHeight,p=e._perPositionHeightExtrude||!X.equalsEpsilon(u,h,0,X.EPSILON2),g,f;if(p)for(f=0;f<s.length;f++){if(a=OAe(t,s[f],d,o,r),a.geometry=Un.scaleToGeodeticHeightExtruded(a.geometry,u,h,t,o),l(e._offsetAttribute)){let S=a.geometry.attributes.position.values.length/3,C=new Uint8Array(S);e._offsetAttribute===ln.TOP?C=C.fill(1,0,S/2):(g=e._offsetAttribute===ln.NONE?0:1,C=C.fill(g)),a.geometry.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}c.push(a)}else for(f=0;f<s.length;f++){if(a=DAe(t,s[f],d,o,r),a.geometry.attributes.position.values=ri.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),l(e._offsetAttribute)){let S=a.geometry.attributes.position.values.length;g=e._offsetAttribute===ln.NONE?0:1;let C=new Uint8Array(S/3).fill(g);a.geometry.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}c.push(a)}let y=An.combineInstances(c)[0],x=de.fromVertices(y.attributes.position.values);return new ht({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:x,offsetAttribute:e._offsetAttribute})};var xI=t_;var Hsn=_(T(),1);var Fse=[];function zAe(e,t,n,i,o){let r=Fse;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,h=i.red,p=i.green,g=i.blue,f=i.alpha;if(D.equals(n,i)){for(s=0;s<o;s++)r[s]=D.clone(n);return r}let y=(h-a)/o,x=(p-c)/o,S=(g-d)/o,C=(f-u)/o;for(s=0;s<o;s++)r[s]=new D(a+s*y,c+s*x,d+s*S,u+s*C);return r}function _I(e){e=e??Y.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=Xe.clone(e.vertexFormat??Xe.DEFAULT),this._arcType=e.arcType??on.GEODESIC,this._granularity=e.granularity??X.RADIANS_PER_DEGREE,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._workerName="createPolylineGeometry";let r=1+t.length*m.packedLength;r+=l(n)?1+n.length*D.packedLength:1,this.packedLength=r+ne.packedLength+Xe.packedLength+4}_I.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Ase=ne.clone(ne.UNIT_SPHERE),Mse=new Xe,n_={positions:void 0,colors:void 0,ellipsoid:Ase,vertexFormat:Mse,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};_I.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=ne.unpack(e,t,Ase);t+=ne.packedLength;let c=Xe.unpack(e,t,Mse);t+=Xe.packedLength;let d=e[t++],u=e[t++]===1,h=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=Xe.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=h,n._granularity=p,n):(n_.positions=r,n_.colors=s,n_.width=d,n_.colorsPerVertex=u,n_.arcType=h,n_.granularity=p,new _I(n_))};var Wse=new m,Pse=new m,vse=new m,wse=new m;_I.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,d,u,h=[],p=Co(e._positions,m.equalsEpsilon,!1,h);if(l(i)&&h.length>0){let w=0,M=h[0];i=i.filter(function(O,k){let B=!1;return o?B=k===M||k===0&&M===1:B=k+1===M,B?(w++,M=h[w],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===on.GEODESIC||r===on.RHUMB){let w,M;r===on.GEODESIC?(w=X.chordLength(s,a.maximumRadius),M=wi.numberOfPoints):(w=s,M=wi.numberOfPointsRhumbLine);let O=wi.extractHeights(p,a);if(l(i)){let k=1;for(c=0;c<g-1;++c)k+=M(p[c],p[c+1],w);let B=new Array(k),N=0;for(c=0;c<g-1;++c){let z=p[c],K=p[c+1],te=i[c],H=M(z,K,w);if(o&&c<k){let j=i[c+1],ee=zAe(z,K,te,j,H),pe=ee.length;for(d=0;d<pe;++d)B[N++]=ee[d]}else for(d=0;d<H;++d)B[N++]=D.clone(te)}B[N]=D.clone(i[i.length-1]),i=B,Fse.length=0}r===on.GEODESIC?p=wi.generateCartesianArc({positions:p,minDistance:w,ellipsoid:a,height:O}):p=wi.generateCartesianRhumbArc({positions:p,granularity:w,ellipsoid:a,height:O})}g=p.length;let f=g*4-4,y=new Float64Array(f*3),x=new Float64Array(f*3),S=new Float64Array(f*3),C=new Float32Array(f*2),V=n.st?new Float32Array(f*2):void 0,L=l(i)?new Uint8Array(f*4):void 0,Z=0,E=0,P=0,W=0,v;for(d=0;d<g;++d){d===0?(v=Wse,m.subtract(p[0],p[1],v),m.add(p[0],v,v)):v=p[d-1],m.clone(v,vse),m.clone(p[d],Pse),d===g-1?(v=Wse,m.subtract(p[g-1],p[g-2],v),m.add(p[g-1],v,v)):v=p[d+1],m.clone(v,wse);let w,M;l(L)&&(d!==0&&!o?w=i[d-1]:w=i[d],d!==g-1&&(M=i[d]));let O=d===0?2:0,k=d===g-1?2:4;for(u=O;u<k;++u){m.pack(Pse,y,Z),m.pack(vse,x,Z),m.pack(wse,S,Z),Z+=3;let B=u-2<0?-1:1;if(C[E++]=2*(u%2)-1,C[E++]=B*t,n.st&&(V[P++]=d/(g-1),V[P++]=Math.max(C[E-2],0)),l(L)){let N=u<2?w:M;L[W++]=D.floatToByte(N.red),L[W++]=D.floatToByte(N.green),L[W++]=D.floatToByte(N.blue),L[W++]=D.floatToByte(N.alpha)}}}let A=new pn;A.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:y}),A.prevPosition=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:x}),A.nextPosition=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:S}),A.expandAndWidth=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:C}),n.st&&(A.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:V})),l(L)&&(A.color=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:L,normalize:!0}));let b=Ne.createTypedArray(f,g*6-6),R=0,G=0,I=g-1;for(d=0;d<I;++d)b[G++]=R,b[G++]=R+2,b[G++]=R+1,b[G++]=R+1,b[G++]=R+2,b[G++]=R+3,R+=4;return new ht({attributes:A,indices:b,primitiveType:Ae.TRIANGLES,boundingSphere:de.fromPoints(p),geometryType:fu.POLYLINES})};var qp=_I;var gan=_(T(),1);function HAe(e,t,n,i){let o=new pn;i.position&&(o.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=ri.triangulate(t),d=(a-1)*r*6+c.length*2,u=Ne.createTypedArray(s,d),h,p,g,f,y,x,S=r*2,C=0;for(h=0;h<a-1;h++){for(p=0;p<r-1;p++)g=p*2+h*r*2,x=g+S,f=g+1,y=f+S,u[C++]=f,u[C++]=g,u[C++]=y,u[C++]=y,u[C++]=g,u[C++]=x;g=r*2-2+h*r*2,f=g+1,y=f+S,x=g+S,u[C++]=f,u[C++]=g,u[C++]=y,u[C++]=y,u[C++]=g,u[C++]=x}if(i.st||i.tangent||i.bitangent){let Z=new Float32Array(s*2),E=1/(a-1),P=1/n.height,W=n.height/2,v,A,b=0;for(h=0;h<a;h++){for(v=h*E,A=P*(t[0].y+W),Z[b++]=v,Z[b++]=A,p=1;p<r;p++)A=P*(t[p].y+W),Z[b++]=v,Z[b++]=A,Z[b++]=v,Z[b++]=A;A=P*(t[0].y+W),Z[b++]=v,Z[b++]=A}for(p=0;p<r;p++)v=0,A=P*(t[p].y+W),Z[b++]=v,Z[b++]=A;for(p=0;p<r;p++)v=(a-1)*E,A=P*(t[p].y+W),Z[b++]=v,Z[b++]=A;o.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:new Float32Array(Z)})}let V=s-r*2;for(h=0;h<c.length;h+=3){let Z=c[h]+V,E=c[h+1]+V,P=c[h+2]+V;u[C++]=Z,u[C++]=E,u[C++]=P,u[C++]=P+r,u[C++]=E+r,u[C++]=Z+r}let L=new ht({attributes:o,indices:u,boundingSphere:de.fromVertices(e),primitiveType:Ae.TRIANGLES});if(i.normal&&(L=An.computeNormal(L)),i.tangent||i.bitangent){try{L=An.computeTangentAndBitangent(L)}catch{Vt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(L.attributes.tangent=void 0),i.bitangent||(L.attributes.bitangent=void 0),i.st||(L.attributes.st=void 0)}return L}function SI(e){e=e??Y.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._cornerType=e.cornerType??vi.ROUNDED,this._vertexFormat=Xe.clone(e.vertexFormat??Xe.DEFAULT),this._granularity=e.granularity??X.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ne.packedLength+Xe.packedLength+2}SI.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Nse=ne.clone(ne.UNIT_SPHERE),kse=new Xe,TI={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Nse,vertexFormat:kse,cornerType:void 0,granularity:void 0};SI.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ne.unpack(e,t,Nse);t+=ne.packedLength;let c=Xe.unpack(e,t,kse);t+=Xe.packedLength;let d=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=Xe.clone(c,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(TI.polylinePositions=r,TI.shapePositions=s,TI.cornerType=d,TI.granularity=u,new SI(TI))};var KAe=new ze;SI.createGeometry=function(e){let t=e._positions,n=Co(t,m.equalsEpsilon),i=e._shape;if(i=Mm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ri.computeWindingOrder2D(i)===fs.CLOCKWISE&&i.reverse();let o=ze.fromPoints(i,KAe),r=Mm.computePositions(n,i,o,e,!0);return HAe(r,i,o,e._vertexFormat)};var CI=SI;var Man=_(T(),1);function JAe(e,t){let n=new pn;n.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Ne.createTypedArray(o,2*i*(s+1)),c,d,u=0;c=0;let h=c*i;for(d=0;d<i-1;d++)a[u++]=d+h,a[u++]=d+h+1;for(a[u++]=i-1+h,a[u++]=h,c=s-1,h=c*i,d=0;d<i-1;d++)a[u++]=d+h,a[u++]=d+h+1;for(a[u++]=i-1+h,a[u++]=h,c=0;c<s-1;c++){let g=i*c,f=g+i;for(d=0;d<i;d++)a[u++]=d+g,a[u++]=d+f}return new ht({attributes:n,indices:Ne.createTypedArray(o,a),boundingSphere:de.fromVertices(e),primitiveType:Ae.LINES})}function LI(e){e=e??Y.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._cornerType=e.cornerType??vi.ROUNDED,this._granularity=e.granularity??X.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ne.packedLength+2}LI.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Use=ne.clone(ne.UNIT_SPHERE),VI={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Use,height:void 0,cornerType:void 0,granularity:void 0};LI.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ne.unpack(e,t,Use);t+=ne.packedLength;let c=e[t++],d=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=d,n):(VI.polylinePositions=r,VI.shapePositions=s,VI.cornerType=c,VI.granularity=d,new LI(VI))};var QAe=new ze;LI.createGeometry=function(e){let t=e._positions,n=Co(t,m.equalsEpsilon),i=e._shape;if(i=Mm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ri.computeWindingOrder2D(i)===fs.CLOCKWISE&&i.reverse();let o=ze.fromPoints(i,QAe),r=Mm.computePositions(n,i,o,e,!1);return JAe(r,i)};var RI=LI;var Uan=_(T(),1);function Dse(){fe.throwInstantiationError()}Dse.prototype.getURL=fe.throwInstantiationError;var AH=Dse;var Han=_(T(),1);function jAe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new we);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return we.fastSlerp(a,c,s,o)}}function KC(e){e=e??Y.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=jAe(this),this._lastTimeIndex=0}Object.defineProperties(KC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});KC.prototype.findTimeInterval=so.prototype.findTimeInterval;KC.prototype.wrapTime=so.prototype.wrapTime;KC.prototype.clampTime=so.prototype.clampTime;KC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var ZI=KC;var Qan=_(T(),1),Bse=_(Ose(),1);function lk(){this._tree=new Bse.default}function i_(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}i_.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};lk.prototype.insert=function(e,t){let n=i_.fromRectangleAndId(e,t,new i_);this._tree.insert(n)};function qAe(e,t){return e.id===t.id}var $Ae=new i_;lk.prototype.remove=function(e,t){let n=i_.fromRectangleAndId(e,t,$Ae);this._tree.remove(n,qAe)};var e9e=new i_;lk.prototype.collides=function(e){let t=i_.fromRectangleAndId("",e,e9e);return this._tree.collides(t)};var o_=lk;var Wcn=_(T(),1);var scn=_(T(),1);var Yse=Math.cos,zse=Math.sin,t9e=Math.sqrt,kH={};kH.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,d=e.boundingRectangle,u=c.latitude-e.granYCos*i+o*e.granXSin,h=Yse(u),p=zse(u),g=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,y=h*Yse(f),x=h*zse(f),S=a.x*y,C=a.y*x,V=t9e(S*y+C*x+g*p);if(r.x=S/V,r.y=C/V,r.z=g/V,n){let L=e.stNwCorner;l(L)?(u=L.latitude-e.stGranYCos*i+o*e.stGranXSin,f=L.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(f-e.stWest)*e.lonScalar,s.y=(u-e.stSouth)*e.latScalar):(s.x=(f-d.west)*e.lonScalar,s.y=(u-d.south)*e.latScalar)}};var n9e=new Xi,Wu=new m,i9e=new he,dk=new m,GI=new Ii;function Hse(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,d=n*a,u=Math.sin(t),h=i*u,p=n*u;GI._ellipsoid=ne.default,Wu=GI.project(e,Wu),Wu=m.subtract(Wu,dk,Wu);let g=Xi.fromRotation(t,n9e);Wu=Xi.multiplyByVector(g,Wu,Wu),Wu=m.add(Wu,dk,Wu),e=GI.unproject(Wu,e),r-=1,s-=1;let f=e.latitude,y=f+r*p,x=f-c*s,S=f-c*s+r*p,C=Math.max(f,y,x,S),V=Math.min(f,y,x,S),L=e.longitude,Z=L+r*d,E=L+s*h,P=L+s*h+r*d,W=Math.max(L,Z,E,P),v=Math.min(L,Z,E,P);return{north:C,south:V,east:W,west:v,granYCos:c,granYSin:h,granXCos:d,granXSin:p,nwCorner:e}}kH.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,d=e.north,u=e.south,h=!1,p=!1;d===X.PI_OVER_TWO&&(h=!0),u===-X.PI_OVER_TWO&&(p=!0);let g,f=d-u;c>a?g=X.TWO_PI-c+a:g=a-c;let y=Math.ceil(g/t)+1,x=Math.ceil(f/t)+1,S=g/(y-1),C=f/(x-1),V=le.northwest(e,r),L=le.center(e,i9e);(n!==0||i!==0)&&(L.longitude<V.longitude&&(L.longitude+=X.TWO_PI),GI._ellipsoid=ne.default,dk=GI.project(L,dk));let Z=C,E=S,P=0,W=0,v=le.clone(e,o),A={granYCos:Z,granYSin:P,granXCos:E,granXSin:W,nwCorner:V,boundingRectangle:v,width:y,height:x,northCap:h,southCap:p};if(n!==0){let b=Hse(V,n,S,C,L,y,x);d=b.north,u=b.south,a=b.east,c=b.west,A.granYCos=b.granYCos,A.granYSin=b.granYSin,A.granXCos=b.granXCos,A.granXSin=b.granXSin,v.north=d,v.south=u,v.east=a,v.west=c}if(i!==0){n=n-i;let b=le.northwest(v,s),R=Hse(b,n,S,C,L,y,x);A.stGranYCos=R.granYCos,A.stGranXCos=R.granXCos,A.stGranYSin=R.granYSin,A.stGranXSin=R.granXSin,A.stNwCorner=b,A.stWest=R.west,A.stSouth=R.south}return A};var Ws=kH;var UH=new m,Qse=new m,jse=new m,qse=new m,$se=new le,o9e=new U,r9e=new de,s9e=new de;function eae(e,t){let n=new ht({attributes:new pn,primitiveType:Ae.TRIANGLES});return n.attributes.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function a9e(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,d=qse,u=jse,h=Qse;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=m.fromArray(e,p,UH),f=c+1,y=c+2;h=n.geodeticSurfaceNormal(g,h),(t.tangent||t.bitangent)&&(m.cross(m.UNIT_Z,h,u),$.multiplyByVector(i,u,u),m.normalize(u,u),t.bitangent&&m.normalize(m.cross(h,u,d),d)),t.normal&&(r[c]=h.x,r[f]=h.y,r[y]=h.z),t.tangent&&(s[c]=u.x,s[f]=u.y,s[y]=u.z),t.bitangent&&(a[c]=d.x,a[f]=d.y,a[y]=d.z),c+=3}return eae(t,{positions:e,normals:r,tangents:s,bitangents:a})}var DH=new m,tae=new m;function c9e(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,d=0,u=!0,h=qse,p=jse,g=Qse;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let y=m.fromArray(e,f,UH),x=m.fromArray(e,(f+6)%i,DH);if(u){let S=m.fromArray(e,(f+3)%i,tae);m.subtract(x,y,x),m.subtract(S,y,S),g=m.normalize(m.cross(S,x,g),g),u=!1}m.equalsEpsilon(x,y,X.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(y,h),t.tangent&&(p=m.normalize(m.cross(h,g,p),p))),t.normal&&(o[a++]=g.x,o[a++]=g.y,o[a++]=g.z,o[a++]=g.x,o[a++]=g.y,o[a++]=g.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[d++]=h.x,s[d++]=h.y,s[d++]=h.z,s[d++]=h.x,s[d++]=h.y,s[d++]=h.z)}return eae(t,{positions:e,normals:o,tangents:r,bitangents:s})}function nae(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,d=o,u=o,h=0;s&&(c=1,u-=1,h+=1),a&&(d-=1,u-=1,h+=1),h+=r*u;let p=n.position?new Float64Array(h*3):void 0,g=n.st?new Float32Array(h*2):void 0,f=0,y=0,x=UH,S=o9e,C=Number.MAX_VALUE,V=Number.MAX_VALUE,L=-Number.MAX_VALUE,Z=-Number.MAX_VALUE;for(let R=c;R<d;++R)for(let G=0;G<r;++G)Ws.computePosition(t,i,n.st,R,G,x,S),p[f++]=x.x,p[f++]=x.y,p[f++]=x.z,n.st&&(g[y++]=S.x,g[y++]=S.y,C=Math.min(C,S.x),V=Math.min(V,S.y),L=Math.max(L,S.x),Z=Math.max(Z,S.y));if(s&&(Ws.computePosition(t,i,n.st,0,0,x,S),p[f++]=x.x,p[f++]=x.y,p[f++]=x.z,n.st&&(g[y++]=S.x,g[y++]=S.y,C=S.x,V=S.y,L=S.x,Z=S.y)),a&&(Ws.computePosition(t,i,n.st,o-1,0,x,S),p[f++]=x.x,p[f++]=x.y,p[f]=x.z,n.st&&(g[y++]=S.x,g[y]=S.y,C=Math.min(C,S.x),V=Math.min(V,S.y),L=Math.max(L,S.x),Z=Math.max(Z,S.y))),n.st&&(C<0||V<0||L>1||Z>1))for(let R=0;R<g.length;R+=2)g[R]=(g[R]-C)/(L-C),g[R+1]=(g[R+1]-V)/(Z-V);let E=a9e(p,n,i,t.tangentRotationMatrix),P=6*(r-1)*(u-1);s&&(P+=3*(r-1)),a&&(P+=3*(r-1));let W=Ne.createTypedArray(h,P),v=0,A=0,b;for(b=0;b<u-1;++b){for(let R=0;R<r-1;++R){let G=v,I=G+r,w=I+1,M=G+1;W[A++]=G,W[A++]=I,W[A++]=M,W[A++]=M,W[A++]=I,W[A++]=w,++v}++v}if(s||a){let R=h-1,G=h-1;s&&a&&(R=h-2);let I,w;if(v=0,s)for(b=0;b<r-1;b++)I=v,w=I+1,W[A++]=R,W[A++]=I,W[A++]=w,++v;if(a)for(v=(u-1)*r,b=0;b<r-1;b++)I=v,w=I+1,W[A++]=I,W[A++]=G,W[A++]=w,++v}return E.indices=W,n.st&&(E.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:g})),E}function JC(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 QC(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 OH=new Xe;function l9e(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,d=t.width,u;if(n){let Qe=Xe.clone(o,OH);Qe.normal=!0,e._vertexFormat=Qe}let h=nae(e,t);n&&(e._vertexFormat=o);let p=ri.scaleToGeodeticHeight(h.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,f=g*2,y=new Float64Array(f);y.set(p);let x=ri.scaleToGeodeticHeight(h.attributes.position.values,r,a);y.set(x,g),h.attributes.position.values=y;let S=o.normal?new Float32Array(f):void 0,C=o.tangent?new Float32Array(f):void 0,V=o.bitangent?new Float32Array(f):void 0,L=o.st?new Float32Array(f/3*2):void 0,Z,E;if(o.normal){for(E=h.attributes.normal.values,S.set(E),u=0;u<g;u++)E[u]=-E[u];S.set(E,g),h.attributes.normal.values=S}if(n){E=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let Qe=new Float32Array(f);for(u=0;u<g;u++)E[u]=-E[u];Qe.set(E,g),h.attributes.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:Qe})}let P,W=l(i);if(W){let Qe=g/3*2,Tt=new Uint8Array(Qe);i===ln.TOP?Tt=Tt.fill(1,0,Qe/2):(P=i===ln.NONE?0:1,Tt=Tt.fill(P)),h.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Tt})}if(o.tangent){let Qe=h.attributes.tangent.values;for(C.set(Qe),u=0;u<g;u++)Qe[u]=-Qe[u];C.set(Qe,g),h.attributes.tangent.values=C}if(o.bitangent){let Qe=h.attributes.bitangent.values;V.set(Qe),V.set(Qe,g),h.attributes.bitangent.values=V}o.st&&(Z=h.attributes.st.values,L.set(Z),L.set(Z,g/3*2),h.attributes.st.values=L);let v=h.indices,A=v.length,b=g/3,R=Ne.createTypedArray(f/3,A*2);for(R.set(v),u=0;u<A;u+=3)R[u+A]=v[u+2]+b,R[u+1+A]=v[u+1]+b,R[u+2+A]=v[u]+b;h.indices=R;let G=t.northCap,I=t.southCap,w=c,M=2,O=0,k=4,B=4;G&&(M-=1,w-=1,O+=1,k-=2,B-=1),I&&(M-=1,w-=1,O+=1,k-=2,B-=1),O+=M*d+2*w-k;let N=(O+B)*2,z=new Float64Array(N*3),K=n?new Float32Array(N*3):void 0,te=W?new Uint8Array(N):void 0,H=o.st?new Float32Array(N*2):void 0,j=i===ln.TOP;W&&!j&&(P=i===ln.ALL?1:0,te=te.fill(P));let ee=0,pe=0,_e=0,ae=0,ye=d*w,Se;for(u=0;u<ye;u+=d)Se=u*3,z=JC(z,ee,Se,p,x),ee+=6,o.st&&(H=QC(H,pe,u*2,Z),pe+=4),n&&(_e+=3,K[_e++]=E[Se],K[_e++]=E[Se+1],K[_e++]=E[Se+2]),j&&(te[ae++]=1,ae+=1);if(I){let Qe=G?ye+1:ye;for(Se=Qe*3,u=0;u<2;u++)z=JC(z,ee,Se,p,x),ee+=6,o.st&&(H=QC(H,pe,Qe*2,Z),pe+=4),n&&(_e+=3,K[_e++]=E[Se],K[_e++]=E[Se+1],K[_e++]=E[Se+2]),j&&(te[ae++]=1,ae+=1)}else for(u=ye-d;u<ye;u++)Se=u*3,z=JC(z,ee,Se,p,x),ee+=6,o.st&&(H=QC(H,pe,u*2,Z),pe+=4),n&&(_e+=3,K[_e++]=E[Se],K[_e++]=E[Se+1],K[_e++]=E[Se+2]),j&&(te[ae++]=1,ae+=1);for(u=ye-1;u>0;u-=d)Se=u*3,z=JC(z,ee,Se,p,x),ee+=6,o.st&&(H=QC(H,pe,u*2,Z),pe+=4),n&&(_e+=3,K[_e++]=E[Se],K[_e++]=E[Se+1],K[_e++]=E[Se+2]),j&&(te[ae++]=1,ae+=1);if(G){let Qe=ye;for(Se=Qe*3,u=0;u<2;u++)z=JC(z,ee,Se,p,x),ee+=6,o.st&&(H=QC(H,pe,Qe*2,Z),pe+=4),n&&(_e+=3,K[_e++]=E[Se],K[_e++]=E[Se+1],K[_e++]=E[Se+2]),j&&(te[ae++]=1,ae+=1)}else for(u=d-1;u>=0;u--)Se=u*3,z=JC(z,ee,Se,p,x),ee+=6,o.st&&(H=QC(H,pe,u*2,Z),pe+=4),n&&(_e+=3,K[_e++]=E[Se],K[_e++]=E[Se+1],K[_e++]=E[Se+2]),j&&(te[ae++]=1,ae+=1);let Ee=c9e(z,o,a);o.st&&(Ee.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:H})),n&&(Ee.attributes.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:K})),W&&(Ee.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Ie=Ne.createTypedArray(N,O*6),Fe,ve,ct,Je;g=z.length/3;let bt=0;for(u=0;u<g-1;u+=2){Fe=u,Je=(Fe+2)%g;let Qe=m.fromArray(z,Fe*3,DH),Tt=m.fromArray(z,Je*3,tae);m.equalsEpsilon(Qe,Tt,X.EPSILON10)||(ve=(Fe+1)%g,ct=(ve+2)%g,Ie[bt++]=Fe,Ie[bt++]=ve,Ie[bt++]=Je,Ie[bt++]=Je,Ie[bt++]=ve,Ie[bt++]=ct)}return Ee.indices=Ie,Ee=An.combineInstances([new Xt({geometry:h}),new Xt({geometry:Ee})]),Ee[0]}var d9e=[new m,new m,new m,new m],iae=new he,u9e=new he;function BH(e,t,n,i,o){if(n===0)return le.clone(e,o);let r=Ws.computeOptions(e,t,n,0,$se,iae),s=r.height,a=r.width,c=d9e;return Ws.computePosition(r,i,!1,0,0,c[0]),Ws.computePosition(r,i,!1,0,a-1,c[1]),Ws.computePosition(r,i,!1,s-1,0,c[2]),Ws.computePosition(r,i,!1,s-1,a-1,c[3]),le.fromCartesianArray(c,i,o)}function Sf(e){e=e??Y.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=le.clone(t),this._granularity=e.granularity??X.RADIANS_PER_DEGREE,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Xe.clone(e.vertexFormat??Xe.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}Sf.packedLength=le.packedLength+ne.packedLength+Xe.packedLength+7;Sf.pack=function(e,t,n){return n=n??0,le.pack(e._rectangle,t,n),n+=le.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.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 oae=new le,rae=ne.clone(ne.UNIT_SPHERE),bg={rectangle:oae,ellipsoid:rae,vertexFormat:OH,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Sf.unpack=function(e,t,n){t=t??0;let i=le.unpack(e,t,oae);t+=le.packedLength;let o=ne.unpack(e,t,rae);t+=ne.packedLength;let r=Xe.unpack(e,t,OH);t+=Xe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++]===1,p=e[t];return l(n)?(n._rectangle=le.clone(i,n._rectangle),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=d,n._extrudedHeight=u,n._shadowVolume=h,n._offsetAttribute=p===-1?void 0:p,n):(bg.granularity=s,bg.height=a,bg.rotation=c,bg.stRotation=d,bg.extrudedHeight=u,bg.shadowVolume=h,bg.offsetAttribute=p===-1?void 0:p,new Sf(bg))};Sf.computeRectangle=function(e,t){e=e??Y.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??X.RADIANS_PER_DEGREE,o=e.ellipsoid??ne.default,r=e.rotation??0;return BH(n,i,r,o,t)};var m9e=new $,Kse=new we,h9e=new he;Sf.createGeometry=function(e){if(X.equalsEpsilon(e._rectangle.north,e._rectangle.south,X.EPSILON10)||X.equalsEpsilon(e._rectangle.east,e._rectangle.west,X.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Ws.computeOptions(t,e._granularity,i,o,$se,iae,u9e),a=m9e;if(o!==0||i!==0){let g=le.center(t,h9e),f=n.geodeticSurfaceNormalCartographic(g,DH);we.fromAxisAngle(f,-o,Kse),$.fromQuaternion(Kse,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,d=e._extrudedHeight,u=!X.equalsEpsilon(c,d,0,X.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let h,p;if(t=e._rectangle,u){h=l9e(e,s);let g=de.fromRectangle3D(t,n,c,s9e),f=de.fromRectangle3D(t,n,d,r9e);p=de.union(g,f)}else{if(h=nae(e,s),h.attributes.position.values=ri.scaleToGeodeticHeight(h.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=h.attributes.position.values.length,f=e._offsetAttribute===ln.NONE?0:1,y=new Uint8Array(g/3).fill(f);h.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=de.fromRectangle3D(t,n,c)}return r.position||delete h.attributes.position,new ht({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Sf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Sf({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};var Jse=new le,f9e=[new U,new U,new U],p9e=new Xi,b9e=new he;function g9e(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=le.clone(e._rectangle,Jse),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=BH(t,n,o,i,Jse),s=f9e;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=Xi.fromRotation(e._stRotation,p9e),d=le.center(a,b9e);for(let f=0;f<3;++f){let y=s[f];y.x-=d.longitude,y.y-=d.latitude,Xi.multiplyByVector(c,y,y),y.x+=d.longitude,y.y+=d.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let u=s[0],h=s[1],p=s[2],g=new Array(6);return U.pack(u,g),U.pack(h,g,2),U.pack(p,g,4),g}Object.defineProperties(Sf.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=BH(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=g9e(this)),this._textureCoordinateRotationPoints}}});var r_=Sf;var jcn=_(T(),1);var y9e=new de,x9e=new de,_9e=new m,T9e=new le;function sae(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,d=0,u=4;r&&(c-=1,a-=1,d+=1,u-=2),s&&(c-=1,a-=1,d+=1,u-=2),d+=c*o+2*a-u;let h=new Float64Array(d*3),p=0,g=0,f,y=_9e;if(r)Ws.computePosition(t,n,!1,g,0,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;else for(f=0;f<o;f++)Ws.computePosition(t,n,!1,g,f,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;for(f=o-1,g=1;g<i;g++)Ws.computePosition(t,n,!1,g,f,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;if(g=i-1,!s)for(f=o-2;f>=0;f--)Ws.computePosition(t,n,!1,g,f,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;for(f=0,g=i-2;g>0;g--)Ws.computePosition(t,n,!1,g,f,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;let x=h.length/3*2,S=Ne.createTypedArray(h.length/3,x),C=0;for(let L=0;L<h.length/3-1;L++)S[C++]=L,S[C++]=L+1;S[C++]=h.length/3-1,S[C++]=0;let V=new ht({attributes:new pn,primitiveType:Ae.LINES});return V.attributes.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:h}),V.indices=S,V}function S9e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=sae(e,t),s=t.height,a=t.width,c=ri.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=c.length,u=new Float64Array(d*2);u.set(c);let h=ri.scaleToGeodeticHeight(r.attributes.position.values,i,o);u.set(h,d),r.attributes.position.values=u;let p=t.northCap,g=t.southCap,f=4;p&&(f-=1),g&&(f-=1);let y=(u.length/3+f)*2,x=Ne.createTypedArray(u.length/3,y);d=u.length/6;let S=0;for(let V=0;V<d-1;V++)x[S++]=V,x[S++]=V+1,x[S++]=V+d,x[S++]=V+d+1;x[S++]=d-1,x[S++]=0,x[S++]=d+d-1,x[S++]=d,x[S++]=0,x[S++]=d;let C;if(p)C=s-1;else{let V=a-1;x[S++]=V,x[S++]=V+d,C=a+s-2}if(x[S++]=C,x[S++]=C+d,!g){let V=a+C-1;x[S++]=V,x[S]=V+d}return r.indices=x,r}function qC(e){e=e??Y.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??X.RADIANS_PER_DEGREE,i=e.ellipsoid??ne.default,o=e.rotation??0,r=e.height??0,s=e.extrudedHeight??r;this._rectangle=le.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}qC.packedLength=le.packedLength+ne.packedLength+5;qC.pack=function(e,t,n){return n=n??0,le.pack(e._rectangle,t,n),n+=le.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var aae=new le,cae=ne.clone(ne.UNIT_SPHERE),jC={rectangle:aae,ellipsoid:cae,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};qC.unpack=function(e,t,n){t=t??0;let i=le.unpack(e,t,aae);t+=le.packedLength;let o=ne.unpack(e,t,cae);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t];return l(n)?(n._rectangle=le.clone(i,n._rectangle),n._ellipsoid=ne.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=d===-1?void 0:d,n):(jC.granularity=r,jC.height=s,jC.rotation=a,jC.extrudedHeight=c,jC.offsetAttribute=d===-1?void 0:d,new qC(jC))};var C9e=new he;qC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ws.computeOptions(t,e._granularity,e._rotation,0,T9e,C9e),o,r;if(X.equalsEpsilon(t.north,t.south,X.EPSILON10)||X.equalsEpsilon(t.east,t.west,X.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!X.equalsEpsilon(s,a,0,X.EPSILON2),d;if(c){if(o=S9e(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===ln.TOP?g=g.fill(1,0,p/2):(d=e._offsetAttribute===ln.NONE?0:1,g=g.fill(d)),o.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let u=de.fromRectangle3D(t,n,s,x9e),h=de.fromRectangle3D(t,n,a,y9e);r=de.union(u,h)}else{if(o=sae(e,i),o.attributes.position.values=ri.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let u=o.attributes.position.values.length;d=e._offsetAttribute===ln.NONE?0:1;let h=new Uint8Array(u/3).fill(d);o.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=de.fromRectangle3D(t,n,s)}return new ht({attributes:o.attributes,indices:o.indices,primitiveType:Ae.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var s_=qC;var $cn=_(T(),1),V9e={FIXED:0,INERTIAL:1},Di=Object.freeze(V9e);var nln=_(T(),1);function L9e(e){let t=document.createElement("canvas");return t.width=X.nextPowerOfTwo(e.width),t.height=X.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var gg=L9e;var lln=_(T(),1);var a_=30,R9e=1<<a_,Z9e=1<<a_+1>>>0,YH=2*a_+1,yg=4,uae=[],mae=[],G9e=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],xg=1,$C=2,uk=[xg,0,0,xg|$C];function ns(e){if(!Ht.supportsBigInt())throw new ce("S2 required BigInt support");this._cellId=e,this._level=ns.getLevel(e)}ns.fromToken=function(e){return new ns(ns.getIdFromToken(e))};ns.isValidId=function(e){return!(e<=0||e>>BigInt(YH)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ns.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?ns.isValidId(ns.getIdFromToken(e)):!1};ns.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};ns.getTokenFromId=function(e){let t=Math.floor(M9e(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ns.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return a_-(t>>1)};ns.prototype.getChild=function(e){let t=pae(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ns(n)};ns.prototype.getParent=function(){let e=pae(this._cellId)<<BigInt(2);return new ns(this._cellId&~e+BigInt(1)|e)};ns.prototype.getParentAtLevel=function(e){let t=F9e(e);return new ns(this._cellId&-t|t)};ns.prototype.getCenter=function(e){e=e??ne.WGS84;let t=E9e(this._cellId,this._level);t=m.normalize(t,t);let n=new he.fromCartesian(t,ne.UNIT_SPHERE);return he.toCartesian(n,e,new m)};ns.prototype.getVertex=function(e,t){t=t??ne.WGS84;let n=I9e(this._cellId,this._level,e);n=m.normalize(n,n);let i=new he.fromCartesian(n,ne.UNIT_SPHERE);return he.toCartesian(i,t,new m)};ns.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(YH-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new ns(a)};function E9e(e,t){let n=X9e(e,t);return W9e(n[0],n[1],n[2])}function I9e(e,t,n){let i=hae(e,t),o=P9e([i[1],i[2]],t),r=n>>1&1;return fae(i[0],o[0][r^n&1],o[1][r])}function X9e(e,t){let n=hae(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,d=(o<<1)+c,u=(r<<1)+c;return[i,d,u]}function hae(e){uae.length===0&&w9e();let t=Number(e>>BigInt(YH)),n=t&xg,i=(1<<yg)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?a_-7*yg:yg))-1;n+=Number(e>>BigInt(s*2*yg+1)&BigInt(c))<<2,n=mae[n];let d=s*yg;o+=n>>yg+2<<d,r+=(n>>2&i)<<d,n&=xg|$C}return[t,o,r]}function W9e(e,t,n){let i=lae(t),o=lae(n),r=mk(i),s=mk(o);return fae(e,r,s)}function fae(e,t,n){switch(e){case 0:return new m(1,t,n);case 1:return new m(-t,1,n);case 2:return new m(-t,-n,1);case 3:return new m(-1,-n,-t);case 4:return new m(n,-1,-t);default:return new m(n,t,-1)}}function mk(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function lae(e){return 1/Z9e*e}function P9e(e,t){let n=[[],[]],i=v9e(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=mk(dae(r)),n[o][1]=mk(dae(s))}return n}function v9e(e){return 1<<a_-e>>>0}function dae(e){return 1/R9e*e}function _g(e,t,n,i,o,r){if(e===yg){let s=(t<<yg)+n;uae[(s<<2)+i]=(o<<2)+r,mae[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=G9e[r];_g(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^uk[0]),_g(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^uk[1]),_g(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^uk[2]),_g(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^uk[3])}}function w9e(){_g(0,0,0,0,0,0),_g(0,0,0,xg,0,xg),_g(0,0,0,$C,0,$C),_g(0,0,0,xg|$C,0,xg|$C)}function pae(e){return e&~e+BigInt(1)}function F9e(e){return BigInt(1)<<BigInt(2*(a_-e))}var A9e=[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 M9e(e){return A9e[(-e&e)%BigInt(67)]}var $p=ns;var mln=_(T(),1);async function N9e(e,t,n,i){return l(i)||(i=!1),D9e(e,t,n,i)}function k9e(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(gae(i)):r=o.then(gae(i)).catch(O9e(i)),e.shift(),t.push(r),!0}function U9e(e){return new Promise(function(t){setTimeout(t,e)})}function zH(e,t,n){return e.length?k9e(e,t,n)?zH(e,t,n):U9e(100).then(()=>zH(e,t,n)):Promise.resolve()}function D9e(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let d=o.positionToTileXY(n[r],t);if(!l(d))continue;let u=d.toString();if(!a.hasOwnProperty(u)){let h={x:d.x,y:d.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=h,s.push(h)}a[u].positions.push(n[r])}let c=[];return zH(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function bae(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function gae(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!bae(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];bae(s,i,n)}}):Promise.resolve()}}function O9e(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var EI=N9e;var gln=_(T(),1);var HH=new U;async function yae(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let d=t[c],u=r.computeMaximumLevelAtPosition(d);if(o[c]=u,u===0){e.tilingScheme.positionToTileXY(d,1,HH);let p=e.loadTileDataAvailability(HH.x,HH.y,1);l(p)&&s.push(p)}let h=i[u];l(h)||(i[u]=h=[]),h.push(d)}await Promise.all(s),await Promise.all(i.map(function(c,d){if(l(c))return EI(e,d,c,n)}));let a=[];for(let c=0;c<t.length;++c){let d=t[c];r.computeMaximumLevelAtPosition(d)!==o[c]&&a.push(d)}return a.length>0&&await yae(e,a,n),t}var c_=yae;var Eln=_(T(),1);var xln=_(T(),1),B9e={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},Tn=Object.freeze(B9e);function Tg(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 $H(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function l_(e){if(e.shiftKey)return Js.SHIFT;if(e.ctrlKey)return Js.CTRL;if(e.altKey)return Js.ALT}var Ps={LEFT:0,MIDDLE:1,RIGHT:2};function _d(e,t,n,i){function o(r){i(e,r)}Ht.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Y9e(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Ht.supportsPointerEvents()?(_d(e,"pointerdown",t,j9e),_d(e,"pointerup",t,Gae),_d(e,"pointermove",t,q9e),_d(e,"pointercancel",t,Gae)):(_d(e,"mousedown",t,Eae),_d(e,"mouseup",n,Iae),_d(e,"mousemove",n,Xae),_d(e,"touchstart",t,J9e),_d(e,"touchend",n,Cae),_d(e,"touchmove",n,Q9e),_d(e,"touchcancel",n,Cae)),_d(e,"dblclick",t,H9e);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",_d(e,i,t,K9e)}function z9e(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var xae={position:new U};function eK(e){e._lastSeenTouchEvent=xi()}function tK(e){return xi()-e._lastSeenTouchEvent>Bm.mouseEmulationIgnoreMilliseconds}function qH(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function Eae(e,t){if(!tK(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Ps.LEFT)i=Tn.LEFT_DOWN;else if(n===Ps.MIDDLE)i=Tn.MIDDLE_DOWN;else if(n===Ps.RIGHT)i=Tn.RIGHT_DOWN;else return;let o=Tg(e,t,e._primaryPosition);U.clone(o,e._primaryStartPosition),U.clone(o,e._primaryPreviousPosition);let r=l_(t),s=e.getInputAction(i,r);l(s)&&(U.clone(o,xae.position),s(xae),t.preventDefault())}var _ae={position:new U},Tae={position:new U};function KH(e,t,n,i){let o=l_(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=Tg(e,i,e._primaryPosition);if(l(r)&&(U.clone(a,_ae.position),r(_ae)),l(s)){let c=e._primaryStartPosition;qH(c,a,e._clickPixelTolerance)&&(U.clone(a,Tae.position),s(Tae))}}}function Iae(e,t){if(!tK(e))return;let n=t.button;n!==Ps.LEFT&&n!==Ps.MIDDLE&&n!==Ps.RIGHT||(e._buttonDown[Ps.LEFT]&&(KH(e,Tn.LEFT_UP,Tn.LEFT_CLICK,t),e._buttonDown[Ps.LEFT]=!1),e._buttonDown[Ps.MIDDLE]&&(KH(e,Tn.MIDDLE_UP,Tn.MIDDLE_CLICK,t),e._buttonDown[Ps.MIDDLE]=!1),e._buttonDown[Ps.RIGHT]&&(KH(e,Tn.RIGHT_UP,Tn.RIGHT_CLICK,t),e._buttonDown[Ps.RIGHT]=!1))}var JH={startPosition:new U,endPosition:new U};function Xae(e,t){if(!tK(e))return;let n=l_(t),i=Tg(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Tn.MOUSE_MOVE,n);l(r)&&(U.clone(o,JH.startPosition),U.clone(i,JH.endPosition),r(JH)),U.clone(i,o),(e._buttonDown[Ps.LEFT]||e._buttonDown[Ps.MIDDLE]||e._buttonDown[Ps.RIGHT])&&t.preventDefault()}var Sae={position:new U};function H9e(e,t){let n=t.button,i;if(n===Ps.LEFT)i=Tn.LEFT_DOUBLE_CLICK;else return;let o=l_(t),r=e.getInputAction(i,o);l(r)&&(Tg(e,t,Sae.position),r(Sae))}function K9e(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=l_(t),o=e.getInputAction(Tn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function J9e(e,t){eK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,Tg(e,r,new U));hk(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,U.clone(a.get(s)))}function Cae(e,t){eK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);hk(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var Vae={position:new U},QH={position1:new U,position2:new U},Lae={position:new U},Rae={position:new U},Zae={position:new U};function hk(e,t){let n=l_(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Ps.LEFT]){if(e._buttonDown[Ps.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Tn.LEFT_UP,n),l(r)&&(U.clone(e._primaryPosition,Lae.position),r(Lae)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Tn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];qH(c,d,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,Rae.position),s(Rae))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Tn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];U.clone(c,e._primaryPosition),U.clone(c,e._primaryStartPosition),U.clone(c,e._primaryPreviousPosition),e._buttonDown[Ps.LEFT]=!0,r=e.getInputAction(Tn.LEFT_DOWN,n),l(r)&&(U.clone(c,Vae.position),r(Vae)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Tn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];qH(d,u,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,Zae.position),s(Zae))}},Bm.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Tn.PINCH_START,n),l(r)&&(U.clone(i.values[0],QH.position1),U.clone(i.values[1],QH.position2),r(QH),t.preventDefault()))}function Q9e(e,t){eK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let d=a.get(s);l(d)&&Tg(e,r,d)}Wae(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,U.clone(a.get(s),c.get(s))}var jH={startPosition:new U,endPosition:new U},II={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function Wae(e,t){let n=l_(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Ps.LEFT]){let a=i.values[0];U.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Tn.MOUSE_MOVE,n),l(s)&&(U.clone(c,jH.startPosition),U.clone(a,jH.endPosition),s(jH)),U.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Tn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],d=o.values[0],u=o.values[1],h=c.x-a.x,p=c.y-a.y,g=Math.sqrt(h*h+p*p)*.25,f=u.x-d.x,y=u.y-d.y,x=Math.sqrt(f*f+y*y)*.25,S=(c.y+a.y)*.125,C=(u.y+d.y)*.125,V=Math.atan2(p,h),L=Math.atan2(y,f);U.fromElements(0,x,II.distance.startPosition),U.fromElements(0,g,II.distance.endPosition),U.fromElements(L,C,II.angleAndHeight.startPosition),U.fromElements(V,S,II.angleAndHeight.endPosition),s(II)}}function j9e(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Tg(e,t,new U)),hk(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else Eae(e,t)}function Gae(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),hk(e,t),e._previousPositions.remove(i)}else Iae(e,t)}function q9e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;Tg(e,t,o),Wae(e,t);let r=e._previousPositions;U.clone(n.get(i),r.get(i))}else Xae(e,t)}function Bm(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Bm.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new It,this._previousPositions=new It,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,Y9e(this)}Bm.prototype.setInputAction=function(e,t,n){let i=$H(t,n);this._inputEvents[i]=e};Bm.prototype.getInputAction=function(e,t){let n=$H(e,t);return this._inputEvents[n]};Bm.prototype.removeInputAction=function(e,t){let n=$H(e,t);delete this._inputEvents[n]};Bm.prototype.isDestroyed=function(){return!1};Bm.prototype.destroy=function(){return z9e(this),me(this)};Bm.mouseEmulationIgnoreMilliseconds=800;Bm.touchHoldDelayMilliseconds=1500;var Td=Bm;var Pln=_(T(),1);function fk(e){e=e??!0,this.value=fk.toValue(e)}Object.defineProperties(fk.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});fk.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Sn=fk;var Qln=_(T(),1);function $9e(e,t,n,i,o,r,s){let a=wi.numberOfPoints(e,t,o),c,d=n.red,u=n.green,h=n.blue,p=n.alpha,g=i.red,f=i.green,y=i.blue,x=i.alpha;if(D.equals(n,i)){for(c=0;c<a;c++)r[s++]=D.floatToByte(d),r[s++]=D.floatToByte(u),r[s++]=D.floatToByte(h),r[s++]=D.floatToByte(p);return s}let S=(g-d)/a,C=(f-u)/a,V=(y-h)/a,L=(x-p)/a,Z=s;for(c=0;c<a;c++)r[Z++]=D.floatToByte(d+c*S),r[Z++]=D.floatToByte(u+c*C),r[Z++]=D.floatToByte(h+c*V),r[Z++]=D.floatToByte(p+c*L);return Z}function XI(e){e=e??Y.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??on.GEODESIC,this._granularity=e.granularity??X.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ne.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*m.packedLength;o+=l(n)?1+n.length*D.packedLength:1,this.packedLength=o+ne.packedLength+3}XI.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};XI.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=ne.unpack(e,t);t+=ne.packedLength;let c=e[t++]===1,d=e[t++],u=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=d,n._granularity=u,n):new XI({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var pk=new Array(2),bk=new Array(2),eMe={positions:pk,height:bk,ellipsoid:void 0,minDistance:void 0,granularity:void 0};XI.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=X.chordLength(r,s.maximumRadius),c=l(n)&&!i,d,u=t.length,h,p,g,f,y=0;if(o===on.GEODESIC||o===on.RHUMB){let L,Z,E;o===on.GEODESIC?(L=X.chordLength(r,s.maximumRadius),Z=wi.numberOfPoints,E=wi.generateArc):(L=r,Z=wi.numberOfPointsRhumbLine,E=wi.generateRhumbArc);let P=wi.extractHeights(t,s),W=eMe;if(o===on.GEODESIC?W.minDistance=a:W.granularity=r,W.ellipsoid=s,c){let v=0;for(d=0;d<u-1;d++)v+=Z(t[d],t[d+1],L)+1;h=new Float64Array(v*3),g=new Uint8Array(v*4),W.positions=pk,W.height=bk;let A=0;for(d=0;d<u-1;++d){pk[0]=t[d],pk[1]=t[d+1],bk[0]=P[d],bk[1]=P[d+1];let b=E(W);if(l(n)){let R=b.length/3;f=n[d];for(let G=0;G<R;++G)g[A++]=D.floatToByte(f.red),g[A++]=D.floatToByte(f.green),g[A++]=D.floatToByte(f.blue),g[A++]=D.floatToByte(f.alpha)}h.set(b,y),y+=b.length}}else if(W.positions=t,W.height=P,h=new Float64Array(E(W)),l(n)){for(g=new Uint8Array(h.length/3*4),d=0;d<u-1;++d){let A=t[d],b=t[d+1],R=n[d],G=n[d+1];y=$9e(A,b,R,G,a,g,y)}let v=n[u-1];g[y++]=D.floatToByte(v.red),g[y++]=D.floatToByte(v.green),g[y++]=D.floatToByte(v.blue),g[y++]=D.floatToByte(v.alpha)}}else{p=c?u*2-2:u,h=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let L=0,Z=0;for(d=0;d<u;++d){let E=t[d];if(c&&d>0&&(m.pack(E,h,L),L+=3,f=n[d-1],g[Z++]=D.floatToByte(f.red),g[Z++]=D.floatToByte(f.green),g[Z++]=D.floatToByte(f.blue),g[Z++]=D.floatToByte(f.alpha)),c&&d===u-1)break;m.pack(E,h,L),L+=3,l(n)&&(f=n[d],g[Z++]=D.floatToByte(f.red),g[Z++]=D.floatToByte(f.green),g[Z++]=D.floatToByte(f.blue),g[Z++]=D.floatToByte(f.alpha))}}let x=new pn;x.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:h}),l(n)&&(x.color=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=h.length/3;let S=(p-1)*2,C=Ne.createTypedArray(p,S),V=0;for(d=0;d<p-1;++d)C[V++]=d,C[V++]=d+1;return new ht({attributes:x,indices:C,primitiveType:Ae.LINES,boundingSphere:de.fromPoints(t)})};var nK=XI;var ndn=_(T(),1);function e1(e){let t=e.radius??1,i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Ks(i),this._workerName="createSphereGeometry"}e1.packedLength=Ks.packedLength;e1.pack=function(e,t,n){return Ks.pack(e._ellipsoidGeometry,t,n)};var tMe=new Ks,Sg={radius:void 0,radii:new m,vertexFormat:new Xe,stackPartitions:void 0,slicePartitions:void 0};e1.unpack=function(e,t,n){let i=Ks.unpack(e,t,tMe);return Sg.vertexFormat=Xe.clone(i._vertexFormat,Sg.vertexFormat),Sg.stackPartitions=i._stackPartitions,Sg.slicePartitions=i._slicePartitions,l(n)?(m.clone(i._radii,Sg.radii),n._ellipsoidGeometry=new Ks(Sg),n):(Sg.radius=i._radii.x,new e1(Sg))};e1.createGeometry=function(e){return Ks.createGeometry(e._ellipsoidGeometry)};var iK=e1;var adn=_(T(),1);function t1(e){let t=e.radius??1,i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new gd(i),this._workerName="createSphereOutlineGeometry"}t1.packedLength=gd.packedLength;t1.pack=function(e,t,n){return gd.pack(e._ellipsoidGeometry,t,n)};var nMe=new gd,d_={radius:void 0,radii:new m,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};t1.unpack=function(e,t,n){let i=gd.unpack(e,t,nMe);return d_.stackPartitions=i._stackPartitions,d_.slicePartitions=i._slicePartitions,d_.subdivisions=i._subdivisions,l(n)?(m.clone(i._radii,d_.radii),n._ellipsoidGeometry=new gd(d_),n):(d_.radius=i._radii.x,new t1(d_))};t1.createGeometry=function(e){return gd.createGeometry(e._ellipsoidGeometry)};var eb=t1;var ddn=_(T(),1);function pc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}pc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new pc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};pc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new pc(e.clock,e.cone,e.magnitude)};pc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new pc(e.clock,e.cone,1)};pc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};pc.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};pc.prototype.equals=function(e){return pc.equals(this,e)};pc.prototype.clone=function(e){return pc.clone(this,e)};pc.prototype.equalsEpsilon=function(e,t){return pc.equalsEpsilon(this,e,t)};pc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var WI=pc;var mdn=_(T(),1);function iMe(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var u_=iMe;var gdn=_(T(),1);function n1(e){e=e??Y.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(n1.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});n1.prototype.findTimeInterval=so.prototype.findTimeInterval;n1.prototype.wrapTime=so.prototype.wrapTime;n1.prototype.clampTime=so.prototype.clampTime;n1.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 PI=n1;var xdn=_(T(),1);function oMe(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 vI=oMe;var Tdn=_(T(),1),rMe={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},_n=rMe;var Vdn=_(T(),1);function Cg(e){}Object.defineProperties(Cg.prototype,{ellipsoid:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},projection:{get:fe.throwInstantiationError}});Cg.prototype.getNumberOfXTilesAtLevel=fe.throwInstantiationError;Cg.prototype.getNumberOfYTilesAtLevel=fe.throwInstantiationError;Cg.prototype.rectangleToNativeRectangle=fe.throwInstantiationError;Cg.prototype.tileXYToNativeRectangle=fe.throwInstantiationError;Cg.prototype.tileXYToRectangle=fe.throwInstantiationError;Cg.prototype.positionToTileXY=fe.throwInstantiationError;var oK=Cg;var wdn=_(T(),1);function aK(e,t){return q.compare(e.start,t.start)}function Dr(e){if(this._intervals=[],this._changedEvent=new be,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Dr.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}}});Dr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Dr))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};Dr.prototype.get=function(e){return this._intervals[e]};Dr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Dr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Dr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Dr.prototype.contains=function(e){return this.indexOf(e)>=0};var rK=new Rn;Dr.prototype.indexOf=function(e){let t=this._intervals;rK.start=e,rK.stop=e;let n=Wo(t,rK,aK);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Rn.contains(t[n-1],e)?n-1:~n)};Dr.prototype.findInterval=function(e){e=e??Y.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};Dr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||q.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Wo(n,e,aK);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=q.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)?(q.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=q.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=q.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:q.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:q.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)};Dr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Wo(t,e,aK);n<0&&(n=~n);let i=!1;for(n>0&&(q.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(q.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&&q.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&&(q.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};Dr.prototype.intersect=function(e,t,n){let i=new Dr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],d=a[r];if(q.lessThan(c.stop,d.start))++o;else if(q.lessThan(d.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,d.data)||!l(t)&&d.data===c.data){let u=Rn.intersect(c,d,new Rn,n);u.isEmpty||i.addInterval(u,t)}q.lessThan(c.stop,d.stop)||c.stop.equals(d.stop)&&!c.isStopIncluded&&d.isStopIncluded?++o:++r}}return i};Dr.fromJulianDateArray=function(e,t){l(t)||(t=new Dr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,d,u=0;a&&(++u,d=new Rn({start:Oe.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d));for(let h=0;h<i-1;++h){let p=n[h],g=n[h+1];d=new Rn({start:p,stop:g,isStartIncluded:t.length===u?r:!0,isStopIncluded:h===i-2?s:!1}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d),p=g}return c&&(d=new Rn({start:n[i-1],stop:Oe.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)),t};var bc=new yp,wI=[0,31,28,31,30,31,30,31,31,30,31,30,31];function sK(e,t,n){l(n)||(n=new q),q.toGregorianDate(e,bc);let i=bc.millisecond+t.millisecond,o=bc.second+t.second,r=bc.minute+t.minute,s=bc.hour+t.hour,a=bc.day+t.day,c=bc.month+t.month,d=bc.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),wI[2]=Sm(d)?29:28;a>wI[c]||c>=13;)a>wI[c]&&(a-=wI[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),wI[2]=Sm(d)?29:28;return bc.millisecond=i,bc.second=o,bc.minute=r,bc.hour=s,bc.day=a,bc.month=c,bc.year=d,q.fromGregorianDate(bc,n)}var sMe=new q,aMe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Pae(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(aMe);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"),q.toGregorianDate(q.fromIso8601(e,sMe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var FI=new yp;Dr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=q.fromIso8601(n[0]),o=q.fromIso8601(n[1]),r=[];if(!Pae(n[2],FI))r.push(i,o);else{let s=q.clone(i);for(r.push(s);q.compare(s,o)<0;)s=sK(s,FI),q.compare(o,s)<=0&&q.clone(o,s),r.push(s)}return Dr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Dr.fromIso8601DateArray=function(e,t){return Dr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return q.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Dr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,c=i.length;for(let d=0;d<c;++d)(Pae(i[d],FI)||d===0)&&(o&&l(a)?s=sK(a,FI):s=sK(n,FI),r.push(s),a=s);return Dr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Or=Dr;var Adn=_(T(),1),cMe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},tb=Object.freeze(cMe);var Ddn=_(T(),1);var lMe=new m(1,1,1),dMe=m.ZERO,uMe=we.IDENTITY;function vae(e,t,n){this.translation=m.clone(e??dMe),this.rotation=we.clone(t??uMe),this.scale=m.clone(n??lMe)}vae.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&we.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var Vg=vae;var Jdn=_(T(),1);function m_(e){e=e??Y.EMPTY_OBJECT,this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=e.epoch??Oe.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(m_.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(m_.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=mMe(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});m_.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,me(this)};m_.prototype.isDestroyed=function(){return!1};m_.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};m_.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??Oe.MINIMUM_VALUE,s=q.secondsDifference(o,r),a=t.duration,c,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let u=i?this.tolerance??1:.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function mMe(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var cK=m_;var uun=_(T(),1);function hMe(e,t){this.rectangle=e,this.maxLevel=t}function wae(e){this.ellipsoid=e.ellipsoid??ne.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}wae.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 fMe(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Ki({ellipsoid:e.ellipsoid});else throw new ce(`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=es.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=X.toRadians(parseFloat(s.getAttribute("minx"))),c=X.toRadians(parseFloat(s.getAttribute("miny"))),d=X.toRadians(parseFloat(s.getAttribute("maxx"))),u=X.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new hMe(new le(a,c,d,u),h))}}function pMe(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Lo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ce(i)}async function bMe(e,t,n){try{let i=await t.fetchXML();fMe(e,i)}catch(i){pMe(t,i,n)}}function Lg(e){e=e??Y.EMPTY_OBJECT,this._errorEvent=new be,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 Gt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Lg.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(){}}});Lg.fromUrl=async function(e,t){t=t??Y.EMPTY_OBJECT;let n=new wae(t),i=Re.createIfNeeded(e);await bMe(n,i);let o=new Lg(t);return n.build(o),o._resource=i,o};Lg.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Fa({buffer:Cm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:gMe(a,e,t,n),structure:a._terrainDataStructure})})};Lg.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var Fae=new le;function gMe(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let d=r[c];if(d.maxLevel<=i)continue;let u=d.rectangle,h=le.intersection(u,s,Fae);l(h)&&(gk(o,u,t*2,n*2,i+1)&&(a|=4),gk(o,u,t*2+1,n*2,i+1)&&(a|=8),gk(o,u,t*2,n*2+1,i+1)&&(a|=1),gk(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function gk(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(le.intersection(r,t,Fae))}Lg.prototype.getTileDataAvailable=function(e,t,n){};Lg.prototype.loadTileDataAvailability=function(e,t,n){};var lK=Lg;var hun=_(T(),1),yMe={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},dK=Object.freeze(yMe);var Aun=_(T(),1);var Tun=_(T(),1);var Aae={};function xMe(e,t){return X.equalsEpsilon(e.latitude,t.latitude,X.EPSILON10)&&X.equalsEpsilon(e.longitude,t.longitude,X.EPSILON10)}var _Me=new he,TMe=new he;function SMe(e,t,n,i){t=Co(t,m.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),d=new Array(o),u=t[0];a[0]=u;let h=e.cartesianToCartographic(u,_Me);s&&(h.height=n[0]),c[0]=h.height,r?d[0]=i[0]:d[0]=0;let p=c[0],g=d[0],f=p===g,y=1;for(let x=1;x<o;++x){let S=t[x],C=e.cartesianToCartographic(S,TMe);s&&(C.height=n[x]),f=f&&C.height===0,xMe(h,C)?h.height<C.height&&(c[y-1]=C.height):(a[y]=S,c[y]=C.height,r?d[y]=i[x]:d[y]=0,f=f&&c[y]===d[y],he.clone(C,h),++y)}if(!(f||y<2))return a.length=y,c.length=y,d.length=y,{positions:a,topHeights:c,bottomHeights:d}}var CMe=new Array(2),VMe=new Array(2),LMe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Aae.computePositions=function(e,t,n,i,o,r){let s=SMe(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,d,u,h=X.chordLength(o,e.maximumRadius),p=LMe;if(p.minDistance=h,p.ellipsoid=e,r){let g=0,f;for(f=0;f<a-1;f++)g+=wi.numberOfPoints(t[f],t[f+1],h)+1;d=new Float64Array(g*3),u=new Float64Array(g*3);let y=CMe,x=VMe;p.positions=y,p.height=x;let S=0;for(f=0;f<a-1;f++){y[0]=t[f],y[1]=t[f+1],x[0]=n[f],x[1]=n[f+1];let C=wi.generateArc(p);d.set(C,S),x[0]=i[f],x[1]=i[f+1],u.set(wi.generateArc(p),S),S+=C.length}}else p.positions=t,p.height=n,d=new Float64Array(wi.generateArc(p)),p.height=i,u=new Float64Array(wi.generateArc(p));return{bottomPositions:u,topPositions:d,numCorners:c}};var h_=Aae;var uK=new m,yk=new m,RMe=new m,Mae=new m,ZMe=new m,GMe=new m,EMe=new m;function f_(e){e=e??Y.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??Xe.DEFAULT,r=e.granularity??X.RADIANS_PER_DEGREE,s=e.ellipsoid??ne.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Xe.clone(o),this._granularity=r,this._ellipsoid=ne.clone(s),this._workerName="createWallGeometry";let a=1+t.length*m.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ne.packedLength+Xe.packedLength+1}f_.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n]=e._granularity,t};var Nae=ne.clone(ne.UNIT_SPHERE),kae=new Xe,AI={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Nae,vertexFormat:kae,granularity:void 0};f_.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ne.unpack(e,t,Nae);t+=ne.packedLength;let d=Xe.unpack(e,t,kae);t+=Xe.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ne.clone(c,n._ellipsoid),n._vertexFormat=Xe.clone(d,n._vertexFormat),n._granularity=u,n):(AI.positions=r,AI.minimumHeights=s,AI.maximumHeights=a,AI.granularity=u,new f_(AI))};f_.fromConstantHeights=function(e){e=e??Y.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new f_(c)};f_.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=h_.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,d=a.topPositions,u=a.numCorners,h=d.length,p=h*2,g=o.position?new Float64Array(p):void 0,f=o.normal?new Float32Array(p):void 0,y=o.tangent?new Float32Array(p):void 0,x=o.bitangent?new Float32Array(p):void 0,S=o.st?new Float32Array(p/3*2):void 0,C=0,V=0,L=0,Z=0,E=0,P=EMe,W=GMe,v=ZMe,A=!0;h/=3;let b,R=0,G=1/(h-u-1);for(b=0;b<h;++b){let k=b*3,B=m.fromArray(d,k,uK),N=m.fromArray(c,k,yk);if(o.position&&(g[C++]=N.x,g[C++]=N.y,g[C++]=N.z,g[C++]=B.x,g[C++]=B.y,g[C++]=B.z),o.st&&(S[E++]=R,S[E++]=0,S[E++]=R,S[E++]=1),o.normal||o.tangent||o.bitangent){let z=m.clone(m.ZERO,Mae),K=m.subtract(B,s.geodeticSurfaceNormal(B,yk),yk);if(b+1<h&&(z=m.fromArray(d,k+3,Mae)),A){let te=m.subtract(z,B,RMe),H=m.subtract(K,B,uK);P=m.normalize(m.cross(H,te,P),P),A=!1}m.equalsEpsilon(B,z,X.EPSILON10)?A=!0:(R+=G,o.tangent&&(W=m.normalize(m.subtract(z,B,W),W)),o.bitangent&&(v=m.normalize(m.cross(P,W,v),v))),o.normal&&(f[V++]=P.x,f[V++]=P.y,f[V++]=P.z,f[V++]=P.x,f[V++]=P.y,f[V++]=P.z),o.tangent&&(y[Z++]=W.x,y[Z++]=W.y,y[Z++]=W.z,y[Z++]=W.x,y[Z++]=W.y,y[Z++]=W.z),o.bitangent&&(x[L++]=v.x,x[L++]=v.y,x[L++]=v.z,x[L++]=v.x,x[L++]=v.y,x[L++]=v.z)}}let I=new pn;o.position&&(I.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(I.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(I.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),o.bitangent&&(I.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),o.st&&(I.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:S}));let w=p/3;p-=6*(u+1);let M=Ne.createTypedArray(w,p),O=0;for(b=0;b<w-2;b+=2){let k=b,B=b+2,N=m.fromArray(g,k*3,uK),z=m.fromArray(g,B*3,yk);if(m.equalsEpsilon(N,z,X.EPSILON10))continue;let K=b+1,te=b+3;M[O++]=K,M[O++]=k,M[O++]=te,M[O++]=te,M[O++]=k,M[O++]=B}return new ht({attributes:I,indices:M,primitiveType:Ae.TRIANGLES,boundingSphere:new de.fromVertices(g)})};var MI=f_;var qun=_(T(),1);var Uae=new m,Dae=new m;function p_(e){e=e??Y.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.granularity??X.RADIANS_PER_DEGREE,r=e.ellipsoid??ne.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ne.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*m.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ne.packedLength+1}p_.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n]=e._granularity,t};var Oae=ne.clone(ne.UNIT_SPHERE),NI={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Oae,granularity:void 0};p_.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ne.unpack(e,t,Oae);t+=ne.packedLength;let d=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ne.clone(c,n._ellipsoid),n._granularity=d,n):(NI.positions=r,NI.minimumHeights=s,NI.maximumHeights=a,NI.granularity=d,new p_(NI))};p_.fromConstantHeights=function(e){e=e??Y.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new p_(c)};p_.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=h_.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,d=c.length,u=d*2,h=new Float64Array(u),p=0;d/=3;let g;for(g=0;g<d;++g){let C=g*3,V=m.fromArray(c,C,Uae),L=m.fromArray(a,C,Dae);h[p++]=L.x,h[p++]=L.y,h[p++]=L.z,h[p++]=V.x,h[p++]=V.y,h[p++]=V.z}let f=new pn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:h})}),y=u/3;u=2*y-4+y;let x=Ne.createTypedArray(y,u),S=0;for(g=0;g<y-2;g+=2){let C=g,V=g+2,L=m.fromArray(h,C*3,Uae),Z=m.fromArray(h,V*3,Dae);if(m.equalsEpsilon(L,Z,X.EPSILON10))continue;let E=g+1,P=g+3;x[S++]=E,x[S++]=C,x[S++]=E,x[S++]=P,x[S++]=C,x[S++]=V}return x[S++]=y-2,x[S++]=y-1,new ht({attributes:f,indices:x,primitiveType:Ae.LINES,boundingSphere:new de.fromVertices(h)})};var kI=p_;var tmn=_(T(),1);function IMe(e){switch(e){case ie.FLOAT:return"float";case ie.FLOAT_VEC2:return"vec2";case ie.FLOAT_VEC3:return"vec3";case ie.FLOAT_VEC4:return"vec4";case ie.FLOAT_MAT2:return"mat2";case ie.FLOAT_MAT3:return"mat3";case ie.FLOAT_MAT4:return"mat4";case ie.SAMPLER_2D:return"sampler2D";case ie.BOOL:return"bool"}}var mK=IMe;var smn=_(T(),1);var hK={};function XMe(e){let t=Ne.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 WMe(e,t){let n=t.length,i=Ne.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function PMe(e){let t=e-2,n=2+t*4,i=Ne.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 vMe(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],d=t[a+1],u=t[a+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=c}return r}function wMe(e){let t=e-2,n=2+t*4,i=Ne.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 FMe(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let d=t[c+1],u=t[c+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=a}return r}hK.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Ae.TRIANGLES)return i?WMe(t,n):XMe(t);if(e===Ae.TRIANGLE_STRIP)return i?vMe(t,n):PMe(t);if(e===Ae.TRIANGLE_FAN)return i?FMe(t,n):wMe(t)};hK.getWireframeIndicesCount=function(e,t){return e===Ae.TRIANGLES?t*2:e===Ae.TRIANGLE_STRIP||e===Ae.TRIANGLE_FAN?2+(t-2)*4:t};var i1=hK;var cmn=_(T(),1);function AMe(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var UI=AMe;var Smn=_(T(),1);var bmn=_(T(),1);var mmn=_(T(),1);function Rg(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(Rg.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Rg.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Rg.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))}};Rg.prototype.equals=function(e){return this===e||e instanceof Rg&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Rg.prototype.valueOf=function(){return this._value};Rg.prototype.toString=function(){return String(this._value)};var jn=Rg;function MMe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function NMe(e){return new jn(e)}function kMe(e,t,n){return MMe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??NMe)}var ue=kMe;function DI(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(DI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),image:ue("image"),scale:ue("scale"),pixelOffset:ue("pixelOffset"),eyeOffset:ue("eyeOffset"),horizontalOrigin:ue("horizontalOrigin"),verticalOrigin:ue("verticalOrigin"),heightReference:ue("heightReference"),color:ue("color"),rotation:ue("rotation"),alignedAxis:ue("alignedAxis"),sizeInMeters:ue("sizeInMeters"),width:ue("width"),height:ue("height"),scaleByDistance:ue("scaleByDistance"),translucencyByDistance:ue("translucencyByDistance"),pixelOffsetScaleByDistance:ue("pixelOffsetScaleByDistance"),imageSubRegion:ue("imageSubRegion"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance"),splitDirection:ue("splitDirection")});DI.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 DI(this)};DI.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 gc=DI;var $mn=_(T(),1);var Vmn=_(T(),1),b_={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},Ke=Object.freeze(b_);function Pu(e){return e===b_.CLAMP_TO_GROUND||e===b_.CLAMP_TO_3D_TILE||e===b_.CLAMP_TO_TERRAIN}function o1(e){return e===b_.RELATIVE_TO_GROUND||e===b_.RELATIVE_TO_3D_TILE||e===b_.RELATIVE_TO_TERRAIN}var Rmn=_(T(),1),UMe={CENTER:0,LEFT:1,RIGHT:-1},_i=Object.freeze(UMe);var Gmn=_(T(),1),DMe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Mn=Object.freeze(DMe);var Imn=_(T(),1),OMe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),ut=OMe;var vmn=_(T(),1);function Ym(){fe.throwInstantiationError()}Object.defineProperties(Ym.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});Ym.prototype.getValue=fe.throwInstantiationError;Ym.prototype.equals=fe.throwInstantiationError;Ym.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Ym.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(!Ym.equals(e[i],t[i]))return!1;return!0};Ym.isConstant=function(e){return!l(e)||e.isConstant};Ym.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Ym.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Ym.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var J=Ym;var Fmn=_(T(),1),BMe={LEFT:-1,NONE:0,RIGHT:1},Br=Object.freeze(BMe);var YMe=D.WHITE,zMe=m.ZERO,HMe=Ke.NONE,KMe=U.ZERO,JMe=1,QMe=0,jMe=m.ZERO,qMe=_i.CENTER,$Me=Mn.CENTER,eNe=!1,tNe=Br.NONE,nNe=new m,iNe=new D,oNe=new m,rNe=new U,sNe=new Ot,aNe=new Ot,cNe=new Ot,lNe=new ze,dNe=new At;function Bae(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function Zg(e,t){t.collectionChanged.addEventListener(Zg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new It,this._onCollectionChanged(t,t.values,[],[])}Zg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,d=r.billboard,u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),h;if(u&&(h=J.getValueOrUndefined(s._position,e,nNe),c=J.getValueOrUndefined(a._image,e),u=l(h)&&l(c)),!u){fK(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0),l(d)||(d=n.getBillboard(s),d.id=s,r.billboard=d,r.textureValue=void 0),d.show=u,r.textureValue!==c&&(d.image=c,r.textureValue=c),d.position=h,d.color=J.getValueOrDefault(a._color,e,YMe,iNe),d.eyeOffset=J.getValueOrDefault(a._eyeOffset,e,zMe,oNe),d.heightReference=J.getValueOrDefault(a._heightReference,e,HMe),d.pixelOffset=J.getValueOrDefault(a._pixelOffset,e,KMe,rNe),d.scale=J.getValueOrDefault(a._scale,e,JMe),d.rotation=J.getValueOrDefault(a._rotation,e,QMe),d.alignedAxis=J.getValueOrDefault(a._alignedAxis,e,jMe),d.horizontalOrigin=J.getValueOrDefault(a._horizontalOrigin,e,qMe),d.verticalOrigin=J.getValueOrDefault(a._verticalOrigin,e,$Me),d.width=J.getValueOrUndefined(a._width,e),d.height=J.getValueOrUndefined(a._height,e),d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,sNe),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,aNe),d.pixelOffsetScaleByDistance=J.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,cNe),d.sizeInMeters=J.getValueOrDefault(a._sizeInMeters,e,eNe),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,dNe),d.disableDepthTestDistance=J.getValueOrUndefined(a._disableDepthTestDistance,e),d.splitDirection=J.getValueOrDefault(a._splitDirection,e,tNe);let p=J.getValueOrUndefined(a._imageSubRegion,e,lNe);l(p)&&d.setImageSubRegion(d.image,p)}return!0};Zg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return ut.FAILED;let i=n.billboard;if(i.heightReference===Ke.NONE)t.center=m.clone(i.position,t.center);else{if(!l(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};Zg.prototype.isDestroyed=function(){return!1};Zg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Zg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return me(this)};Zg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new Bae(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Bae(r)):(fK(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],fK(s.get(r.id),r,a),s.remove(r.id)};function fK(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var OI=Zg;var s1n=_(T(),1);var fpn=_(T(),1);var thn=_(T(),1),BI=`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 ihn=_(T(),1),YI=`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 rhn=_(T(),1),zI=`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 ahn=_(T(),1),HI=`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 lhn=_(T(),1),KI=`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 uhn=_(T(),1),JI=`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 Whn=_(T(),1);var Thn=_(T(),1);var fhn=_(T(),1);var uNe={ADD:ie.FUNC_ADD,SUBTRACT:ie.FUNC_SUBTRACT,REVERSE_SUBTRACT:ie.FUNC_REVERSE_SUBTRACT,MIN:ie.MIN,MAX:ie.MAX},ka=Object.freeze(uNe);var ghn=_(T(),1);var mNe={ZERO:ie.ZERO,ONE:ie.ONE,SOURCE_COLOR:ie.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ie.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ie.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ie.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ie.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ie.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ie.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ie.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ie.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ie.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ie.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ie.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ie.SRC_ALPHA_SATURATE},Ro=Object.freeze(mNe);var hNe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ka.ADD,equationAlpha:ka.ADD,functionSourceRgb:Ro.SOURCE_ALPHA,functionSourceAlpha:Ro.ONE,functionDestinationRgb:Ro.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Ro.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ka.ADD,equationAlpha:ka.ADD,functionSourceRgb:Ro.ONE,functionSourceAlpha:Ro.ONE,functionDestinationRgb:Ro.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Ro.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:ka.ADD,equationAlpha:ka.ADD,functionSourceRgb:Ro.SOURCE_ALPHA,functionSourceAlpha:Ro.ONE,functionDestinationRgb:Ro.ONE,functionDestinationAlpha:Ro.ONE})},fn=Object.freeze(hNe);var Vhn=_(T(),1);var fNe={FRONT:ie.FRONT,BACK:ie.BACK,FRONT_AND_BACK:ie.FRONT_AND_BACK},Ti=Object.freeze(fNe);function r1(e){e=e??Y.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(r1.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}}});r1.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(`
|
|
|
`)};r1.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};r1.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Be(this.renderState,!1);return e?(t.depthMask=!1,t.blending=fn.ALPHA_BLEND):t.depthMask=!0,t};r1.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=fn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Ti.BACK}),l(n)&&(i=Rt(n,i,!0)),i};var ao=r1;var tpn=_(T(),1);var vhn=_(T(),1),QI=`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 Fhn=_(T(),1),jI=`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 Mhn=_(T(),1),qI=`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 khn=_(T(),1),$I=`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 Dhn=_(T(),1),eX=`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 Bhn=_(T(),1),tX=`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 zhn=_(T(),1),nX=`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 Khn=_(T(),1),iX=`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 Qhn=_(T(),1),oX=`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 qhn=_(T(),1),rX=`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 efn=_(T(),1),sX=`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 nfn=_(T(),1),aX=`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 ofn=_(T(),1),cX=`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 sfn=_(T(),1),lX=`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 cfn=_(T(),1),dX=`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 dfn=_(T(),1),uX=`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 mfn=_(T(),1),mX=`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 ffn=_(T(),1),hX=`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 bfn=_(T(),1),fX=`// 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 Ye(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??en.LINEAR,this._magnificationFilter=e.magnificationFilter??fi.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,pNe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(Ye._uniformList[this.type])||(Ye._uniformList[this.type]=Object.keys(this._uniforms))}Ye._uniformList={};Ye.fromType=function(e,t){let n=new Ye({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Ye.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};Ye.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let d=c.image,u;Array.isArray(d)&&(u=d.slice(1,d.length).map(function(y){return y.bufferView}),d=d[0]);let h=new tn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(d.internalFormat)?p=new vt({context:e,pixelFormat:d.internalFormat,width:d.width,height:d.height,source:{arrayBufferView:d.bufferView,mipLevels:u},sampler:h}):p=new vt({context:e,source:d,sampler:h});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let f=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(f)){let y=this.uniforms[f];y.x=p._width,y.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let d=c.images,u=new Lr({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]},sampler:new tn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=u}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};Ye.prototype.isDestroyed=function(){return!1};Ye.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 me(this)};function pNe(e,t){e=e??Y.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Be(e.fabric??Y.EMPTY_OBJECT),t._template.uniforms=Be(t._template.uniforms??Y.EMPTY_OBJECT),t._template.materials=Be(t._template.materials??Y.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Hn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=Ye._materialCache.getMaterial(t.type);if(l(i)){let r=Be(i.fabric,!0);t._template=Rt(t._template,r,!0),n=i.translucent}xNe(t),l(i)||Ye._materialCache.addMaterial(t.type,t),TNe(t),LNe(t),ZNe(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 pK(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 Yae(e,t){}function bNe(e,t){}var gNe=["type","materials","uniforms","components","source"],yNe=["diffuse","specular","shininess","normal","emission","alpha"];function xNe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;pK(t,gNe,Yae,!0),pK(o,yNe,Yae,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);pK(n,r,bNe,!1)}function _Ne(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 TNe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
|
|
|
`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
{
|
|
|
`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&_Ne(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s};
|
|
|
`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha};
|
|
|
`:e.shaderSource+=`material.${o} = ${t[o]};
|
|
|
`}e.shaderSource+=`return material;
|
|
|
}
|
|
|
`}}var zae={mat2:Xi,mat3:$,mat4:F},SNe=/\.ktx2$/i;function CNe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===Ye.DefaultImageId;t=r;let c=n._textures[e],d,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new tn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new vt({context:i,source:r,sampler:p}),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 p=n._textures[e];l(p)&&p!==n._defaultTexture&&!p.isDestroyed()&&n.autoDestroyOldTexture&&p.destroy(),n._textures[e]=r,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=r._width,u.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=c._width,u.y=c._height)),a)return;let h=r instanceof Re;if(!l(n._texturePaths[e])||h&&r.url!==n._texturePaths[e].url||!h&&r!==n._texturePaths[e]){if(typeof r=="string"||h){let p=h?r:Re.createIfNeeded(r),g;SNe.test(p.url)?g=Ll(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(f){n._loadedImages.push({id:e,image:f})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function VNe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Lr){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Ye.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Re.createIfNeeded(i.positiveX).fetchImage(),Re.createIfNeeded(i.negativeX).fetchImage(),Re.createIfNeeded(i.positiveY).fetchImage(),Re.createIfNeeded(i.negativeY).fetchImage(),Re.createIfNeeded(i.positiveZ).fetchImage(),Re.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function LNe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Hae(e,n)}function Hae(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=RNe(o),s;if(r==="channels")s=pX(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;GNe(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},Hae(e,d))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let d=`uniform ${r} ${t};`;e.shaderSource=d+e.shaderSource}let c=`${t}_${e._count++}`;if(s=pX(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(CNe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(VNe(t));else if(r.indexOf("mat")!==-1){let d=new zae[r];e._uniforms[c]=function(){return zae[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function RNe(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 Re||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof vt)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Ye.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 ZNe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Ye({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=Rt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;pX(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=pX(e,i,a)}}function pX(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,d,u){return d||u?c:(o+=1,n)}),o}function GNe(e,t,n){return pX(e,t,t,n)}Ye._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Ye.DefaultImageId="czm_defaultImage";Ye.DefaultCubeMapId="czm_defaultCubeMap";Ye.ColorType="Color";Ye._materialCache.addMaterial(Ye.ColorType,{fabric:{type:Ye.ColorType,uniforms:{color:new D(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Ye.ImageType="Image";Ye._materialCache.addMaterial(Ye.ImageType,{fabric:{type:Ye.ImageType,uniforms:{image:Ye.DefaultImageId,repeat:new U(1,1),color:new D(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Ye.DiffuseMapType="DiffuseMap";Ye._materialCache.addMaterial(Ye.DiffuseMapType,{fabric:{type:Ye.DiffuseMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ye.AlphaMapType="AlphaMap";Ye._materialCache.addMaterial(Ye.AlphaMapType,{fabric:{type:Ye.AlphaMapType,uniforms:{image:Ye.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Ye.SpecularMapType="SpecularMap";Ye._materialCache.addMaterial(Ye.SpecularMapType,{fabric:{type:Ye.SpecularMapType,uniforms:{image:Ye.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Ye.EmissionMapType="EmissionMap";Ye._materialCache.addMaterial(Ye.EmissionMapType,{fabric:{type:Ye.EmissionMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ye.BumpMapType="BumpMap";Ye._materialCache.addMaterial(Ye.BumpMapType,{fabric:{type:Ye.BumpMapType,uniforms:{image:Ye.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:jI},translucent:!1});Ye.NormalMapType="NormalMap";Ye._materialCache.addMaterial(Ye.NormalMapType,{fabric:{type:Ye.NormalMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:rX},translucent:!1});Ye.GridType="Grid";Ye._materialCache.addMaterial(Ye.GridType,{fabric:{type:Ye.GridType,uniforms:{color:new D(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:oX},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Ye.StripeType="Stripe";Ye._materialCache.addMaterial(Ye.StripeType,{fabric:{type:Ye.StripeType,uniforms:{horizontal:!0,evenColor:new D(1,1,1,.5),oddColor:new D(0,0,1,.5),offset:0,repeat:5},source:mX},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Ye.CheckerboardType="Checkerboard";Ye._materialCache.addMaterial(Ye.CheckerboardType,{fabric:{type:Ye.CheckerboardType,uniforms:{lightColor:new D(1,1,1,.5),darkColor:new D(0,0,0,.5),repeat:new U(5,5)},source:qI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ye.DotType="Dot";Ye._materialCache.addMaterial(Ye.DotType,{fabric:{type:Ye.DotType,uniforms:{lightColor:new D(1,1,0,.75),darkColor:new D(0,1,1,.75),repeat:new U(5,5)},source:$I},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ye.WaterType="Water";Ye._materialCache.addMaterial(Ye.WaterType,{fabric:{type:Ye.WaterType,uniforms:{baseWaterColor:new D(.2,.3,.6,1),blendColor:new D(0,1,.699,1),specularMap:Ye.DefaultImageId,normalMap:Ye.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:fX},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Ye.RimLightingType="RimLighting";Ye._materialCache.addMaterial(Ye.RimLightingType,{fabric:{type:Ye.RimLightingType,uniforms:{color:new D(1,0,0,.7),rimColor:new D(1,1,1,.4),width:.3},source:dX},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Ye.FadeType="Fade";Ye._materialCache.addMaterial(Ye.FadeType,{fabric:{type:Ye.FadeType,uniforms:{fadeInColor:new D(1,0,0,1),fadeOutColor:new D(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:iX},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Ye.PolylineArrowType="PolylineArrow";Ye._materialCache.addMaterial(Ye.PolylineArrowType,{fabric:{type:Ye.PolylineArrowType,uniforms:{color:new D(1,1,1,1)},source:sX},translucent:!0});Ye.PolylineDashType="PolylineDash";Ye._materialCache.addMaterial(Ye.PolylineDashType,{fabric:{type:Ye.PolylineDashType,uniforms:{color:new D(1,0,1,1),gapColor:new D(0,0,0,0),dashLength:16,dashPattern:255},source:aX},translucent:!0});Ye.PolylineGlowType="PolylineGlow";Ye._materialCache.addMaterial(Ye.PolylineGlowType,{fabric:{type:Ye.PolylineGlowType,uniforms:{color:new D(0,.5,1,1),glowPower:.25,taperPower:1},source:cX},translucent:!0});Ye.PolylineOutlineType="PolylineOutline";Ye._materialCache.addMaterial(Ye.PolylineOutlineType,{fabric:{type:Ye.PolylineOutlineType,uniforms:{color:new D(1,1,1,1),outlineColor:new D(1,0,0,1),outlineWidth:1},source:lX},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Ye.ElevationContourType="ElevationContour";Ye._materialCache.addMaterial(Ye.ElevationContourType,{fabric:{type:Ye.ElevationContourType,uniforms:{spacing:100,color:new D(1,0,0,1),width:1},source:tX},translucent:!1});Ye.ElevationRampType="ElevationRamp";Ye._materialCache.addMaterial(Ye.ElevationRampType,{fabric:{type:Ye.ElevationRampType,uniforms:{image:Ye.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:nX},translucent:!1});Ye.SlopeRampMaterialType="SlopeRamp";Ye._materialCache.addMaterial(Ye.SlopeRampMaterialType,{fabric:{type:Ye.SlopeRampMaterialType,uniforms:{image:Ye.DefaultImageId},source:uX},translucent:!1});Ye.AspectRampMaterialType="AspectRamp";Ye._materialCache.addMaterial(Ye.AspectRampMaterialType,{fabric:{type:Ye.AspectRampMaterialType,uniforms:{image:Ye.DefaultImageId},source:QI},translucent:!1});Ye.ElevationBandType="ElevationBand";Ye._materialCache.addMaterial(Ye.ElevationBandType,{fabric:{type:Ye.ElevationBandType,uniforms:{heights:Ye.DefaultImageId,colors:Ye.DefaultImageId},source:eX},translucent:!0});Ye.WaterMaskType="WaterMask";Ye._materialCache.addMaterial(Ye.WaterMaskType,{fabric:{type:Ye.WaterMaskType,source:hX,uniforms:{waterColor:new D(1,1,1,1),landColor:new D(0,0,0,0)}},translucent:!1});var Ji=Ye;function g_(e){e=e??Y.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??g_.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:Ji.fromType(Ji.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=ao.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(g_.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}}});g_.prototype.getFragmentShaderSource=ao.prototype.getFragmentShaderSource;g_.prototype.isTranslucent=ao.prototype.isTranslucent;g_.prototype.getRenderState=ao.prototype.getRenderState;g_.MaterialSupport={BASIC:Object.freeze({vertexFormat:Xe.POSITION_AND_NORMAL,vertexShaderSource:HI,fragmentShaderSource:zI}),TEXTURED:Object.freeze({vertexFormat:Xe.POSITION_NORMAL_AND_ST,vertexShaderSource:JI,fragmentShaderSource:KI}),ALL:Object.freeze({vertexFormat:Xe.ALL,vertexShaderSource:YI,fragmentShaderSource:BI})};var mo=g_;var Xpn=_(T(),1);var bpn=_(T(),1),bX=`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 ypn=_(T(),1),gX=`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 _pn=_(T(),1),y_=`in vec4 v_color;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
|
}
|
|
|
`;var Spn=_(T(),1),yX=`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 nb(e){e=e??Y.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?yX:gX,r=i?y_:bX,s=i?nb.FLAT_VERTEX_FORMAT:nb.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=ao.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(nb.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}}});nb.VERTEX_FORMAT=Xe.POSITION_AND_NORMAL;nb.FLAT_VERTEX_FORMAT=Xe.POSITION_ONLY;nb.prototype.getFragmentShaderSource=ao.prototype.getFragmentShaderSource;nb.prototype.isTranslucent=ao.prototype.isTranslucent;nb.prototype.getRenderState=ao.prototype.getRenderState;var hn=nb;var Npn=_(T(),1);function s1(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(s1.prototype,{isConstant:{get:function(){return J.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});s1.prototype.getType=function(e){return"Color"};var ENe=new q;s1.prototype.getValue=function(e,t){return l(e)||(e=q.now(ENe)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,D.WHITE,t.color),t};s1.prototype.equals=function(e){return this===e||e instanceof s1&&J.equals(this._color,e._color)};var zt=s1;var $gn=_(T(),1);var Wgn=_(T(),1);var fgn=_(T(),1);var Upn=_(T(),1),xX=`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 Opn=_(T(),1),Gg=`#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 Ypn=_(T(),1),Kae={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};Kae.NUMBER_OF_CLASSIFICATION_TYPES=3;var On=Object.freeze(Kae);var Kpn=_(T(),1);var INe={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},yc=Object.freeze(INe);var f0n=_(T(),1);var cbn=_(T(),1);function ib(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=XNe(t),o=e.floatingPointTexture,r=i===je.FLOAT&&!o,s=WNe(t,r),a=PNe(s,t,r),c=Math.floor(Dt.maximumTextureSize/a),d=Math.min(n,c),u=a*d,h=Math.ceil(n/d),p=1/u,g=p*.5,f=1/h,y=f*.5;this._textureDimensions=new U(u,h),this._textureStep=new re(p,g,f,y),this._pixelDatatype=r?je.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let x=4*u*h;this._batchValues=i===je.FLOAT&&!r?new Float32Array(x):new Uint8Array(x),this._batchValuesDirty=!1}Object.defineProperties(ib.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function XNe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Q.UNSIGNED_BYTE){t=!0;break}return t?je.FLOAT:je.UNSIGNED_BYTE}function Qae(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?m:n===4?re:Number}function WNe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==Q.UNSIGNED_BYTE&&t?i+=4:++i}return n}function PNe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==Q.UNSIGNED_BYTE&&n?o+4:o+1}var _X=new re;function vNe(e,t,n){let i=re.unpack(e,t,_X),o=re.unpackFloat(i);i=re.unpack(e,t+4,_X);let r=re.unpackFloat(i);i=re.unpack(e,t+8,_X);let s=re.unpackFloat(i);i=re.unpack(e,t+12,_X);let a=re.unpackFloat(i);return re.fromElements(o,r,s,a,n)}function wNe(e,t,n){let i=re.packFloat(e.x,_X);re.pack(i,t,n),i=re.packFloat(e.y,i),re.pack(i,t,n+4),i=re.packFloat(e.z,i),re.pack(i,t,n+8),i=re.packFloat(e.w,i),re.pack(i,t,n+12)}var Jae=new re;ib.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==je.UNSIGNED_BYTE?a=vNe(this._batchValues,s,Jae):a=re.unpack(this._batchValues,s,Jae);let c=Qae(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var FNe=[void 0,void 0,new U,new m,new re],ANe=new re;ib.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=FNe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Qae(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=ANe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let d=this._offsets[t],h=4*this._stride*e+4*d;this._packFloats&&i[t].componentDatatype!==je.UNSIGNED_BYTE?wNe(c,this._batchValues,h):re.pack(c,this._batchValues,h),this._batchValuesDirty=!0};function MNe(e,t){let n=e._textureDimensions;e._texture=new vt({context:t,pixelFormat:ot.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:tn.NEAREST,flipY:!1})}function NNe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}ib.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||MNe(this,e.context),NNe(this))};ib.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Rt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function kNe(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 UNe(e){return e===1?"float":`vec${e}`}function DNe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function ONe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=UNe(o),a=DNe(o),c=e._offsets[t],d=`${s} ${r}(float batchId)
|
|
|
{
|
|
|
vec2 st = computeSt(batchId);
|
|
|
st.x += batchTextureStep.x * float(${c});
|
|
|
`;return e._packFloats&&i.componentDatatype!==je.UNSIGNED_BYTE?d+=`vec4 textureValue;
|
|
|
textureValue.x = czm_unpackFloat(texture(batchTexture, st));
|
|
|
textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0)));
|
|
|
textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0)));
|
|
|
textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0)));
|
|
|
`:d+=` vec4 textureValue = texture(batchTexture, st);
|
|
|
`,d+=` ${s} value = textureValue${a};
|
|
|
`,e._pixelDatatype===je.UNSIGNED_BYTE&&i.componentDatatype===Q.UNSIGNED_BYTE&&!i.normalize?d+=`value *= 255.0;
|
|
|
`:e._pixelDatatype===je.FLOAT&&i.componentDatatype===Q.UNSIGNED_BYTE&&i.normalize&&(d+=`value /= 255.0;
|
|
|
`),d+=` return value;
|
|
|
}
|
|
|
`,d}ib.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
|
|
|
`;t+=`${kNe(this)}
|
|
|
`;let n=e.length;for(let i=0;i<n;++i)t+=ONe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r}
|
|
|
${t}
|
|
|
${s}`}};ib.prototype.isDestroyed=function(){return!1};ib.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),me(this)};var x_=ib;var Cbn=_(T(),1);function BNe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!F.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&An.transformToWorldCoordinates(e[r]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function bK(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function YNe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?bK(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(bK(i.westHemisphereGeometry,n),bK(i.eastHemisphereGeometry,n))}}function zNe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,d,u,h=t.length;for(c=0;c<h;++c)if(l(t[c].geometry)){u=t[c].geometry.primitiveType;break}if(BNe(t,a,o),!o)for(c=0;c<h;++c)l(t[c].geometry)&&An.splitLongitude(t[c]);if(YNe(t),r)for(c=0;c<h;++c){let g=t[c];l(g.geometry)?(An.reorderForPostVertexCache(g.geometry),An.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(An.reorderForPostVertexCache(g.westHemisphereGeometry),An.reorderForPreVertexCache(g.westHemisphereGeometry),An.reorderForPostVertexCache(g.eastHemisphereGeometry),An.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=An.combineInstances(t);for(h=p.length,c=0;c<h;++c){d=p[c];let g=d.attributes;if(o)for(let f in g)g.hasOwnProperty(f)&&g[f].componentDatatype===Q.DOUBLE&&An.encodeAttribute(d,f,`${f}3DHigh`,`${f}3DLow`);else for(let f in g)if(g.hasOwnProperty(f)&&g[f].componentDatatype===Q.DOUBLE){let y=`${f}3D`,x=`${f}2D`;An.projectTo2D(d,f,y,x,n),l(d.boundingSphere)&&f==="position"&&(d.boundingSphereCV=de.fromVertices(d.attributes.position2D.values)),An.encodeAttribute(d,y,`${y}High`,`${y}Low`),An.encodeAttribute(d,x,`${x}High`,`${x}Low`)}s&&An.compressVertices(d)}if(!i){let g=[];for(h=p.length,c=0;c<h;++c)d=p[c],g=g.concat(An.fitToUnsignedShortIndices(d));p=g}return p}function gK(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let d=0;d<c;++d){let h=e[d][t];if(!l(h))continue;let p=h.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function HNe(e,t){let n=[];return gK(e,"geometry",t,n),gK(e,"westHemisphereGeometry",t,n),gK(e,"eastHemisphereGeometry",t,n),n}var ob={};ob.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=zNe(e),t.length>0&&(n=An.createAttributeLocations(t[0]),e.createPickOffsets&&(r=HNe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),d=new Array(o);for(let u=0;u<o;++u){let h=i[u],p=h.geometry;l(p)&&(c[u]=p.boundingSphere,d[u]=p.boundingSphereCV,a&&(s[u]=h.geometry.offsetAttribute));let g=h.eastHemisphereGeometry,f=h.westHemisphereGeometry;l(g)&&l(f)&&(l(g.boundingSphere)&&l(f.boundingSphere)&&(c[u]=de.union(g.boundingSphere,f.boundingSphere)),l(g.boundingSphereCV)&&l(f.boundingSphereCV)&&(d[u]=de.union(g.boundingSphereCV,f.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:d}};function KNe(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 JNe(e,t){let n=e.length;for(let i=0;i<n;++i)KNe(e[i],t)}function QNe(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*de.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}ob.packCreateGeometryResults=function(e,t){let n=new Float64Array(QNe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],d=l(c);if(n[s++]=d?1:0,!d)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let u=l(c.boundingSphere)?1:0;n[s++]=u,u&&de.pack(c.boundingSphere,n,s),s+=de.packedLength;let h=l(c.boundingSphereCV)?1:0;n[s++]=h,h&&de.pack(c.boundingSphereCV,n,s),s+=de.packedLength;let p=c.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(g.push(y),l(o[y])||(o[y]=i.length,i.push(y)));n[s++]=g.length;for(let y=0;y<g.length;y++){let x=g[y],S=p[x];n[s++]=o[x],n[s++]=S.componentDatatype,n[s++]=S.componentsPerAttribute,n[s++]=S.normalize?1:0,n[s++]=S.values.length,n.set(S.values,s),s+=S.values.length}let f=l(c.indices)?c.indices.length:0;n[s++]=f,f>0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};ob.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],d=n[s++],u=n[s++];u===-1&&(u=void 0);let h,p;n[s++]===1&&(h=de.unpack(n,s)),s+=de.packedLength,n[s++]===1&&(p=de.unpack(n,s)),s+=de.packedLength;let y,x,S,C=new pn,V=n[s++];for(i=0;i<V;i++){let Z=t[n[s++]],E=n[s++];S=n[s++];let P=n[s++]!==0;y=n[s++],x=Q.createTypedArray(E,y);for(let W=0;W<y;W++)x[W]=n[s++];C[Z]=new Ze({componentDatatype:E,componentsPerAttribute:S,normalize:P,values:x})}let L;if(y=n[s++],y>0){let Z=x.length/S;for(L=Ne.createTypedArray(Z,y),i=0;i<y;i++)L[i]=n[s++]}o[r++]=new ht({primitiveType:c,geometryType:d,boundingSphere:h,boundingSphereCV:p,indices:L,attributes:C,offsetAttribute:u})}return o};function jNe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(F.pack(s.modelMatrix,i,o),o+=F.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function qNe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=F.unpack(t,o),s;o+=F.packedLength,l(t[o])&&(s={offset:new io(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}ob.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:jNe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Ii,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};ob.unpackCombineGeometryParameters=function(e){let t=qNe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=ob.unpackCreateGeometryResults(n[a]),d=c.length;for(let u=0;u<d;u++){let h=c[u],p=t[o];p.geometry=h,++o}}let r=ne.clone(e.ellipsoid),s=e.isGeographic?new Ii(r):new Pi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function jae(e){let t=e.length,n=1+(de.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,de.pack(e[r],i,o)):i[o++]=0,o+=de.packedLength}return i}function qae(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=de.unpack(e,i)),++n,i+=de.packedLength;return t}ob.packCombineGeometryResults=function(e,t){l(e.geometries)&&JNe(e.geometries,t);let n=jae(e.boundingSpheres),i=jae(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}};ob.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:qae(e.boundingSpheres),boundingSpheresCV:qae(e.boundingSpheresCV)}};var __=ob;var Lbn=_(T(),1),$Ne={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Gr=Object.freeze($Ne);var Zbn=_(T(),1),Sd={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Sd.NUMBER_OF_SHADOW_MODES=4;Sd.castShadows=function(e){return e===Sd.ENABLED||e===Sd.CAST_ONLY};Sd.receiveShadows=function(e){return e===Sd.ENABLED||e===Sd.RECEIVE_ONLY};Sd.fromCastReceive=function(e,t){return e&&t?Sd.ENABLED:e?Sd.CAST_ONLY:t?Sd.RECEIVE_ONLY:Sd.DISABLED};var Cn=Object.freeze(Sd);function Er(e){e=e??Y.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Cn.DISABLED,this._translucent=void 0,this._state=Gr.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(Er.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 e5e(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var t5e=new U,n5e=new m,ace=new re;function cce(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,t5e);if(t===3)return m.unpack(e,0,n5e);if(t===4)return re.unpack(e,0,ace)}function i5e(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=e5e(i),s=r.length,a=[],c={},d={},u,p=i[0].attributes,g,f,y;for(g=0;g<s;++g)f=r[g],y=p[f],c[f]=g,a.push({functionName:`czm_batchTable_${f}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Q.FLOAT,componentsPerAttribute:1}),d.center3DHigh=a.length-5,d.center3DLow=a.length-4,d.center2DHigh=a.length-3,d.center2DLow=a.length-2,d.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Q.FLOAT,componentsPerAttribute:3}),u=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let x=a.length,S=new x_(t,a,o);for(g=0;g<o;++g){let C=i[g];p=C.attributes;for(let P=0;P<s;++P){f=r[P],y=p[f];let W=cce(y.value),v=c[f];S.setBatchedAttribute(g,v,W)}let V={primitive:C.pickPrimitive??e};l(C.id)&&(V.id=C.id);let L=t.createPickId(V);e._pickIds.push(L);let Z=L.color,E=ace;E.x=D.floatToByte(Z.red),E.y=D.floatToByte(Z.green),E.z=D.floatToByte(Z.blue),E.w=D.floatToByte(Z.alpha),S.setBatchedAttribute(g,x-1,E)}e._batchTable=S,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=d,e._batchTableOffsetAttribute2DIndex=u}function o5e(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ze({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function r5e(e){let t=e.attributes,n=new pn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=o5e(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new ht({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:de.clone(e.boundingSphere)})}function s5e(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var a5e=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Er._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=a5e.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c};
|
|
|
`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView;
|
|
|
`,r+=`in vec4 position;
|
|
|
`,s+=`${c}
|
|
|
{
|
|
|
return u_modifiedModelView * position;
|
|
|
}
|
|
|
|
|
|
`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c}
|
|
|
{
|
|
|
return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
|
|
|
}
|
|
|
|
|
|
`:(r+=`in vec3 ${a}2DHigh;
|
|
|
in vec3 ${a}2DLow;
|
|
|
`,s+=`${c}
|
|
|
{
|
|
|
vec4 p;
|
|
|
if (czm_morphTime == 1.0)
|
|
|
{
|
|
|
p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
|
|
|
}
|
|
|
else if (czm_morphTime == 0.0)
|
|
|
{
|
|
|
p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
p = czm_columbusViewMorph(
|
|
|
czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy),
|
|
|
czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow),
|
|
|
czm_morphTime);
|
|
|
}
|
|
|
return p;
|
|
|
}
|
|
|
|
|
|
`)}return[o,r,t,s].join(`
|
|
|
`)};Er._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${De.replaceMain(t,"czm_non_show_main")}
|
|
|
void main()
|
|
|
{
|
|
|
czm_non_show_main();
|
|
|
gl_Position *= czm_batchTable_show(batchId);
|
|
|
}`:t};Er._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 $ae(e){return`${De.replaceMain(e,"czm_non_pick_main")}
|
|
|
out vec4 v_pickColor;
|
|
|
void main()
|
|
|
{
|
|
|
czm_non_pick_main();
|
|
|
v_pickColor = czm_batchTable_pickColor(batchId);
|
|
|
}`}function ece(e){return`in vec4 v_pickColor;
|
|
|
${e}`}Er._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};Er._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};Er._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=De.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 tce(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",d=`in ${a} ${c};`,u="",h="";if(i){u+=`vec2 st;
|
|
|
`;let f=s>1?`${c}.x`:c;h+=` st = czm_decompressTextureCoordinates(${f});
|
|
|
`}n&&o&&r?(u+=`vec3 normal;
|
|
|
vec3 tangent;
|
|
|
vec3 bitangent;
|
|
|
`,h+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
|
|
|
`):(n&&(u+=`vec3 normal;
|
|
|
`,h+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""});
|
|
|
`),o&&(u+=`vec3 tangent;
|
|
|
`,h+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
|
|
|
`),r&&(u+=`vec3 bitangent;
|
|
|
`,h+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"});
|
|
|
`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=De.replaceMain(p,"czm_non_compressed_main");let g=`void main()
|
|
|
{
|
|
|
${h} czm_non_compressed_main();
|
|
|
}`;return[d,u,p,g].join(`
|
|
|
`)}function c5e(e){let t=De.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
|
|
|
czm_non_depth_clamp_main();
|
|
|
gl_Position = czm_depthClamp(gl_Position);}
|
|
|
`,t}function l5e(e){let t=De.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 nce(e,t){let n=e.vertexAttributes}function d5e(e,t){return function(){return e[t]}}var yK=Math.max(Ht.hardwareConcurrency-1,1),xk,u5e=new yi("combineGeometry");function m5e(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Gr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],d=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),d.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(xk))for(xk=new Array(yK),o=0;o<yK;o++)xk[o]=new yi("createGeometry");let u;for(d=vI(d,yK),o=0;o<d.length;o++){let h=0,p=d[o],g=p.length;for(r=0;r<g;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(u.offset=h,h+=i.constructor.packedLength??i.packedLength);let f;if(h>0){let y=new Float64Array(h);for(f=[y.buffer],r=0;r<g;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,u.offset),u.geometry=y)}c.push(xk[o].scheduleTask({subTasks:d[o]},f))}e._state=Gr.CREATING,Promise.all(c).then(function(h){e._createGeometryResults=h,e._state=Gr.CREATED}).catch(function(h){SX(e,t,Gr.FAILED,h)})}else if(e._state===Gr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,d=t.mapProjection,u=u5e.scheduleTask(__.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Gr.COMBINING,Promise.resolve(u).then(function(h){let p=__.unpackCombineGeometryResults(h);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Gr.COMBINED):SX(e,t,Gr.FAILED,void 0)}).catch(function(h){SX(e,t,Gr.FAILED,h)})}}function h5e(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=r5e(p):g=p.constructor.createGeometry(p),o[c++]=s5e(s,g),r.push(s.id)}o.length=c;let d=t.scene3DOnly,u=t.mapProjection,h=__.combineGeometry({instances:o,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:d,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=F.clone(h.modelMatrix,e.modelMatrix),e._pickOffsets=h.pickOffsets,e._offsetInstanceExtend=h.offsetInstanceExtend,e._instanceBoundingSpheres=h.boundingSpheres,e._instanceBoundingSpheresCV=h.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Gr.COMBINED):SX(e,t,Gr.FAILED,void 0)}function f5e(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new de;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let y=a[i],x=e._batchTable.getBatchedAttribute(i,n,new m);y=r[i].clone(y),mce(y,x,o[i])}let c=[],d=[],u=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||de.intersectPlane(y,dn.ORIGIN_ZX_PLANE)!==Jt.INTERSECTING?c.push(y):(d.push(y),u.push(y))}let h=c[0],p=u[0],g=d[0];for(i=1;i<c.length;i++)h=de.union(h,c[i]);for(i=1;i<u.length;i++)p=de.union(p,u[i]);for(i=1;i<d.length;i++)g=de.union(g,d[i]);let f=[];for(l(h)&&f.push(h),l(p)&&f.push(p),l(g)&&f.push(g),i=0;i<f.length;i++){let y=f[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=de.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}Er._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var ice=new Yn,lce=new he,dce=new m,uce=new de;function p5e(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,d=t.mapProjection,u=d.ellipsoid,h=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let f=0;f<g;++f){let y=p[f];if(!l(y))continue;let x=e.modelMatrix;l(x)&&(y=de.transform(y,x,uce));let S=y.center,C=y.radius,V=Yn.fromCartesian(S,ice);if(h.setBatchedAttribute(f,o,V.high),h.setBatchedAttribute(f,r,V.low),!t.scene3DOnly){let L=u.cartesianToCartographic(S,lce),Z=d.project(L,dce);V=Yn.fromCartesian(Z,ice),h.setBatchedAttribute(f,s,V.high),h.setBatchedAttribute(f,a,V.low)}h.setBatchedAttribute(f,c,C)}e._batchTableBoundingSpheresUpdated=!0}var xK=new m,b5e=new m;function oce(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let d=0;d<c;++d){let u=a[d];if(!l(u))continue;let h=s.getBatchedAttribute(d,e._batchTableAttributeIndices.offset);if(m.equals(h,m.ZERO)){s.setBatchedAttribute(d,i,m.ZERO);continue}let p=e.modelMatrix;l(p)&&(u=de.transform(u,p,uce));let g=u.center;g=r.scaleToGeodeticSurface(g,b5e);let f=r.cartesianToCartographic(g,lce),y=o.project(f,dce),x=m.add(h,g,xK);f=r.cartesianToCartographic(x,f);let S=o.project(f,xK),C=m.subtract(S,y,xK),V=C.x;C.x=C.z,C.z=C.y,C.y=V,s.setBatchedAttribute(d,i,C)}e._batchTableOffsetsUpdated=!0}function g5e(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let d=i[c];if(s.push(oi.fromGeometry({context:r,geometry:d,attributeLocations:n,bufferUsage:ke.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,d);else if(e._boundingSpheres.push(de.clone(d.boundingSphere)),e._boundingSphereWC.push(new de),!o){let u=d.boundingSphereCV.center,h=u.x,p=u.y,g=u.z;u.x=g,u.y=h,u.z=p,e._boundingSphereCV.push(de.clone(d.boundingSphereCV)),e._boundingSphere2D.push(new de),e._boundingSphereMorph.push(new de)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,SX(e,t,Gr.COMPLETE,void 0)}function y5e(e,t,n,i){let o=n.getRenderState(),r;i?(r=Be(o,!1),r.cull={enabled:!0,face:Ti.BACK},e._frontFaceRS=Ue.fromCache(r),r.cull.face=Ti.FRONT,e._backFaceRS=Ue.fromCache(r)):(e._frontFaceRS=Ue.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Be(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Be(o,!1),r.depthTest.func=yc.GREATER,i?(r.cull={enabled:!0,face:Ti.BACK},e._frontFaceDepthFailRS=Ue.fromCache(r),r.cull.face=Ti.FRONT,e._backFaceDepthFailRS=Ue.fromCache(r)):(e._frontFaceDepthFailRS=Ue.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function x5e(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=Er._appendOffsetToShader(e,r),r=Er._appendShowToShader(e,r),r=Er._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=$ae(r),r=Er._updateColorAttribute(e,r,!1),r=tce(e,r),r=Er._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=ece(s),e._sp=nn.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),nce(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=Er._appendShowToShader(e,r),r=Er._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=$ae(r),r=Er._updateColorAttribute(e,r,!0),r=tce(e,r),r=Er._modifyShaderPosition(e,r,t.scene3DOnly),r=c5e(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=ece(s),s=l5e(s),e._spDepthFail=nn.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),nce(e._spDepthFail,o))}var TX=new F,rce=new m;function sce(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=d5e(s,c));let a=Rt(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return F.multiply(c,e._modelMatrix,TX),F.multiplyByPoint(TX,e.rtcCenter,rce),F.setTranslation(TX,rce,TX),TX}),a}function _5e(e,t,n,i,o,r,s,a){let c=sce(e,t,n,a),d;l(e._depthFailAppearance)&&(d=sce(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let u=i?Ge.TRANSLUCENT:Ge.OPAQUE,h=o?2:1;h*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let p=r.length,g=0;for(let f=0;f<p;++f){let y;o&&(y=r[f],l(y)||(y=r[f]=new $e({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=u,++f),y=r[f],l(y)||(y=r[f]=new $e({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=u,l(e._depthFailAppearance)&&(o&&(++f,y=r[f],l(y)||(y=r[f]=new $e({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=d,y.pass=u),++f,y=r[f],l(y)||(y=r[f]=new $e({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=d,y.pass=u),++g}}Er._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!F.equals(n,e._modelMatrix))for(F.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=de.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=de.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=de.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],u=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+u}};function T5e(e,t,n,i,o,r,s,a){Er._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 d=t.commandList,u=t.passes;if(u.render||u.pick){let h=e.allowPicking,p=Cn.castShadows(e.shadows),g=Cn.receiveShadows(e.shadows),f=n.length,y=a?2:1;y*=l(e._depthFailAppearance)?2:1;for(let x=0;x<f;++x){let S=Math.floor(x/y),C=n[x];C.modelMatrix=o,C.boundingVolume=c[S],C.cull=r,C.debugShowBoundingVolume=s,C.castShadows=p,C.receiveShadows=g,h?C.pickId="v_pickColor":C.pickId=void 0,d.push(C)}}}Er.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===Gr.FAILED)return;let t=e.context;if(l(this._batchTable)||i5e(this,t),this._batchTable.attributes.length>0){if(Dt.maximumVertexTextureImageUnits===0)throw new ce("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!==Gr.COMPLETE&&this._state!==Gr.COMBINED&&(this.asynchronous?m5e(this,e):h5e(this,e)),this._state===Gr.COMBINED&&(p5e(this,e),oce(this,e),g5e(this,e)),!this.show||this._state!==Gr.COMPLETE)return;this._batchTableOffsetsUpdated||oce(this,e),this._recomputeBoundingSpheres&&f5e(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let d=n.closed&&c;o&&(this._createRenderStatesFunction??y5e)(this,t,n,d),r&&(this._createShaderProgramFunction??x5e)(this,e,n),(o||r)&&(this._createCommandsFunction??_5e)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??T5e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var S5e=new de,C5e=new de;function mce(e,t,n){if(n===ln.TOP){let i=de.clone(e,S5e),o=de.clone(e,C5e);o.center=m.add(o.center,t,o.center),e=de.union(i,o,e)}else n===ln.ALL&&(e.center=m.add(e.center,t,e.center));return e}function V5e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=Q.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function L5e(e,t,n,i,o){return function(r){let s=cce(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var R5e=new m;function Z5e(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)&&mce(i,m.fromArray(r.get(),0,R5e),e._offsetInstanceExtend[n]),l(o)&&(i=de.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function G5e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Er.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;d<r;++d){let u=(i+d)%r;if(e===o[u]){n=u;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let d in a)if(a.hasOwnProperty(d)){let u=a[d];c[d]={get:V5e(s,n,u),set:L5e(s,n,u,this,d)}}return Z5e(this,c,n),G5e(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Er.prototype.isDestroyed=function(){return!1};Er.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,me(this)};function SX(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Gr.COMPLETE||e._state===Gr.FAILED})}var Wn=Er;var W0n=_(T(),1);var b0n=_(T(),1),a1=`#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 PICK
|
|
|
#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.
|
|
|
// Check for logDepthOrDepth != 0.0 to make sure this should be classified.
|
|
|
if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {
|
|
|
out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource
|
|
|
czm_writeDepthClamp();
|
|
|
}
|
|
|
#else // CULL_FRAGMENTS
|
|
|
out_FragColor.a = 1.0;
|
|
|
#endif // CULL_FRAGMENTS
|
|
|
#else // PICK
|
|
|
|
|
|
#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 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 vu(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new _K;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new _K;if(o.requiresTextureCoordinates=e,n instanceof hn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource}
|
|
|
${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}vu.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof hn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof hn||(o=t.material.shaderSource),new De({defines:i,sources:[o,a1]})};vu.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 De({defines:n,sources:[a1],pickColorQualifier:"in"})};vu.prototype.createVertexShader=function(e,t,n,i){return _ce(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};vu.prototype.createPickVertexShader=function(e,t,n,i){return _ce(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var hce=new m,fce=new he,pce={high:0,low:0};function _ce(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let d=fce;d.longitude=X.PI,d.latitude=0,d.height=0;let u=s.project(d,hce),h=Yn.encode(u.x,pce);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`;let p=fce;p.longitude=-X.PI,p.latitude=0,p.height=0;let g=s.project(p,hce);h=Yn.encode(g.x,pce),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof hn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new De({defines:c,sources:[o]})}function _K(){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(_K.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 bce(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)/U.distance(t,e)}var E5e=[new U,new U,new U,new U];function Tce(e,t){let n=E5e,i=U.unpack(t,0,n[0]),o=U.unpack(t,2,n[1]),r=U.unpack(t,4,n[2]);e.uMaxVmax=new uc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/bce(i,o,r),a=1/bce(i,r,o);e.uvMinAndExtents=new uc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Sce=new he,Cce=new m,I5e=new m,X5e=new m,_k={high:0,low:0};function Vce(e,t,n){let i=Sce;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,Cce);i.latitude=e.north;let r=t.project(i,I5e);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,X5e),a=[0,0,0,0],c=[0,0,0,0],d=Yn.encode(o.x,_k);a[0]=d.high,c[0]=d.low,d=Yn.encode(o.y,_k),a[1]=d.high,c[1]=d.low,d=Yn.encode(r.y,_k),a[2]=d.high,c[2]=d.low,d=Yn.encode(s.x,_k),a[3]=d.high,c[3]=d.low,n.planes2D_HIGH=new uc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new uc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var W5e=new F,P5e=new F,gce=new m,v5e=new he,w5e=[new he,new he,new he,new he,new he,new he,new he,new he];function F5e(e,t,n,i,o,r){let s=le.center(e,v5e);s.height=n;let a=he.toCartesian(s,t,gce),c=Ft.eastNorthUpToFixedFrame(a,t,W5e),d=F.inverse(c,P5e),u=e.west,h=e.east,p=e.north,g=e.south,f=w5e;f[0].latitude=g,f[0].longitude=u,f[1].latitude=p,f[1].longitude=u,f[2].latitude=p,f[2].longitude=h,f[3].latitude=g,f[3].longitude=h;let y=(u+h)*.5,x=(p+g)*.5;f[4].latitude=g,f[4].longitude=y,f[5].latitude=p,f[5].longitude=y,f[6].latitude=x,f[6].longitude=u,f[7].latitude=x,f[7].longitude=h;let S=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,V=Number.POSITIVE_INFINITY,L=Number.NEGATIVE_INFINITY;for(let W=0;W<8;W++){f[W].height=n;let v=he.toCartesian(f[W],t,gce);F.multiplyByPoint(d,v,v),v.z=0,S=Math.min(S,v.x),C=Math.max(C,v.x),V=Math.min(V,v.y),L=Math.max(L,v.y)}let Z=i;Z.x=S,Z.y=V,Z.z=0,F.multiplyByPoint(c,Z,Z);let E=o;E.x=C,E.y=V,E.z=0,F.multiplyByPoint(c,E,E),m.subtract(E,Z,o);let P=r;P.x=S,P.y=L,P.z=0,F.multiplyByPoint(c,P,P),m.subtract(P,Z,r)}var A5e=new m,M5e=new m,N5e=new Yn;vu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=Cce,s=A5e,a=M5e;F5e(e,n,o??0,r,s,a);let c={};Tce(c,t);let d=Yn.fromCartesian(r,N5e);return c.southWest_HIGH=new uc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(d.high,[0,0,0])}),c.southWest_LOW=new uc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(d.low,[0,0,0])}),c.eastward=new uc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new uc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),Vce(e,i,c),c};var k5e=new m;function yce(e,t,n,i){let o=Sce;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,k5e),s=Math.sqrt(r.x*r.x+r.y*r.y),a=X.fastApproximateAtan2(s,r.z),c=X.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var xce=new U;vu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=yce(e.south,e.west,n,xce),r=o.x,s=o.y,a=yce(e.north,e.east,n,xce),c=a.x,d=a.y,u=0;s>d&&(u=X.PI-s,s=-X.PI,d+=u),r-=X.EPSILON5,s-=X.EPSILON5,c+=X.EPSILON5,d+=X.EPSILON5;let h=1/(d-s),p=1/(c-r),g={sphericalExtents:new uc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new uc({componentDatatype:Q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return Tce(g,t),Vce(e,i,g),g};vu.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)};vu.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 U5e(e){return Math.max(e.width,e.height)>vu.MAX_WIDTH_FOR_PLANAR_EXTENTS}vu.shouldUseSphericalCoordinates=function(e){return U5e(e)};vu.MAX_WIDTH_FOR_PLANAR_EXTENTS=X.toRadians(1);var Cd=vu;var D0n=_(T(),1);var w0n=_(T(),1);var D5e={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},Bn=Object.freeze(D5e);var M0n=_(T(),1);var O5e={ZERO:ie.ZERO,KEEP:ie.KEEP,REPLACE:ie.REPLACE,INCREMENT:ie.INCR,DECREMENT:ie.DECR,INVERT:ie.INVERT,INCREMENT_WRAP:ie.INCR_WRAP,DECREMENT_WRAP:ie.DECR_WRAP},pt=Object.freeze(O5e);var Tk={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};Tk.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Bn.ALWAYS,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.REPLACE},backFunction:Bn.ALWAYS,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.REPLACE},reference:Tk.CESIUM_3D_TILE_MASK,mask:Tk.CESIUM_3D_TILE_MASK}};var Yt=Object.freeze(Tk);function T_(e){e=e??Y.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??On.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(T_.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}}});T_.isSupported=function(e){return e.context.stencilBuffer};function c1(e,t){let n=t?Bn.EQUAL:Bn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:n,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL},depthMask:!1}}function SK(e){return{stencilTest:{enabled:e,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND}}var B5e={stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Y5e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ue.fromCache(c1(o,!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(c1(o,!0)),e._rsColorPass=Ue.fromCache(SK(o,!1)),e._rsPickPass=Ue.fromCache(B5e)}function z5e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
|
|
|
`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0);
|
|
|
`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=De.replaceMain(s,"czm_non_compressed_main");let a=`void main()
|
|
|
{
|
|
|
${r} czm_non_compressed_main();
|
|
|
}`;return[i,o,s,a].join(`
|
|
|
`)}}function H5e(e,t){let n=t.context,i=e._primitive,o=xX;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Wn._appendDistanceDisplayConditionToShader(i,o),o=Wn._modifyShaderPosition(e,o,t.scene3DOnly),o=Wn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=z5e(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new De({defines:[a],sources:[o]}),d=new De({sources:[Gg]}),u=e._primitive._attributeLocations,h=new Cd(s,r,e.appearance);if(e._spStencil=nn.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=De.createPickVertexShaderSource(o);f=Wn._appendShowToShader(i,f),f=Wn._updatePickColorAttribute(f);let y=h.createPickFragmentShader(!1),x=h.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=nn.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:x,fragmentShaderSource:y,attributeLocations:u}),s){let S=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(S)){let C=h.createPickFragmentShader(!0),V=h.createPickVertexShader([a],f,!0,t.mapProjection);S=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:V,fragmentShaderSource:C,attributeLocations:u})}e._spPick2D=S}}else e._spPick=nn.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=Wn._appendShowToShader(i,o),c=new De({defines:[a],sources:[o]}),e._sp=nn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=h.createFragmentShader(!1),g=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=nn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let y=h.createFragmentShader(!0),x=h.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:x,fragmentShaderSource:y,attributeLocations:u})}e._spColor2D=f}}function K5e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],l(r)||(r=t[o]=new $e({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Ge.TERRAIN_CLASSIFICATION,s=$e.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new $e({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Ge.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=Rt(c,y._uniforms)),r.uniformMap=c,s=$e.shallowClone(r,r.derivedCommands.tileset),s.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,d){let x=$e.shallowClone(r,r.derivedCommands.appearance2D);x.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=x,x=$e.shallowClone(s,s.derivedCommands.appearance2D),x.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=x}}let u=e._commandsIgnoreShow,h=e._spStencil,p=0;i=u.length=i/2;for(let g=0;g<i;++g){let f=u[g]=$e.shallowClone(t[p],u[g]);f.shaderProgram=h,f.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function J5e(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,d,u,h=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<o;c+=2){let f=i._va[h++];if(n&&(a=r[s++],f=i._va[a.index]),d=t[c],l(d)||(d=t[c]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=p,d.pass=Ge.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=$e.shallowClone(d,d.derivedCommands.tileset),u.renderState=e._rsStencilDepthPass3DTiles,u.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,d=t[c+1],l(d)||(d=t[c+1]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=p,d.pass=Ge.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=$e.shallowClone(d,d.derivedCommands.tileset),u.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,g){let y=$e.shallowClone(d,d.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=y,y=$e.shallowClone(u,u.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y}}}function Q5e(e,t,n,i,o,r,s){K5e(e,r),J5e(e,s)}function Lce(e,t){return Math.floor(e%t/2)}function TK(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Rce(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function j5e(e,t,n,i,o,r,s,a){let c=e._primitive;Wn._updateBoundingVolumes(c,t,o);let d;t.mode===oe.SCENE3D?d=c._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?d=c._boundingSphereCV:t.mode===oe.SCENE2D&&l(c._boundingSphere2D)?d=c._boundingSphere2D:l(c._boundingSphereMorph)&&(d=c._boundingSphereMorph);let u=e.classificationType,h=u!==On.CESIUM_3D_TILE,p=u!==On.TERRAIN,g=t.passes,f,y,x;if(g.render){let S=n.length;for(f=0;f<S;++f)y=d[Lce(f,S)],h&&(x=n[f],TK(x,t,o,r,y,s)),p&&(x=n[f].derivedCommands.tileset,TK(x,t,o,r,y,s));if(t.invertClassification){let C=e._commandsIgnoreShow,V=C.length;for(f=0;f<V;++f)y=d[f],x=C[f],TK(x,t,o,r,y,s)}}if(g.pick){let S=i.length,C=c._pickOffsets;for(f=0;f<S;++f){let V=C[Lce(f,S)];y=d[V.index],h&&(x=i[f],Rce(x,t,o,r,y)),p&&(x=i[f].derivedCommands.tileset,Rce(x,t,o,r,y))}}}T_.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,d=!1,u=!0,h,p=!1,g=!1;for(r>0&&(c=o[0].attributes,p=Cd.hasAttributesForSphericalExtents(c),g=Cd.hasAttributesForTextureCoordinatePlanes(c),h=c.color),s=0;s<r;s++){a=o[s];let y=a.attributes.color;l(y)&&(d=!0),u=u&&l(y)&&Kt.equals(h,y)}if(!u&&!p&&!g)throw new fe("All GeometryInstances must have the same color attribute except via GroundPrimitives");d&&!l(t)&&(t=new hn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=d;let f=new Array(r);for(s=0;s<r;++s)a=o[s],f[s]=new Xt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=f,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,x){n._createBoundingVolumeFunction(y,x)}),i._createRenderStatesFunction=function(y,x,S,C){Y5e(n,x)},i._createShaderProgramFunction=function(y,x,S){H5e(n,x)},i._createCommandsFunction=function(y,x,S,C,V,L,Z){Q5e(n,void 0,void 0,!0,!1,L,Z)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,x,S,C,V,L,Z,E){n._updateAndQueueCommandsFunction(y,x,S,C,V,L,Z,E)}:i._updateAndQueueCommandsFunction=function(y,x,S,C,V,L,Z,E){j5e(n,x,S,C,V,L,Z,E)},this._primitive=new Wn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ue.fromCache(c1(!1,!1)),this._rsStencilDepthPass3DTiles=Ue.fromCache(c1(!1,!0)),this._rsColorPass=Ue.fromCache(SK(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ue.fromCache(c1(!0,!1)),this._rsStencilDepthPass3DTiles=Ue.fromCache(c1(!0,!0)),this._rsColorPass=Ue.fromCache(SK(!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))})};T_.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};T_.prototype.isDestroyed=function(){return!1};T_.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,me(this)};var l1=T_;var q5e={u_globeMinimumAltitude:function(){return 55e3}};function Fl(e){e=e??Y.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(l(a)&&l(a.color)){t=new hn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??On.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=ui._defaultMaxTerrainHeight,this._minTerrainHeight=ui._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:q5e}}Object.defineProperties(Fl.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}}});Fl.isSupported=l1.isSupported;function Zce(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Gce(e){return function(t,n){return e._minHeight}}var $5e=new m,eke=new m,tke=new m,nke=new he,ike=new le;function Sk(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let p=m.unpack(i,h,$5e),g=m.unpack(o,h,eke),f=m.add(p,g,tke),y=n.cartesianToCartographic(f,nke),x=y.latitude,S=y.longitude;s=Math.min(s,x),a=Math.min(a,S),c=Math.max(c,x),d=Math.max(d,S)}let u=ike;return u.north=c,u.south=s,u.east=d,u.west=a,u}function oke(e,t,n){let i=ui.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function rke(e,t,n){let i=t.mapProjection.ellipsoid,o=Sk(t,n),r=Xn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=de.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);m.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function CK(e,t){return Math.floor(e%t/2)}function VK(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Ece(e,t,n,i,o,r){let s=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function ske(e,t,n,i,o,r,s,a){let c;t.mode===oe.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let d=e.classificationType,u=d!==On.CESIUM_3D_TILE,h=d!==On.TERRAIN,p=t.passes,g=e._primitive,f,y,x;if(p.render){let S=n.length;for(f=0;f<S;++f)y=c[CK(f,S)],u&&(x=n[f],VK(e,x,t,o,r,y,s)),h&&(x=n[f].derivedCommands.tileset,VK(e,x,t,o,r,y,s));if(t.invertClassification){let C=g._commandsIgnoreShow,V=C.length;for(f=0;f<V;++f)y=c[f],x=C[f],VK(e,x,t,o,r,y,s)}}if(p.pick){let S=i.length,C;for(e._useFragmentCulling||(C=g._primitive._pickOffsets),f=0;f<S;++f){if(y=c[CK(f,S)],!e._useFragmentCulling){let V=C[CK(f,S)];y=c[V.index]}u&&(x=i[f],Ece(e,x,t,o,r,y)),h&&(x=i[f].derivedCommands.tileset,Ece(e,x,t,o,r,y))}}}Fl.initializeTerrainHeights=function(){return ui.initialize()};Fl.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!ui.initialized){Fl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,d=new Array(c),u,h;for(u=0;u<c;++u){o=a[u],r=o.geometry;let y=Sk(e,r);l(h)?l(y)&&le.union(h,y,h):h=le.clone(y);let x=o.id;if(l(x)&&l(y)){let S=ui.getBoundingSphere(y,i);this._boundingSpheresKeys.push(x),this._boundingSpheres.push(S)}s=r.constructor,!l(s)||l(s.createShadowVolume)}oke(this,h,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Zr.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Zr.getHeight(this._maxTerrainHeight,p,g);let f=Fl._supportsMaterials(e.context);if(this._useFragmentCulling=f,f){let y,x=!0;for(u=0;u<c;++u)if(o=a[u],r=o.geometry,h=Sk(e,r),Cd.shouldUseSphericalCoordinates(h)){x=!1;break}for(u=0;u<c;++u){o=a[u],r=o.geometry,s=r.constructor;let S=Sk(e,r),C=r.textureCoordinateRotationPoints;x?y=Cd.getPlanarTextureCoordinateAttributes(S,C,i,e.mapProjection,this._maxHeight):y=Cd.getSphericalExtentGeometryInstanceAttributes(S,C,i,e.mapProjection);let V=o.attributes;for(let L in V)V.hasOwnProperty(L)&&(y[L]=V[L]);d[u]=new Xt({geometry:s.createShadowVolume(r,Gce(this),Zce(this)),attributes:y,id:o.id})}}else for(u=0;u<c;++u)o=a[u],r=o.geometry,s=r.constructor,d[u]=new Xt({geometry:s.createShadowVolume(r,Gce(this),Zce(this)),attributes:o.attributes,id:o.id});n.geometryInstances=d,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,x){rke(t,y,x)},n._updateAndQueueCommandsFunction=function(y,x,S,C,V,L,Z,E){ske(t,x,S,C,V,L,Z,E)},this._primitive=new l1(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))})};Fl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Fl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Fl.prototype.isDestroyed=function(){return!1};Fl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};Fl._supportsMaterials=function(e){return e.depthTexture};Fl.supportsMaterials=function(e){return Fl._supportsMaterials(e.frameState.context)};var $c=Fl;var Ngn=_(T(),1);function d1(){fe.throwInstantiationError()}Object.defineProperties(d1.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});d1.prototype.getType=fe.throwInstantiationError;d1.prototype.getValue=fe.throwInstantiationError;d1.prototype.equals=fe.throwInstantiationError;var ake=new q;d1.getValue=function(e,t,n){let i;return l(e)||(e=q.now(ake)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Ji.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Ji.ColorType)&&(n=Ji.fromType(Ji.ColorType)),D.clone(D.WHITE,n.uniforms.color),n)};var $o=d1;function S_(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}S_.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!J.getValueOrDefault(t.show,n,!0)};S_.prototype._setOptions=fe.throwInstantiationError;S_.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof zt,h,p=t._getIsClosed(c);if(u)h=new hn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=$o.getValue(e,d,this._material);this._material=g,h=new mo({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=hn.VERTEX_FORMAT,this._primitive=o.add(new $c({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),J.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=h.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);u&&(h.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Wn({geometryInstances:g,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let d=this._geometryUpdater.createOutlineGeometryInstance(e),u=J.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Wn({geometryInstances:d,appearance:new hn({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};S_.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))?(de.clone(o.boundingSphere,e),ut.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(de.clone(o.boundingSphere,e),ut.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ut.PENDING:ut.FAILED};S_.prototype.isDestroyed=function(){return!1};S_.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),me(this)};var si=S_;var pCn=_(T(),1);var $Sn=_(T(),1);var uxn=_(T(),1);var tyn=_(T(),1),CX=`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 iyn=_(T(),1),VX=`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 ryn=_(T(),1),LX=`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 ayn=_(T(),1),RX=`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 _yn=_(T(),1);var lyn=_(T(),1),ZX=`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 uyn=_(T(),1),Vd=`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 * 0.5);
|
|
|
}
|
|
|
|
|
|
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 LK=`${Vd}
|
|
|
${ZX}`,cke=y_;Ht.isInternetExplorer()||(LK=`#define CLIP_POLYLINE
|
|
|
${LK}`);function C_(e){e=e??Y.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=C_.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??LK,this._fragmentShaderSource=e.fragmentShaderSource??cke,this._renderState=ao.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(C_.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}}});C_.VERTEX_FORMAT=Xe.POSITION_ONLY;C_.prototype.getFragmentShaderSource=ao.prototype.getFragmentShaderSource;C_.prototype.isTranslucent=ao.prototype.isTranslucent;C_.prototype.getRenderState=ao.prototype.getRenderState;var is=C_;var wyn=_(T(),1);var Syn=_(T(),1),GX=`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 Vyn=_(T(),1),V_=`#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 RK=`${Vd}
|
|
|
${GX}`,lke=V_;Ht.isInternetExplorer()||(RK=`#define CLIP_POLYLINE
|
|
|
${RK}`);function L_(e){e=e??Y.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=L_.VERTEX_FORMAT;this.material=l(e.material)?e.material:Ji.fromType(Ji.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??RK,this._fragmentShaderSource=e.fragmentShaderSource??lke,this._renderState=ao.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(L_.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}}});L_.VERTEX_FORMAT=Xe.POSITION_AND_ST;L_.prototype.getFragmentShaderSource=ao.prototype.getFragmentShaderSource;L_.prototype.isTranslucent=ao.prototype.isTranslucent;L_.prototype.getRenderState=ao.prototype.getRenderState;var ya=L_;function rb(e){e=e??Y.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new ya),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??On.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=Ice(!1),this._renderState3DTiles=Ice(!0),this._renderStateMorph=Ue.fromCache({cull:{enabled:!0,face:Ti.FRONT},depthTest:{enabled:!0},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(rb.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}}});rb.initializeTerrainHeights=function(){return ui.initialize()};function dke(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(RX);s=Wn._appendShowToShader(o,s),s=Wn._appendDistanceDisplayConditionToShader(o,s),s=Wn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(LX);a=Wn._appendShowToShader(o,a),a=Wn._appendDistanceDisplayConditionToShader(o,a),a=Wn._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(CX),d=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],u="",h="";l(n.material)?(h=l(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&d.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",d.push(u);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],g=new De({defines:d,sources:[s]}),f=new De({defines:p,sources:[h,c]});e._sp=nn.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:f,attributeLocations:r});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let S=new De({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:S,fragmentShaderSource:f,attributeLocations:r})}e._sp2D=y;let x=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(x)){let S=new De({defines:d.concat([`MAX_TERRAIN_HEIGHT ${ui._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(VX);let C=new De({defines:p,sources:[h,c]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:S,fragmentShaderSource:C,attributeLocations:r})}e._spMorph=x}function Ice(e){return Ue.fromCache({cull:{enabled:!0},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Bn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Bn.EQUAL,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function uke(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof is?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let h=0;h<a;h++){let p=s._va[h],g=o[h];l(g)||(g=o[h]=new $e({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=u,g.pass=Ge.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let f=$e.shallowClone(g,g.derivedCommands.tileset);f.renderState=e._renderState3DTiles,f.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=f;let y=$e.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let x=$e.shallowClone(f,f.derivedCommands.color2D);x.shaderProgram=e._sp2D,f.derivedCommands.color2D=x;let S=$e.shallowClone(g,g.derivedCommands.colorMorph);S.renderState=e._renderStateMorph,S.shaderProgram=e._spMorph,S.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=S}}function Xce(e,t,n,i,o,r,s){n.mode===oe.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==oe.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function mke(e,t,n,i,o,r,s){let a=e._primitive;Wn._updateBoundingVolumes(a,t,o);let c;t.mode===oe.SCENE3D?c=a._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===oe.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let d=t.mode===oe.MORPHING,u=e.classificationType,h=u!==On.CESIUM_3D_TILE,p=u!==On.TERRAIN&&!d,g,f=t.passes;if(f.render||f.pick&&a.allowPicking){let y=n.length;for(let x=0;x<y;++x){let S=c[x];h&&(g=n[x],Xce(e,g,t,o,r,S,s)),p&&(g=n[x].derivedCommands.tileset,Xce(e,g,t,o,r,S,s))}}}rb.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!ui.initialized){rb.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let d=c.attributes;for(let u in d)d.hasOwnProperty(u)&&(a[u]=d[u]);l(a.width)||(a.width=new uc({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,Jx.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Xt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,d,u){dke(n,d,u)},i._createCommandsFunction=function(c,d,u,h,p,g,f){uke(n,d,u,h,g,f)},i._updateAndQueueCommandsFunction=function(c,d,u,h,p,g,f,y){mke(n,d,u,h,p,g,f)},this._primitive=new Wn(i)}if(this.appearance instanceof is&&!this._hasPerInstanceColors)throw new fe("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))})};rb.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};rb.isSupported=function(e){return e.frameState.context.depthTexture};rb.prototype.isDestroyed=function(){return!1};rb.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,me(this)};var zm=rb;var wxn=_(T(),1);var Gxn=_(T(),1);var Txn=_(T(),1);var hke=new U(1,1),fke=!1,pke=D.WHITE;function u1(e){e=e??Y.EMPTY_OBJECT,this._definitionChanged=new be,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(u1.prototype,{isConstant:{get:function(){return J.isConstant(this._image)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:ue("image"),repeat:ue("repeat"),color:ue("color"),transparent:ue("transparent")});u1.prototype.getType=function(e){return"Image"};var bke=new q;u1.prototype.getValue=function(e,t){return l(e)||(e=q.now(bke)),l(t)||(t={}),t.image=J.getValueOrUndefined(this._image,e),t.repeat=J.getValueOrClonedDefault(this._repeat,e,hke,t.repeat),t.color=J.getValueOrClonedDefault(this._color,e,pke,t.color),J.getValueOrDefault(this._transparent,e,fke)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};u1.prototype.equals=function(e){return this===e||e instanceof u1&&J.equals(this._image,e._image)&&J.equals(this._repeat,e._repeat)&&J.equals(this._color,e._color)&&J.equals(this._transparent,e._transparent)};var Eg=u1;function gke(e){if(e instanceof D)return new zt(e);if(typeof e=="string"||e instanceof Re||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Eg;return t.image=e,t}}function yke(e,t){return ue(e,t,gke)}var Po=yke;function EX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(EX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),dimensions:ue("dimensions"),heightReference:ue("heightReference"),fill:ue("fill"),material:Po("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});EX.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 EX(this)};EX.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 R_=EX;var jxn=_(T(),1);var Oxn=_(T(),1);function m1(){fe.throwInstantiationError()}Object.defineProperties(m1.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError},referenceFrame:{get:fe.throwInstantiationError}});m1.prototype.getValue=fe.throwInstantiationError;m1.prototype.getValueInReferenceFrame=fe.throwInstantiationError;m1.prototype.equals=fe.throwInstantiationError;var Wce=new $;m1.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new m),n===i)return m.clone(t,o);let r=Ft.computeIcrfToCentralBodyFixedMatrix(e,Wce);if(n===Di.INERTIAL)return $.multiplyByVector(r,t,o);if(n===Di.FIXED)return $.multiplyByVector($.transpose(r,Wce),t,o)};var Hm=m1;function Z_(e,t){this._definitionChanged=new be,this._value=m.clone(e),this._referenceFrame=t??Di.FIXED}Object.defineProperties(Z_.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Di.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var xke=new q;Z_.prototype.getValue=function(e,t){return l(e)||(e=q.now(xke)),this.getValueInReferenceFrame(e,Di.FIXED,t)};Z_.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Z_.prototype.getValueInReferenceFrame=function(e,t,n){return Hm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Z_.prototype.equals=function(e){return this===e||e instanceof Z_&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var el=Z_;var o_n=_(T(),1);function IX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(IX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),width:ue("width"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),cornerType:ue("cornerType"),granularity:ue("granularity"),fill:ue("fill"),material:Po("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});IX.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 IX(this)};IX.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 G_=IX;var a_n=_(T(),1);function _ke(e){return e}function Tke(e,t){return ue(e,t,_ke)}var tl=Tke;var f_n=_(T(),1);function XX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(XX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),length:ue("length"),topRadius:ue("topRadius"),bottomRadius:ue("bottomRadius"),heightReference:ue("heightReference"),fill:ue("fill"),material:Po("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),slices:ue("slices"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});XX.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 XX(this)};XX.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 E_=XX;var T_n=_(T(),1);function WX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(WX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),semiMajorAxis:ue("semiMajorAxis"),semiMinorAxis:ue("semiMinorAxis"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),rotation:ue("rotation"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Po("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});WX.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 WX(this)};WX.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 I_=WX;var G_n=_(T(),1);function PX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(PX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),radii:ue("radii"),innerRadii:ue("innerRadii"),minimumClock:ue("minimumClock"),maximumClock:ue("maximumClock"),minimumCone:ue("minimumCone"),maximumCone:ue("maximumCone"),heightReference:ue("heightReference"),fill:ue("fill"),material:Po("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),stackPartitions:ue("stackPartitions"),slicePartitions:ue("slicePartitions"),subdivisions:ue("subdivisions"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});PX.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 PX(this)};PX.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 X_=PX;var v_n=_(T(),1);function vX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(vX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),text:ue("text"),font:ue("font"),style:ue("style"),scale:ue("scale"),showBackground:ue("showBackground"),backgroundColor:ue("backgroundColor"),backgroundPadding:ue("backgroundPadding"),pixelOffset:ue("pixelOffset"),eyeOffset:ue("eyeOffset"),horizontalOrigin:ue("horizontalOrigin"),verticalOrigin:ue("verticalOrigin"),heightReference:ue("heightReference"),fillColor:ue("fillColor"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),translucencyByDistance:ue("translucencyByDistance"),pixelOffsetScaleByDistance:ue("pixelOffsetScaleByDistance"),scaleByDistance:ue("scaleByDistance"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance")});vX.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 vX(this)};vX.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 Km=vX;var rTn=_(T(),1);var O_n=_(T(),1);var ZK=new Vg;function wX(e){e=e??Y.EMPTY_OBJECT,this._definitionChanged=new be,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(wX.prototype,{isConstant:{get:function(){return J.isConstant(this._translation)&&J.isConstant(this._rotation)&&J.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:ue("translation"),rotation:ue("rotation"),scale:ue("scale")});var Ske=new q;wX.prototype.getValue=function(e,t){return l(e)||(e=q.now(Ske)),l(t)||(t=new Vg),t.translation=J.getValueOrClonedDefault(this._translation,e,ZK.translation,t.translation),t.rotation=J.getValueOrClonedDefault(this._rotation,e,ZK.rotation,t.rotation),t.scale=J.getValueOrClonedDefault(this._scale,e,ZK.scale,t.scale),t};wX.prototype.equals=function(e){return this===e||e instanceof wX&&J.equals(this._translation,e._translation)&&J.equals(this._rotation,e._rotation)&&J.equals(this._scale,e._scale)};var W_=wX;var j_n=_(T(),1);function sb(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(sb.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!J.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});sb.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function Cke(e){return new jn(e)}sb.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,ue(e,!0,n??Cke)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};sb.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var Vke=new q;sb.prototype.getValue=function(e,t){l(e)||(e=q.now(Vke)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=J.getValueOrUndefined(this[r],e,t[r])}return t};sb.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function Lke(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!J.equals(e[s],t[s]))return!1}return!0}sb.prototype.equals=function(e){return this===e||e instanceof sb&&Lke(this,e)};var nl=sb;function Pce(e){return new W_(e)}function Rke(e){return new nl(e,Pce)}function Zke(e){return new nl(e)}function Gke(e){return new nl(e)}function FX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(FX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),uri:ue("uri"),scale:ue("scale"),enableVerticalExaggeration:ue("enableVerticalExaggeration"),minimumPixelSize:ue("minimumPixelSize"),maximumScale:ue("maximumScale"),incrementallyLoadTextures:ue("incrementallyLoadTextures"),runAnimations:ue("runAnimations"),clampAnimations:ue("clampAnimations"),shadows:ue("shadows"),heightReference:ue("heightReference"),silhouetteColor:ue("silhouetteColor"),silhouetteSize:ue("silhouetteSize"),color:ue("color"),colorBlendMode:ue("colorBlendMode"),colorBlendAmount:ue("colorBlendAmount"),imageBasedLightingFactor:ue("imageBasedLightingFactor"),environmentMapOptions:ue("environmentMapOptions",void 0,Gke),lightColor:ue("lightColor"),distanceDisplayCondition:ue("distanceDisplayCondition"),nodeTransformations:ue("nodeTransformations",void 0,Rke),articulations:ue("articulations",void 0,Zke),clippingPlanes:ue("clippingPlanes"),customShader:ue("customShader")});FX.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 FX(this)};FX.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 nl(t,Pce)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new nl(n)}};var ab=FX;var uTn=_(T(),1);function AX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(AX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),uri:ue("uri"),maximumScreenSpaceError:ue("maximumScreenSpaceError")});AX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new AX(this)};AX.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var P_=AX;var yTn=_(T(),1);function MX(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??Y.EMPTY_OBJECT)}Object.defineProperties(MX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),leadTime:ue("leadTime"),trailTime:ue("trailTime"),width:ue("width"),resolution:ue("resolution"),material:Po("material"),distanceDisplayCondition:ue("distanceDisplayCondition")});MX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new MX(this)};MX.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var cb=MX;var LTn=_(T(),1);function NX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(NX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),plane:ue("plane"),dimensions:ue("dimensions"),fill:ue("fill"),material:Po("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});NX.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 NX(this)};NX.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 kX=NX;var XTn=_(T(),1);function UX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(UX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),pixelSize:ue("pixelSize"),heightReference:ue("heightReference"),color:ue("color"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),scaleByDistance:ue("scaleByDistance"),translucencyByDistance:ue("translucencyByDistance"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance"),splitDirection:ue("splitDirection")});UX.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 UX(this)};UX.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 v_=UX;var kTn=_(T(),1);function Eke(e){return Array.isArray(e)&&(e=new Na(e)),new jn(e)}function DX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(DX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),hierarchy:ue("hierarchy",void 0,Eke),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Po("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),perPositionHeight:ue("perPositionHeight"),closeTop:ue("closeTop"),closeBottom:ue("closeBottom"),arcType:ue("arcType"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex"),textureCoordinates:ue("textureCoordinates")});DX.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 DX(this)};DX.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 Jm=DX;var HTn=_(T(),1);function OX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(OX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),width:ue("width"),granularity:ue("granularity"),material:Po("material"),depthFailMaterial:Po("depthFailMaterial"),arcType:ue("arcType"),clampToGround:ue("clampToGround"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});OX.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 OX(this)};OX.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 xc=OX;var eSn=_(T(),1);function BX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(BX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),shape:ue("shape"),cornerType:ue("cornerType"),granularity:ue("granularity"),fill:ue("fill"),material:Po("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});BX.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 BX(this)};BX.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 w_=BX;var aSn=_(T(),1);function YX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(YX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),coordinates:ue("coordinates"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),rotation:ue("rotation"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Po("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});YX.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 YX(this)};YX.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 Qm=YX;var fSn=_(T(),1);function zX(e){this._definitionChanged=new be,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??Y.EMPTY_OBJECT)}Object.defineProperties(zX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),minimumHeights:ue("minimumHeights"),maximumHeights:ue("maximumHeights"),granularity:ue("granularity"),fill:ue("fill"),material:Po("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});zX.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 zX(this)};zX.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 lb=zX;var Ike=new he,GK=[];function Xke(e){return new el(e)}function Wke(e){return ue(e,void 0,Xke)}function Qs(e,t){return ue(e,void 0,function(n){return n instanceof t?n:new t(n)})}function wu(e){e=e??Y.EMPTY_OBJECT;let t=e.id;l(t)||(t=Hn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??tb.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",...GK],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 EK(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&EK(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(wu.prototype,{availability:tl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:tl("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&&EK(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:tl("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&&EK(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Qs("billboard",gc),box:Qs("box",R_),corridor:Qs("corridor",G_),cylinder:Qs("cylinder",E_),description:ue("description"),ellipse:Qs("ellipse",I_),ellipsoid:Qs("ellipsoid",X_),label:Qs("label",Km),model:Qs("model",ab),tileset:Qs("tileset",P_),orientation:ue("orientation"),path:Qs("path",cb),plane:Qs("plane",kX),point:Qs("point",v_),polygon:Qs("polygon",Jm),polyline:Qs("polyline",xc),polylineVolume:Qs("polylineVolume",w_),properties:Qs("properties",nl),position:Wke("position"),rectangle:Qs("rectangle",Qm),viewFrom:ue("viewFrom"),wall:Qs("wall",lb)});wu.registerEntityType=function(e,t){Object.defineProperties(wu.prototype,{[e]:Qs(e,t)}),GK.includes(e)||GK.push(e)};wu.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};wu.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,tl(e,!0))};wu.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};wu.prototype.merge=function(e){this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var vce=new $,wce=new m,Fce=new we;wu.prototype.computeModelMatrix=function(e,t){let n=J.getValueOrUndefined(this._position,e,wce);if(!l(n))return;let i=J.getValueOrUndefined(this._orientation,e,Fce);return l(i)?t=F.fromRotationTranslation($.fromQuaternion(i,vce),n,t):t=Ft.eastNorthUpToFixedFrame(n,void 0,t),t};wu.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=J.getValueOrDefault(t,e,Ke.NONE),s=J.getValueOrUndefined(this._position,e,wce);if(r===Ke.NONE||!l(s)||m.equalsEpsilon(s,m.ZERO,X.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,Ike);Pu(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=J.getValueOrUndefined(this._orientation,e,Fce);return l(c)?o=F.fromRotationTranslation($.fromQuaternion(c,vce),s,o):o=Ft.eastNorthUpToFixedFrame(s,void 0,o),o};wu.supportsMaterialsforEntitiesOnTerrain=function(e){return $c.supportsMaterials(e)};wu.supportsPolylinesOnTerrain=function(e){return zm.isSupported(e)};var er=wu;var Pke=new zt(D.WHITE),vke=new jn(!0),wke=new jn(!0),Fke=new jn(!1),Ake=new jn(D.BLACK),Mke=new jn(Cn.DISABLED),Nke=new jn(new At),kke=new jn(On.BOTH);function il(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 be,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=er.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(il.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&J.isConstant(this._showProperty)&&J.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&J.isConstant(this._showProperty)&&J.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});il.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};il.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};il.prototype.createFillGeometryInstance=fe.throwInstantiationError;il.prototype.createOutlineGeometryInstance=fe.throwInstantiationError;il.prototype.isDestroyed=function(){return!1};il.prototype.destroy=function(){me(this)};il.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Oe.MINIMUM_VALUE)};il.prototype._isOnTerrain=function(e,t){return!1};il.prototype._getIsClosed=function(e){return!0};il.prototype._isDynamic=fe.throwInstantiationError;il.prototype._setStaticOptions=fe.throwInstantiationError;il.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(Oe.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(Oe.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let d=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??Pke,this._fillProperty=r??wke,this._showProperty=d??vke,this._showOutlineProperty=o.outline??Fke,this._outlineColorProperty=c?o.outlineColor??Ake:void 0,this._shadowsProperty=o.shadows??Mke,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??Nke,this._classificationTypeProperty=o.classificationType??kke,this._fillEnabled=s;let u=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof zt);if(c&&u&&(Vt(Vt.geometryOutlines),c=!1),this._onTerrain=u,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let h=o.outlineWidth;this._outlineWidth=l(h)?h.getValue(Oe.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};il.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ai=il;var MCn=_(T(),1);var _Cn=_(T(),1);function h1(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(h1.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var Uke=new q;h1.prototype.getValue=function(e,t){return l(e)||(e=q.now(Uke)),this._callback(e,t)};h1.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};h1.prototype.equals=function(e){return this===e||e instanceof h1&&this._callback===e._callback&&this._isConstant===e._isConstant};var jm=h1;var WCn=_(T(),1);var Ace=new m;function f1(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new m,this._cartographicPosition=new he,this._normal=new m,this._definitionChanged=new be,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(Oe.MINIMUM_VALUE,Ace);if(!l(r)||m.equals(r,m.ZERO)||!l(e.globe))return;this._position=m.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(f1.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});f1.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(m.equals(t,m.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var Dke=new q;f1.prototype.getValue=function(e,t){l(e)||(e=q.now(Dke));let n=J.getValueOrDefault(this._heightReference,e,Ke.NONE),i=J.getValueOrDefault(this._extrudedHeightReference,e,Ke.NONE);if(n===Ke.NONE&&!o1(i))return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Ace);if(!l(r)||m.equals(r,m.ZERO)||!l(o.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,r,X.EPSILON10))return m.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=m.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return m.multiplyByScalar(s,this._terrainHeight,t)};f1.prototype.isDestroyed=function(){return!1};f1.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),me(this)};var F_=f1;function Oke(e,t,n,i){if(ai.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new jm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new F_(this._scene,s,r)}}var db=Oke;var Mce=m.ZERO,Nce=new m,Bke=new m,kce=new D;function Yke(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Ld(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new Yke(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Ld.prototype=Object.create(ai.prototype),Ld.prototype.constructor=Ld);Object.defineProperties(Ld.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Ld.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Dn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof zt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,kce)),l(a)||(a=D.WHITE),s.color=Kt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Mce,Nce))),new Xt({id:t,geometry:va.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Ld.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,kce),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Mce,Nce))),new Xt({id:t,geometry:vm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Ld.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Ld.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ai.prototype._isHidden.call(this,e,t)};Ld.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.dimensions.isConstant||!J.isConstant(t.outlineWidth)};Ld.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Oe.MINIMUM_VALUE,Ke.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof zt?hn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Oe.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Ke.NONE?ln.ALL:void 0};Ld.prototype._onEntityPropertyChanged=db;Ld.DynamicGeometryUpdater=p1;function p1(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(p1.prototype=Object.create(si.prototype),p1.prototype.constructor=p1);p1.prototype._isHidden=function(e,t,n){let i=J.getValueOrUndefined(e.position,n,Bke),o=this._options.dimensions;return!l(i)||!l(o)||si.prototype._isHidden.call(this,e,t,n)};p1.prototype._setOptions=function(e,t,n){let i=J.getValueOrDefault(t.heightReference,n,Ke.NONE),o=this._options;o.dimensions=J.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Ke.NONE?ln.ALL:void 0};var HX=Ld;var h1n=_(T(),1);function A_(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Di.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(A_.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var zke=new q;A_.prototype.getValue=function(e,t){return l(e)||(e=q.now(zke)),this.getValueInReferenceFrame(e,Di.FIXED,t)};A_.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};A_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Hm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};A_.prototype.equals=function(e){return this===e||e instanceof A_&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var KX=A_;var Poi=_(T(),1);var Soi=_(T(),1);var X1n=_(T(),1);var V1n=_(T(),1);function M_(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 be}Object.defineProperties(M_.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}}});M_.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function IK(e){e._cubeMapBuffers=void 0}M_.prototype.update=function(e){let{context:t}=e;if(!M_.isSupported(t))return;if(l(this._texture)){IK(this);return}if(!l(this._texture)&&!this._loading){let u=t.textureCache.getTexture(this._url);l(u)&&(IK(this),this._texture=u,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let u=this;Ll(this._url).then(function(h){u._cubeMapBuffers=h,u._loading=!1}).catch(function(h){u.isDestroyed()||u._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT);let o=ot.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let u={};Object.values(Lr.FaceName).forEach(h=>{u[h]=void 0});for(let h=r;h<a;h++)n.push(u)}let c=new tn({minificationFilter:en.LINEAR_MIPMAP_LINEAR}),d=new Lr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});d.loadMipmaps(n.slice(1)),this._texture=d,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};M_.prototype.isDestroyed=function(){return!1};M_.prototype.destroy=function(){return IK(this),this._texture=this._texture&&this._texture.destroy(),me(this)};var qm=M_;function JX(e){e=e??Y.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?U.clone(e.imageBasedLightingFactor):new U(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._previousImageBasedLightingFactor=U.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(JX.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=U.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 Hke(e,t){if(qm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new qm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}JX.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;U.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=U.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&&(Hke(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};JX.prototype.isDestroyed=function(){return!1};JX.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),me(this)};var N_=JX;var w1n=_(T(),1);var ub={X:0,Y:1,Z:2};ub.Y_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));ub.Z_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));ub.X_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));ub.Z_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));ub.X_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));ub.Y_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));ub.fromName=function(e){return ub[e]};var vo=Object.freeze(ub);var Dti=_(T(),1);var M1n=_(T(),1);function Uce(e){e=e??Y.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(Uce.prototype,{metadata:{get:function(){return this._metadata}}});var k_=Uce;var Mqn=_(T(),1);var Y1n=_(T(),1);function Fu(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(Fu.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 QX=Uint32Array.BYTES_PER_ELEMENT;Fu.fromTileType=async function(e,t,n,i,o,r){o=o??0;let s=new Uint8Array(i),a=new DataView(i);o+=QX;let c=a.getUint32(o,!0);if(c!==1)throw new ce(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=QX,o+=QX;let d=a.getUint32(o,!0);o+=QX;let u=n.queryParameters.compositeIndex;l(u)?u=`${u}_`:u="";let h=[];h.length=d;for(let f=0;f<d;++f){let y=Dm(s,o),x=a.getUint32(o+QX*2,!0),S=r[y],C=`${u}${f}`,V=n.getDerivedResource({queryParameters:{compositeIndex:C}});if(l(S))h[f]=Promise.resolve(S(e,t,V,i,o));else throw new ce(`Unknown tile content type, ${y}, inside Composite tile`);o+=x}let p=await Promise.all(h);return new Fu(e,t,n,p)};Fu.prototype.hasProperty=function(e,t){return!1};Fu.prototype.getFeature=function(e){};Fu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Fu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Fu.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)};Fu.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let d=m.distance(e.origin,c);d<o&&(i=c,o=d)}if(l(i))return n};Fu.prototype.isDestroyed=function(){return!1};Fu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var jX=Fu;var gRn=_(T(),1);var JVn=_(T(),1);var oVn=_(T(),1);function _c(e){this._id=Hn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,Dt.maximumTextureSize),r=Math.ceil(t/Dt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new U(o,r),i=new re(s,a,c,d)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(_c.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}}});_c.DEFAULT_COLOR_VALUE=D.WHITE;_c.DEFAULT_SHOW_VALUE=!0;function Dce(e){let t=e._textureDimensions;return t.x*t.y*4}function Oce(e){if(!l(e._batchValues)){let t=Dce(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Bce(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}_c.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Bce(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Oce(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};_c.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};_c.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var Kke=new Array(4);_c.prototype.setColor=function(e,t){if(D.equals(t,_c.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(Kke),i=n[3],o=Oce(this),r=e*4,s=Bce(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,d=s[a]!==0;o[r+3]=d?i:0,s[a+1]=i;let u=i!==255;u&&!c?++this._translucentFeaturesLength:!u&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};_c.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};_c.prototype.getColor=function(e,t){if(!l(this._batchValues))return D.clone(_c.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return D.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};_c.prototype.getPickColor=function(e){return this._pickIds[e]};function Yce(e,t,n){let i=e._textureDimensions;return new vt({context:t,pixelFormat:ot.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:tn.NEAREST})}function Jke(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=Dce(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let d=t.createPickId(s.getFeature(c));i.push(d);let u=d.color,h=c*4;r[h]=D.floatToByte(u.red),r[h+1]=D.floatToByte(u.green),r[h+2]=D.floatToByte(u.blue),r[h+3]=D.floatToByte(u.alpha)}e._pickTexture=Yce(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function Qke(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}_c.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&Jke(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Yce(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),Qke(this))};_c.prototype.isDestroyed=function(){return!1};_c.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 me(this)};var ol=_c;var SVn=_(T(),1);var hVn=_(T(),1);var jke={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},qke={SCALAR:void 0,VEC2:U,VEC3:m,VEC4:re,MAT2:Xi,MAT3:$,MAT4:F};function $ke(e){let t=e.componentType,n;typeof t=="string"?n=Q.fromName(t):n=t;let i=jke[e.type],o=qke[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return Q.createArrayBufferView(n,r,s,i*a)}}}var Rd=$ke;function mb(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,eUe(this,e.extension,e.binaryBody)}Object.defineProperties(mb.prototype,{byteLength:{get:function(){return this._byteLength}}});function eUe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,d=t.parentCounts,u=t.parentIds,h=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??Q.UNSIGNED_SHORT,c.type=an.SCALAR,r=Rd(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(d)){for(l(d.byteOffset)&&(d.componentType=d.componentType??Q.UNSIGNED_SHORT,d.type=an.SCALAR,r=Rd(d),d=r.createArrayBufferView(n.buffer,n.byteOffset+d.byteOffset,s),p+=d.byteLength),g=new Uint16Array(s),h=0,i=0;i<s;++i)g[i]=h,h+=d[i];p+=g.byteLength}l(u)&&l(u.byteOffset)&&(u.componentType=u.componentType??Q.UNSIGNED_SHORT,u.type=an.SCALAR,r=Rd(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,h),p+=u.byteLength);let f=a.length;for(i=0;i<f;++i){let S=a[i].length,C=a[i].instances,V=tUe(S,C,n);p+=nUe(V),a[i].instances=Rt(V,C)}let y=new Array(f).fill(0),x=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],x[i]=y[o],++y[o];p+=x.byteLength,e._classes=a,e._classIds=c,e._classIndexes=x,e._parentCounts=d,e._parentIndexes=g,e._parentIds=u,e._byteLength=p}function tUe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new ce("componentType is required.");if(!l(c))throw new ce("type is required.");if(!l(n))throw new ce(`Property ${o} requires a batch table binary.`);let d=Rd(r),u=d.componentsPerAttribute,h=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:h}}}return i}function nUe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var iUe=[],oUe=[],rUe=0;function sUe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=iUe;c.length=Math.max(c.length,a);let d=++rUe,u=oUe;for(u.length=0,u.push(t);u.length>0;){if(t=u.pop(),c[t]===d)continue;c[t]=d;let h=n(e,t);if(l(h))return h;let p=o[t],g=s[t];for(let f=0;f<p;++f){let y=r[g+f];y!==t&&u.push(y)}}}function aUe(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 qX(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return sUe(e,t,n)}else return n(e,t);return aUe(e,t,n)}mb.prototype.hasProperty=function(e,t){let n=qX(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};mb.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};mb.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,qX(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};mb.prototype.getProperty=function(e,t){return qX(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(l(a))return l(a.typedArray)?cUe(a,s):Be(a[s],!0)})};function cUe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}mb.prototype.setProperty=function(e,t,n){let i=qX(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],d=a.instances[t];if(l(d))return l(d.typedArray)?lUe(d,c,n):d[c]=Be(n,!0),!0});return l(i)};function lUe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}mb.prototype.isClass=function(e,t){let n=qX(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};mb.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var U_=mb;var VVn=_(T(),1),dUe={HIGHLIGHT:0,REPLACE:1,MIX:2},Al=Object.freeze(dUe);var XK=ol.DEFAULT_COLOR_VALUE,WK=ol.DEFAULT_SHOW_VALUE;function Vo(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=r??{};let s=uUe(n);this._properties=s,this._batchTableHierarchy=mUe(this,n,i);let a=Hce(t,s,i);this._binaryPropertiesByteLength=hUe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new ol({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}Vo._deprecationWarning=Is;Object.defineProperties(Vo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function uUe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Be(e[n],!0));return t}function mUe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(Vo._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 U_({extension:i,binaryBody:n})}function Hce(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new ce("componentType is required.");if(!l(c))throw new ce("type is required.");if(!l(n))throw new ce(`Property ${o} requires a batch table binary.`);let d=Rd(r),u=d.componentsPerAttribute,h=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:h}}}return i}function hUe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Vo.getBinaryProperties=function(e,t,n){return Hce(e,t,n)};Vo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Vo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Vo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Vo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Vo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Vo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Vo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var fUe=new D;Vo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(XK),this.setAllShow(WK);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,fUe)??XK:XK,s=l(e.show)?e.show.evaluate(o)??WK:WK;this.setColor(i,r),this.setShow(i,s)}};function pUe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function bUe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Vo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Vo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Vo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Vo.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Vo.prototype.hasPropertyBySemantic=function(){return!1};Vo.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};Vo.prototype.getPropertyBySemantic=function(e,t){};Vo.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return pUe(i,e)}let n=this._properties[t];if(l(n))return Be(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Vo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){bUe(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]=Be(n,!0)};function gUe(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));
|
|
|
}
|
|
|
`}Vo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Kce(o,n,!1),s;return Dt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand;
|
|
|
`),s+=`uniform sampler2D tile_batchTexture;
|
|
|
out vec4 tile_featureColor;
|
|
|
out vec2 tile_featureSt;
|
|
|
void main()
|
|
|
{
|
|
|
vec2 st = computeSt(${t});
|
|
|
vec4 featureProperties = texture(tile_batchTexture, st);
|
|
|
tile_color(featureProperties);
|
|
|
float show = ceil(featureProperties.a);
|
|
|
gl_Position *= show;
|
|
|
`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
|
|
|
if (czm_pass == czm_passTranslucent)
|
|
|
{
|
|
|
if (!isStyleTranslucent && !tile_translucentCommand)
|
|
|
{
|
|
|
gl_Position *= 0.0;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (isStyleTranslucent)
|
|
|
{
|
|
|
gl_Position *= 0.0;
|
|
|
}
|
|
|
}
|
|
|
`),s+=` tile_featureColor = featureProperties;
|
|
|
tile_featureSt = st;
|
|
|
}`):s=`out vec2 tile_featureSt;
|
|
|
void main()
|
|
|
{
|
|
|
tile_color(vec4(1.0));
|
|
|
tile_featureSt = computeSt(${t});
|
|
|
}`,`${r}
|
|
|
${gUe(i)}${s}`}};function zce(e,t){return e=De.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 yUe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d<e.length;++d){let u=e.charAt(d);if(u==="(")++s;else if(u===")"&&(--s,s===0)){r=d+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function Kce(e,t,n){if(!l(t))return zce(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return zce(e,n);let r=o[0],s=o[2];e=De.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color)
|
|
|
{
|
|
|
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
|
|
|
}
|
|
|
vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse)
|
|
|
{
|
|
|
vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend);
|
|
|
vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse;
|
|
|
return vec4(diffuse.rgb, sourceDiffuse.a);
|
|
|
}
|
|
|
`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor);
|
|
|
out_FragColor.a *= tile_featureColor.a;
|
|
|
float highlight = ceil(tile_colorBlend);
|
|
|
out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
|
|
|
`,d;if(s==="vec3"||s==="vec4"){let u=s==="vec3"?`vec4(${t}, 1.0)`:t,h=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,h),d=` vec4 source = ${u};
|
|
|
tile_diffuse = tile_diffuse_final(source, tile_featureColor);
|
|
|
tile_main();
|
|
|
`}else s==="sampler2D"&&(e=yUe(e,t),d=` tile_diffuse = tile_featureColor;
|
|
|
tile_main();
|
|
|
`);return e=`uniform float tile_colorBlend;
|
|
|
vec4 tile_diffuse = vec4(1.0);
|
|
|
${a}${r}
|
|
|
${e}
|
|
|
void tile_color(vec4 tile_featureColor)
|
|
|
{
|
|
|
${d}`,n&&(e+=c),e+=`}
|
|
|
`,e}Vo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Kce(i,t,!0),Dt.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 xUe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Al.HIGHLIGHT)return 0;if(n===Al.REPLACE)return 1;if(n===Al.MIX)return X.clamp(i,X.EPSILON4,1)}Vo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Rt(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return xUe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Vo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Ig={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Vo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=_Ue(this);for(let d=t;d<i;++d){let u=n[d];if(u.pass===Ge.COMPUTE)continue;let h=u.derivedCommands.tileset;(!l(h)||u.dirty)&&(h={},u.derivedCommands.tileset=h,h.originalCommand=TUe(u),u.dirty=!1);let p=h.originalCommand;c!==Ig.ALL_OPAQUE&&u.pass!==Ge.TRANSLUCENT&&(l(h.translucent)||(h.translucent=SUe(p))),c!==Ig.ALL_TRANSLUCENT&&u.pass!==Ge.TRANSLUCENT&&(l(h.opaque)||(h.opaque=CUe(p)),a&&(r||(l(h.zback)||(h.zback=LUe(e.context,p)),s._backfaceCommands.push(h.zback)),(!l(h.stencil)||o._selectionDepth!==ZUe(h.stencil))&&(u.renderState.depthMask?h.stencil=RUe(p,o._selectionDepth):h.stencil=h.opaque)));let g=a?h.stencil:h.opaque,f=h.translucent;u.pass!==Ge.TRANSLUCENT?(c===Ig.ALL_OPAQUE&&(n[d]=g),c===Ig.ALL_TRANSLUCENT&&(n[d]=f),c===Ig.OPAQUE_AND_TRANSLUCENT&&(n[d]=g,n.push(f))):n[d]=p}};function _Ue(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?Ig.ALL_OPAQUE:t===e.featuresLength?Ig.ALL_TRANSLUCENT:Ig.OPAQUE_AND_TRANSLUCENT}function TUe(e){let t=$e.shallowClone(e),n=t.pass===Ge.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function SUe(e){let t=$e.shallowClone(e);return t.pass=Ge.TRANSLUCENT,t.renderState=GUe(e.renderState),t}function CUe(e){let t=$e.shallowClone(e);return t.renderState=EUe(e.renderState),t}function VUe(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 LUe(e,t){let n=$e.shallowClone(t),i=Be(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Ti.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=Ue.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Be(t.uniformMap);let o=new U(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=VUe(e,t.shaderProgram),n}function RUe(e,t){let n=$e.shallowClone(e),i=Be(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=Bn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=pt.REPLACE,i.stencilTest.backFunction=Bn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=pt.REPLACE,i.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,n.renderState=Ue.fromCache(i),n}function ZUe(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function GUe(e){let t=Be(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=fn.ALPHA_BLEND,t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}function EUe(e){let t=Be(e,!0);return t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}Vo.prototype.update=function(e,t){this._batchTexture.update(e,t)};Vo.prototype.isDestroyed=function(){return!1};Vo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var hb=Vo;var aRn=_(T(),1);var jVn=_(T(),1);function IUe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Cf=IUe;var JLn=_(T(),1);var $Vn=_(T(),1),b1=`in vec3 position;
|
|
|
in float a_batchId;
|
|
|
|
|
|
uniform mat4 u_modifiedModelViewProjection;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
|
|
|
}
|
|
|
`;var iLn=_(T(),1);function Au(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Au.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new D),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Au.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Au.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Au.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Au.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let d=e.tileset.metadata;if(l(d)){if(d.hasPropertyBySemantic(n))return d.getPropertyBySemantic(n);if(d.hasProperty(n))return d.getProperty(n)}};Au.prototype.getPropertyInherited=function(e){return Au.getPropertyInherited(this._content,this._batchId,e)};Au.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Au.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Au.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Au.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var js=Au;var xLn=_(T(),1);var sLn=_(T(),1),PK=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)})}},vK=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)})}},Ml=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,d;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},d=n;let u=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+d),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=`
|
|
|
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},XUe=new PK;Object.assign(Ml,{hooks:XUe,plugins:new vK(Ml),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Ml.max_unop_len=Ml.getMaxKeyLen(Ml.unary_ops);Ml.max_binop_len=Ml.getMaxKeyLen(Ml.binary_ops);var Xg=e=>new Ml(e).parse(),WUe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Ml).filter(e=>!WUe.includes(e)&&Xg[e]===void 0).forEach(e=>{Xg[e]=Ml[e]});Xg.Jsep=Ml;var PUe="ConditionalExpression",vUe={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:PUe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};Xg.plugins.register(vUe);var cLn=_(T(),1),wUe={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},xt=Object.freeze(wUe);function $m(e,t){this._expression=e,e=KUe(e,t),e=QUe(JUe(e)),Xg.addBinaryOp("=~",0),Xg.addBinaryOp("!~",0);let n;try{n=Xg(e)}catch(i){throw new ce(i)}this._runtimeAst=Vi(this,n)}Object.defineProperties($m.prototype,{expression:{get:function(){return this._expression}}});var wn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new U],cartesian3Array:[new m],cartesian4Array:[new re],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 U),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new re),this.cartesian4Array[this.cartesian4Index++]}};$m.prototype.evaluate=function(e,t){wn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof D&&n instanceof re?D.fromCartesian4(n,t):n instanceof U||n instanceof m||n instanceof re?n.clone(t):n};$m.prototype.evaluateColor=function(e,t){wn.reset();let n=this._runtimeAst.evaluate(e);return D.fromCartesian4(n,t)};$m.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
|
|
|
{
|
|
|
return ${o};
|
|
|
}
|
|
|
`,o};$m.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};$m.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var FUe=["!","-","+"],Jce=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],$X=/\${(.*?)}/g,AUe=/\\/g,MUe="@#%",NUe=/@#%/g,Lk=new D,Rk={abs:qs(Math.abs),sqrt:qs(Math.sqrt),cos:qs(Math.cos),sin:qs(Math.sin),tan:qs(Math.tan),acos:qs(Math.acos),asin:qs(Math.asin),atan:qs(Math.atan),radians:qs(X.toRadians),degrees:qs(X.toDegrees),sign:qs(X.sign),floor:qs(Math.floor),ceil:qs(Math.ceil),round:qs(Math.round),exp:qs(Math.exp),exp2:qs(UUe),log:qs(Math.log),log2:qs(DUe),fract:qs(kUe),length:OUe,normalize:BUe},Zk={atan2:Ck(Math.atan2,!1),pow:Ck(Math.pow,!1),min:Ck(Math.min,!0),max:Ck(Math.max,!0),distance:YUe,dot:zUe,cross:HUe},AK={clamp:Qce(X.clamp,!0),mix:Qce(X.lerp,!0)};function kUe(e){return e-Math.floor(e)}function UUe(e){return Math.pow(2,e)}function DUe(e){return X.log2(e)}function qs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof U)return U.fromElements(e(n.x),e(n.y),wn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),wn.getCartesian3());if(n instanceof re)return re.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),wn.getCartesian4());throw new ce(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function Ck(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof U)return U.fromElements(e(i.x,o),e(i.y,o),wn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),wn.getCartesian3());if(i instanceof re)return re.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),wn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof U&&o instanceof U)return U.fromElements(e(i.x,o.x),e(i.y,o.y),wn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),wn.getCartesian3());if(i instanceof re&&o instanceof re)return re.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),wn.getCartesian4());throw new ce(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Qce(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 U&&o instanceof U)return U.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),wn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),wn.getCartesian3());if(i instanceof re&&o instanceof re)return re.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),wn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof U&&o instanceof U&&r instanceof U)return U.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),wn.getCartesian2());if(i instanceof m&&o instanceof m&&r instanceof m)return m.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),wn.getCartesian3());if(i instanceof re&&o instanceof re&&r instanceof re)return re.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),wn.getCartesian4());throw new ce(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function OUe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof U)return U.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof re)return re.magnitude(t);throw new ce(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function BUe(e,t){if(typeof t=="number")return 1;if(t instanceof U)return U.normalize(t,wn.getCartesian2());if(t instanceof m)return m.normalize(t,wn.getCartesian3());if(t instanceof re)return re.normalize(t,wn.getCartesian4());throw new ce(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function YUe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof U&&n instanceof U)return U.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof re&&n instanceof re)return re.distance(t,n);throw new ce(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function zUe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof U&&n instanceof U)return U.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof re&&n instanceof re)return re.dot(t,n);throw new ce(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function HUe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,wn.getCartesian3());throw new ce(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Et(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,sDe(this)}function KUe(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 JUe(e){return e.replace(AUe,MUe)}function FK(e){return e.replace(NUe,"\\")}function QUe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new ce("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function jUe(e){let t=typeof e.value;if(e.value===null)return new Et(xt.LITERAL_NULL,null);if(t==="boolean")return new Et(xt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Et(xt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Et(xt.VARIABLE_IN_STRING,e.value):new Et(xt.LITERAL_STRING,FK(e.value))}function qUe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new ce(`${o} is not a function.`);return i===0?o==="test"?new Et(xt.LITERAL_BOOLEAN,!1):new Et(xt.LITERAL_NULL,null):(s=Vi(e,c),a=Vi(e,n[0]),new Et(xt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Vi(e,c),new Et(xt.FUNCTION_CALL,o,r);throw new ce(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Et(xt.LITERAL_COLOR,o);if(r=Vi(e,n[0]),l(n[1])){let c=Vi(e,n[1]);return new Et(xt.LITERAL_COLOR,o,[r,c])}return new Et(xt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ce(`${o} requires three arguments.`);return r=[Vi(e,n[0]),Vi(e,n[1]),Vi(e,n[2])],new Et(xt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ce(`${o} requires four arguments.`);return r=[Vi(e,n[0]),Vi(e,n[1]),Vi(e,n[2]),Vi(e,n[3])],new Et(xt.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]=Vi(e,n[c]);return new Et(xt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Et(xt.LITERAL_BOOLEAN,!0):new Et(xt.LITERAL_BOOLEAN,!1):(r=Vi(e,n[0]),new Et(xt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new ce(`${o} requires exactly one argument.`);return r=Vi(e,n[0]),new Et(xt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ce(`${o} does not take any argument.`);return new Et(xt.UNARY,o)}else if(l(Rk[o])){if(i!==1)throw new ce(`${o} requires exactly one argument.`);return r=Vi(e,n[0]),new Et(xt.UNARY,o,r)}else if(l(Zk[o])){if(i!==2)throw new ce(`${o} requires exactly two arguments.`);return s=Vi(e,n[0]),a=Vi(e,n[1]),new Et(xt.BINARY,o,s,a)}else if(l(AK[o])){if(i!==3)throw new ce(`${o} requires exactly three arguments.`);s=Vi(e,n[0]),a=Vi(e,n[1]);let c=Vi(e,n[2]);return new Et(xt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Et(xt.LITERAL_BOOLEAN,!1):(r=Vi(e,n[0]),new Et(xt.UNARY,o,r));if(o==="Number")return i===0?new Et(xt.LITERAL_NUMBER,0):(r=Vi(e,n[0]),new Et(xt.UNARY,o,r));if(o==="String")return i===0?new Et(xt.LITERAL_STRING,""):(r=Vi(e,n[0]),new Et(xt.UNARY,o,r));if(o==="regExp")return $Ue(e,t)}}throw new ce(`Unexpected function call "${o}".`)}function $Ue(e,t){let n=t.arguments;if(n.length===0)return new Et(xt.LITERAL_REGEX,new RegExp);let i=Vi(e,n[0]),o;if(n.length>1){let r=Vi(e,n[1]);if(wK(i)&&wK(r)){try{o=new RegExp(FK(String(i._value)),r._value)}catch(s){throw new ce(s)}return new Et(xt.LITERAL_REGEX,o)}return new Et(xt.REGEX,i,r)}if(wK(i)){try{o=new RegExp(FK(String(i._value)))}catch(r){throw new ce(r)}return new Et(xt.LITERAL_REGEX,o)}return new Et(xt.REGEX,i)}function eDe(e){if(oDe(e.name)){let t=rDe(e.name);return t.substr(0,8)==="tiles3d_"?new Et(xt.BUILTIN_VARIABLE,t):new Et(xt.VARIABLE,t)}else{if(e.name==="NaN")return new Et(xt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Et(xt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Et(xt.LITERAL_UNDEFINED,void 0)}throw new ce(`${e.name} is not defined.`)}function tDe(e){let t=e.property.name;if(t==="PI")return new Et(xt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Et(xt.LITERAL_NUMBER,Math.E)}function nDe(e){if(e.property.name==="POSITIVE_INFINITY")return new Et(xt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function iDe(e,t){if(t.object.name==="Math")return tDe(t);if(t.object.name==="Number")return nDe(t);let n,i=Vi(e,t.object);return t.computed?(n=Vi(e,t.property),new Et(xt.MEMBER,"brackets",i,n)):(n=new Et(xt.LITERAL_STRING,t.property.name),new Et(xt.MEMBER,"dot",i,n))}function wK(e){return e._type>=xt.LITERAL_NULL}function oDe(e){return e.substr(0,4)==="czm_"}function rDe(e){return e.substr(4)}function Vi(e,t){let n,i,o,r;if(t.type==="Literal")n=jUe(t);else if(t.type==="CallExpression")n=qUe(e,t);else if(t.type==="Identifier")n=eDe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Vi(e,t.argument);if(FUe.indexOf(i)>-1)n=new Et(xt.UNARY,i,s);else throw new ce(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Vi(e,t.left),r=Vi(e,t.right),Jce.indexOf(i)>-1)n=new Et(xt.BINARY,i,o,r);else throw new ce(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Vi(e,t.left),r=Vi(e,t.right),Jce.indexOf(i)>-1&&(n=new Et(xt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Vi(e,t.test);o=Vi(e,t.consequent),r=Vi(e,t.alternate),n=new Et(xt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=iDe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Vi(e,t.elements[a]);n=new Et(xt.ARRAY,s)}else throw t.type==="Compound"?new ce("Provide exactly one expression."):new ce("Cannot parse expression.");return n}function sDe(e){e._type===xt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===xt.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===xt.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(Rk[e._value])&&(e.evaluate=cDe(e._value)):e._type===xt.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(Zk[e._value])&&(e.evaluate=lDe(e._value)):e._type===xt.TERNARY?e.evaluate=dDe(e._value):e._type===xt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===xt.ARRAY?e.evaluate=e._evaluateArray:e._type===xt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===xt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===xt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===xt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===xt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===xt.REGEX?e.evaluate=e._evaluateRegExp:e._type===xt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=aDe):e.evaluate=e._evaluateLiteral}function aDe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function cDe(e){let t=Rk[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function lDe(e){let t=Zk[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function dDe(e){let t=AK[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 Gk(e,t){if(l(e))return e.getPropertyInherited(t)}Et.prototype._evaluateLiteral=function(){return this._value};Et.prototype._evaluateLiteralColor=function(e){let t=Lk,n=this._left;if(this._value==="color")l(n)?n.length>1?(D.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):D.fromCssColorString(n[0].evaluate(e),t):D.fromBytes(255,255,255,255,t);else if(this._value==="rgb")D.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;D.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?D.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&D.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return re.fromColor(t,wn.getCartesian4())};Et.prototype._evaluateLiteralVector=function(e){let t=wn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof U)t.push(c.x,c.y);else if(c instanceof m)t.push(c.x,c.y,c.z);else if(c instanceof re)t.push(c.x,c.y,c.z,c.w);else throw new ce(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new ce(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new ce(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ce(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return U.fromArray(t,0,wn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,wn.getCartesian3());if(n==="vec4")return re.fromArray(t,0,wn.getCartesian4())};Et.prototype._evaluateLiteralString=function(){return this._value};Et.prototype._evaluateVariableString=function(e){let t=this._value,n=$X.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=Gk(e,o);l(r)||(r=""),t=t.replace(i,r),$X.lastIndex+=r.length-i.length,n=$X.exec(t)}return t};Et.prototype._evaluateVariable=function(e){return Gk(e,this._value)};function D_(e){return e._value==="feature"}Et.prototype._evaluateMemberDot=function(e){if(D_(this._left))return Gk(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof m||t instanceof re){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]};Et.prototype._evaluateMemberBrackets=function(e){if(D_(this._left))return Gk(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof m||t instanceof re){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]};Et.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Et.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ce(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Et.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof U)return U.negate(t,wn.getCartesian2());if(t instanceof m)return m.negate(t,wn.getCartesian3());if(t instanceof re)return re.negate(t,wn.getCartesian4());if(typeof t=="number")return-t;throw new ce(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Et.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof U||t instanceof m||t instanceof re||typeof t=="number"))throw new ce(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Et.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ce(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Et.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ce(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Et.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ce(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Et.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ce(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Et.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ce(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ce(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Et.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ce(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ce(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Et.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.add(t,n,wn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,wn.getCartesian3());if(n instanceof re&&t instanceof re)return re.add(t,n,wn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ce(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Et.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.subtract(t,n,wn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,wn.getCartesian3());if(n instanceof re&&t instanceof re)return re.subtract(t,n,wn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ce(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Et.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.multiplyComponents(t,n,wn.getCartesian2());if(n instanceof U&&typeof t=="number")return U.multiplyByScalar(n,t,wn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.multiplyByScalar(t,n,wn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,wn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,wn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,wn.getCartesian3());if(n instanceof re&&t instanceof re)return re.multiplyComponents(t,n,wn.getCartesian4());if(n instanceof re&&typeof t=="number")return re.multiplyByScalar(n,t,wn.getCartesian4());if(t instanceof re&&typeof n=="number")return re.multiplyByScalar(t,n,wn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ce(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Et.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.divideComponents(t,n,wn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.divideByScalar(t,n,wn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,wn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,wn.getCartesian3());if(n instanceof re&&t instanceof re)return re.divideComponents(t,n,wn.getCartesian4());if(t instanceof re&&typeof n=="number")return re.divideByScalar(t,n,wn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ce(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Et.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.fromElements(t.x%n.x,t.y%n.y,wn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,wn.getCartesian3());if(n instanceof re&&t instanceof re)return re.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,wn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ce(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Et.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof m&&t instanceof m||n instanceof re&&t instanceof re?t.equals(n):t===n};Et.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof m&&t instanceof m||n instanceof re&&t instanceof re?!t.equals(n):t!==n};Et.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ce(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Et.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Et.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Et.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Et.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Et.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Et.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Et.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Et.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Et.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 ce(o)}return i};Et.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ce(`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)};Et.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 ce(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Et.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 ce(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Et.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ce(`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};Et.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof U||t instanceof m||t instanceof re)return String(t);throw new ce(`Unexpected function call "${this._value}".`)};function jce(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==xt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return D.fromHsl(i,o,r,s,Lk)}function qce(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==xt.LITERAL_NUMBER)return;let i=Lk;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 Wg(e){return e%1===0?e.toFixed(1):e.toString()}function uDe(e){let t=Wg(e.red),n=Wg(e.green),i=Wg(e.blue);return`vec3(${t}, ${n}, ${i})`}function Vk(e){let t=Wg(e.red),n=Wg(e.green),i=Wg(e.blue),o=Wg(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function $ce(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function ele(e,t){return l(t[e])?t[e]:$m.NULL_SENTINEL}$m.NULL_SENTINEL="czm_infinity";Et.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=$ce(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=$ce(this._value,e,t,this));let d,u,h;switch(a){case xt.VARIABLE:return D_(this)?void 0:ele(c,e);case xt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(Rk[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 ce(`Error generating style shader: "${c}" is not supported.`);return c+o;case xt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(Zk[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case xt.TERNARY:if(l(AK[c]))return`${c}(${o}, ${r}, ${s})`;break;case xt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case xt.MEMBER:return D_(this._left)?ele(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 xt.FUNCTION_CALL:throw new ce(`Error generating style shader: "${c}" is not supported.`);case xt.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 ce("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case xt.REGEX:throw new ce("Error generating style shader: Regular expressions are not supported.");case xt.VARIABLE_IN_STRING:throw new ce("Error generating style shader: Converting a variable to a string is not supported.");case xt.LITERAL_NULL:return $m.NULL_SENTINEL;case xt.LITERAL_BOOLEAN:return c?"true":"false";case xt.LITERAL_NUMBER:return Wg(c);case xt.LITERAL_STRING:if(l(n)&&n._type===xt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||D_(n._left)))return c;if(i=D.fromCssColorString(c,Lk),l(i))return uDe(i);throw new ce("Error generating style shader: String literals are not supported.");case xt.LITERAL_COLOR:if(d=o,c==="color"){if(l(d)){if(d.length>1){let p=d[0],g=d[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=qce(this),l(i)?Vk(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(c==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=qce(this),l(i)?Vk(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=jce(this),l(i)?Vk(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=jce(this),l(i)?(i.alpha!==1&&(t.translucent=!0),Vk(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case xt.LITERAL_VECTOR:u=o.length,h=`${c}(`;for(let p=0;p<u;++p)h+=o[p],p<u-1&&(h+=", ");return h+=")",h;case xt.LITERAL_REGEX:throw new ce("Error generating style shader: Regular expressions are not supported.");case xt.LITERAL_UNDEFINED:return $m.NULL_SENTINEL;case xt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Et.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case xt.VARIABLE:D_(this)||e.push(s);break;case xt.VARIABLE_IN_STRING:for(a=$X.exec(s);a!==null;)e.push(a[1]),a=$X.exec(s);break;case xt.LITERAL_STRING:l(t)&&t._type===xt.MEMBER&&D_(t._left)&&e.push(s);break}};var Mu=$m;function fb(e){e=e??Y.EMPTY_OBJECT,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=e.center??m.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=D.clone(D.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=e.classificationType??On.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(fb.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var mDe={position:0,a_batchId:1};function hDe(e,t){if(l(e._va))return;let n=Ct.createVertexBuffer({context:t,typedArray:e._positions,usage:ke.STATIC_DRAW}),i=Ct.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:ke.STATIC_DRAW}),o=Ct.createIndexBuffer({context:t,typedArray:e._indices,usage:ke.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:Q.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Q.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new oi({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new oi({context:t,attributes:r,indexBuffer:Ct.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:ke.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function fDe(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??mDe,o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=nn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=De.replaceMain(s,"czm_non_pick_main"),s=`${s}void main()
|
|
|
{
|
|
|
czm_non_pick_main();
|
|
|
out_FragColor = ${o};
|
|
|
}
|
|
|
`,e._spPick=nn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(b1),c=n.getFragmentShaderCallback(!1,void 0,!0)(Gg);o=n.getPickId();let d=new De({sources:[a]}),u=new De({defines:["VECTOR_TILE"],sources:[c]});e._sp=nn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),d=new De({sources:[b1]}),u=new De({defines:["VECTOR_TILE"],sources:[Gg]}),e._spStencil=nn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),c=De.replaceMain(c,"czm_non_pick_main"),c=`${c}
|
|
|
void main()
|
|
|
{
|
|
|
czm_non_pick_main();
|
|
|
out_FragColor = ${o};
|
|
|
}
|
|
|
`;let h=new De({sources:[a]}),p=new De({defines:["VECTOR_TILE"],sources:[c]});e._spPick=nn.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i})}function tle(e){let t=e?Bn.EQUAL:Bn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:t,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL},depthMask:!1}}var pDe={stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND},bDe={stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function gDe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ue.fromCache(tle(!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(tle(!0)),e._rsColorPass=Ue.fromCache(pDe),e._rsPickPass=Ue.fromCache(bDe))}var O_=new F,nle=new m;function yDe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return F.clone(i,O_),F.multiplyByPoint(O_,e._center,nle),F.setTranslation(O_,nle,O_),F.multiply(o,O_,O_),O_},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function MK(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let d=0;d<c;++d){let u=r[d],h=s[u],p=i[h],g=o[h],f=new e.constructor(e.buffer,a*p,g);t.set(f,n),i[h]=n,n+=g}return n}function xDe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],d=MK(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=d;t.length>0;){let u=t.pop();if(D.equals(u.color,a.color))d=MK(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let h=d;d=MK(n,s,d,i,o,u.batchIds,r),u.offset=h,u.count=d-h,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function NK(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let d=0;d<c;++d){let u=r[d],h=s[u],p=i[h],g=o[h];t.copyFromBuffer(e,p*a,n*a,g*a),i[h]=n,n+=g}return n}function _De(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,d=NK(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=d;t.length>0;){let h=t.pop();if(D.equals(h.color,r.color))d=NK(a,c,d,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=d-r.offset;else{let p=d;d=NK(a,c,d,n,i,h.batchIds,o),h.offset=p,h.count=d-p,s.push(h),r=h}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function TDe(e,t){return t.color.toRgba()-e.color.toRgba()}function SDe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(TDe),t.webgl2?_De(e,n):xDe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function CDe(e,t){let n=SDe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,d=e._modelMatrix??F.IDENTITY,u=e._uniformMap,h=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,f=o[p].count,y=i[p*2];l(y)||(y=i[p*2]=new $e({owner:e})),y.vertexArray=a,y.modelMatrix=d,y.offset=g,y.count=f,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=u,y.boundingVolume=h,y.cull=!1,y.pass=Ge.TERRAIN_CLASSIFICATION;let x=$e.shallowClone(y,y.derivedCommands.tileset);x.renderState=e._rsStencilDepthPass3DTiles,x.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=x;let S=i[p*2+1];l(S)||(S=i[p*2+1]=new $e({owner:e})),S.vertexArray=a,S.modelMatrix=d,S.offset=g,S.count=f,S.renderState=e._rsColorPass,S.shaderProgram=c,S.uniformMap=u,S.boundingVolume=h,S.cull=!1,S.pass=Ge.TERRAIN_CLASSIFICATION;let C=$e.shallowClone(S,S.derivedCommands.tileset);C.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,S.derivedCommands.tileset=C}e._commandsDirty=!0}function VDe(e,t){if(e.classificationType===On.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let d=i[c]=$e.shallowClone(n[a],i[c]);d.shaderProgram=o,d.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function LDe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=e._modelMatrix??F.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let d=e._indexOffsets[c],u=e._indexCounts[c],h=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new $e({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=d,p.count=u,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=h,p.pass=Ge.TERRAIN_CLASSIFICATION;let g=$e.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let f=n[c*2+1];l(f)||(f=n[c*2+1]=new $e({owner:e,pickOnly:!0})),f.vertexArray=i,f.modelMatrix=s,f.offset=d,f.count=u,f.renderState=e._rsPickPass,f.shaderProgram=r,f.uniformMap=a,f.boundingVolume=h,f.pass=Ge.TERRAIN_CLASSIFICATION;let y=$e.shallowClone(f,f.derivedCommands.tileset);y.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=y}e._pickCommandsDirty=!1}fb.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 js(e,r)}};fb.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function RDe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=D.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=D.clone(D.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var ZDe=new D,GDe=D.WHITE,EDe=!0,IDe=/\$/;fb.prototype.applyStyle=function(e,t){if(!l(e)){RDe(this,t);return}let n=e.color,i=n instanceof Mu&&!IDe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,ZDe):GDe,c.show=l(e.show)?e.show.evaluate(c):EDe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=D.clone(D.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};fb.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,d=c.length,u;for(u=0;u<d;++u){let y=c[u].offset,x=c[u].count;if(s>=y&&s<y+x)break}c.push(new Cf({color:D.clone(t),offset:s,count:a,batchIds:[e]}));let h=[],p=[],g=c[u].batchIds,f=g.length;for(let y=0;y<f;++y){let x=g[y];if(x===e)continue;let S=n[x];o[S]<s?h.push(x):p.push(x)}p.length!==0&&c.push(new Cf({color:D.clone(c[u].color),offset:s+a,count:c[u].offset+c[u].count-(s+a),batchIds:p})),h.length!==0?(c[u].count=s-c[u].offset,c[u].batchIds=h):c.splice(u,1),this._batchDirty=!0};function ile(e,t,n,i){let o=e.classificationType,r=o!==On.CESIUM_3D_TILE,s=o!==On.TERRAIN,a=t.commandList,c=n.length,d,u;for(u=0;u<c;++u)r&&(d=n[u],d.pass=Ge.TERRAIN_CLASSIFICATION,a.push(d)),s&&(d=n[u].derivedCommands.tileset,d.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,a.push(d));if(!(!t.invertClassification||!l(i)))for(c=i.length,u=0;u<c;++u)a.push(i[u])}function XDe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Ge.OPAQUE,n.push(r)}}function WDe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ue.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Ae.LINES):(n=e._rsColorPass,i=Ae.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}fb.prototype.update=function(e){let t=e.context;hDe(this,t),fDe(this,t),gDe(this),yDe(this,t);let n=e.passes;n.render&&(CDe(this,t),VDe(this,e),WDe(this),this._debugWireframe?XDe(e,this._commands):ile(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(LDe(this),ile(this,e,this._pickCommands))};fb.prototype.isDestroyed=function(){return!1};fb.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(),me(this)};var B_=fb;function Zd(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=m.clone(this._boundingVolume.center):this._center=m.clone(m.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=On.BOTH}Object.defineProperties(Zd.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}}});Zd.packedBoxLength=F.packedLength+m.packedLength;Zd.packedCylinderLength=F.packedLength+2;Zd.packedEllipsoidLength=F.packedLength+m.packedLength;Zd.packedSphereLength=m.packedLength+1;function PDe(e){let t=new Float64Array(F.packedLength+m.packedLength),n=0;return m.pack(e._center,t,n),n+=m.packedLength,F.pack(e._modelMatrix,t,n),t}function vDe(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]=de.unpack(t,n),n+=de.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let d=D.unpack(t,n);n+=D.packedLength;let u=t[n++],h=t[n++],p=t[n++],g=new Array(p);for(let f=0;f<p;++f)g[f]=t[n++];a[c]=new Cf({color:d,offset:u,count:h,batchIds:g})}return i}var wDe=new yi("createVectorTileGeometries",5),FDe=new D;function ADe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,d=e._batchTableColors,u=e._packedBuffer;if(!l(d)){let f=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),f+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),f+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),f+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),f+=c.length),d=e._batchTableColors=new Uint32Array(f);let y=e._batchTable;for(let x=0;x<f;++x){let S=y.getColor(x,FDe);d[x]=S.toRgba()}u=e._packedBuffer=PDe(e)}let h=[];l(t)&&h.push(t.buffer,n.buffer),l(i)&&h.push(i.buffer,o.buffer),l(r)&&h.push(r.buffer,s.buffer),l(a)&&h.push(a.buffer,c.buffer),h.push(d.buffer,u.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:d.buffer,packedBuffer:u.buffer},g=e._verticesPromise=wDe.scheduleTask(p,h);return l(g)?g.then(function(f){if(e.isDestroyed())return;let y=new Float64Array(f.packedBuffer);vDe(e,y)===2?e._indices=new Uint16Array(f.indices):e._indices=new Uint32Array(f.indices),e._indexOffsets=new Uint32Array(f.indexOffsets),e._indexCounts=new Uint32Array(f.indexCounts),e._positions=new Float32Array(f.positions),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds),e._batchIds=new Uint16Array(f.batchIds),MDe(e),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)}):void 0}}function MDe(e){l(e._primitive)||(e._primitive=new B_({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)}Zd.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Zd.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Zd.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Zd.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Zd.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=ADe(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)};Zd.prototype.isDestroyed=function(){return!1};Zd.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var pb=Zd;function Vf(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,UDe(this,i,o)}Object.defineProperties(Vf.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 NDe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function kDe(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,d=e.ELLIPSOIDS_LENGTH??0,u=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let f=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let f=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,f,c)}if(d>0&&l(e.ELLIPSOID_BATCH_IDS)){let f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,f,d)}if(u>0&&l(e.SPHERE_BATCH_IDS)){let f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,f,u)}let h=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||d>0&&!l(o)||u>0&&!l(r);if(h&&p)throw new ce("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let f=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=f++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=f++;if(!l(o)&&d>0)for(o=new Uint16Array(d),s=0;s<d;++s)o[s]=f++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=f++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var Y_=Uint32Array.BYTES_PER_ELEMENT;function UDe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=Y_;let r=o.getUint32(n,!0);if(r!==1)throw new ce(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=Y_;let s=o.getUint32(n,!0);if(n+=Y_,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Y_,a===0)throw new ce("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Y_;let d=o.getUint32(n,!0);n+=Y_;let u=o.getUint32(n,!0);n+=Y_;let h=Qo(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,f;d>0&&(g=Qo(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let y=h.BOXES_LENGTH??0,x=h.CYLINDERS_LENGTH??0,S=h.ELLIPSOIDS_LENGTH??0,C=h.SPHERES_LENGTH??0,V=y+x+S+C,L=new hb(e,V,g,f,NDe(e));if(e._batchTable=L,V===0)return;let Z=e.tile.computedTransform,E;l(h.RTC_CENTER)&&(E=m.unpack(h.RTC_CENTER),F.multiplyByPoint(Z,E,E));let P=kDe(h,p);if(y>0||x>0||S>0||C>0){let W,v,A,b;if(y>0){let R=p.byteOffset+h.BOXES.byteOffset;W=new Float32Array(p.buffer,R,pb.packedBoxLength*y)}if(x>0){let R=p.byteOffset+h.CYLINDERS.byteOffset;v=new Float32Array(p.buffer,R,pb.packedCylinderLength*x)}if(S>0){let R=p.byteOffset+h.ELLIPSOIDS.byteOffset;A=new Float32Array(p.buffer,R,pb.packedEllipsoidLength*S)}if(C>0){let R=p.byteOffset+h.SPHERES.byteOffset;b=new Float32Array(p.buffer,R,pb.packedSphereLength*C)}return e._geometries=new pb({boxes:W,boxBatchIds:P.boxes,cylinders:v,cylinderBatchIds:P.cylinders,ellipsoids:A,ellipsoidBatchIds:P.ellipsoids,spheres:b,sphereBatchIds:P.spheres,center:E,modelMatrix:Z,batchTable:L,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function ole(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}}Vf.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Vf.prototype.getFeature=function(e){return ole(this),this._features[e]};Vf.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Vf.prototype.applyStyle=function(e){ole(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Vf.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)};Vf.prototype.pick=function(e,t,n){};Vf.prototype.isDestroyed=function(){return!1};Vf.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};var eW=Vf;var W2n=_(T(),1);var u2n=_(T(),1);var _Rn=_(T(),1);function DDe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ci=DDe;var VRn=_(T(),1);function kK(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 ce(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!l(n)&&s&&(n=ODe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function ODe(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(kK.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});kK.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 g1=kK;var ZRn=_(T(),1);function bb(e){e=e??Y.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(bb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});bb.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};bb.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};bb.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};bb.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};bb.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};bb.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};bb.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var y1=bb;var ERn=_(T(),1);var Ek={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};Ek.getBranchingFactor=function(e){switch(e){case Ek.OCTREE:return 8;case Ek.QUADTREE:return 4}};var os=Object.freeze(Ek);var NRn=_(T(),1);var vRn=_(T(),1);function xa(){}Object.defineProperties(xa.prototype,{class:{get:function(){fe.throwInstantiationError()}}});xa.prototype.hasProperty=function(e){fe.throwInstantiationError()};xa.prototype.hasPropertyBySemantic=function(e){fe.throwInstantiationError()};xa.prototype.getPropertyIds=function(e){fe.throwInstantiationError()};xa.prototype.getProperty=function(e){fe.throwInstantiationError()};xa.prototype.setProperty=function(e,t){fe.throwInstantiationError()};xa.prototype.getPropertyBySemantic=function(e){fe.throwInstantiationError()};xa.prototype.setPropertyBySemantic=function(e,t){fe.throwInstantiationError()};xa.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))};xa.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};xa.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};xa.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=Be(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};xa.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};xa.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return xa.getProperty(o.id,t,n)};xa.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?xa.setProperty(r.id,t,n,i):!1};var kn=xa;function gb(e){e=e??Y.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(gb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});gb.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};gb.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};gb.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};gb.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};gb.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};gb.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};gb.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var tW=gb;var IZn=_(T(),1);var CZn=_(T(),1);var BRn=_(T(),1);var kt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};kt.getMinimum=function(e){switch(e){case kt.INT8:return-128;case kt.UINT8:return 0;case kt.INT16:return-32768;case kt.UINT16:return 0;case kt.INT32:return-2147483648;case kt.UINT32:return 0;case kt.INT64:return Ht.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case kt.UINT64:return Ht.supportsBigInt()?BigInt(0):0;case kt.FLOAT32:return-34028234663852886e22;case kt.FLOAT64:return-Number.MAX_VALUE}};kt.getMaximum=function(e){switch(e){case kt.INT8:return 127;case kt.UINT8:return 255;case kt.INT16:return 32767;case kt.UINT16:return 65535;case kt.INT32:return 2147483647;case kt.UINT32:return 4294967295;case kt.INT64:return Ht.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case kt.UINT64:return Ht.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case kt.FLOAT32:return 34028234663852886e22;case kt.FLOAT64:return Number.MAX_VALUE}};kt.isIntegerType=function(e){switch(e){case kt.INT8:case kt.UINT8:case kt.INT16:case kt.UINT16:case kt.INT32:case kt.UINT32:case kt.INT64:case kt.UINT64:return!0;default:return!1}};kt.isUnsignedIntegerType=function(e){switch(e){case kt.UINT8:case kt.UINT16:case kt.UINT32:case kt.UINT64:return!0;default:return!1}};kt.isVectorCompatible=function(e){switch(e){case kt.INT8:case kt.UINT8:case kt.INT16:case kt.UINT16:case kt.INT32:case kt.UINT32:case kt.FLOAT32:case kt.FLOAT64:return!0;default:return!1}};kt.normalize=function(e,t){return Math.max(Number(e)/Number(kt.getMaximum(t)),-1)};kt.unnormalize=function(e,t){let n=kt.getMaximum(t),i=kt.isUnsignedIntegerType(t)?0:-n;return e=X.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===kt.INT64||t===kt.UINT64)&&Ht.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};kt.applyValueTransform=function(e,t,n){return n*e+t};kt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};kt.getSizeInBytes=function(e){switch(e){case kt.INT8:case kt.UINT8:return 1;case kt.INT16:case kt.UINT16:return 2;case kt.INT32:case kt.UINT32:return 4;case kt.INT64:case kt.UINT64:return 8;case kt.FLOAT32:return 4;case kt.FLOAT64:return 8}};kt.fromComponentDatatype=function(e){switch(e){case Q.BYTE:return kt.INT8;case Q.UNSIGNED_BYTE:return kt.UINT8;case Q.SHORT:return kt.INT16;case Q.UNSIGNED_SHORT:return kt.UINT16;case Q.INT:return kt.INT32;case Q.UNSIGNED_INT:return kt.UINT32;case Q.FLOAT:return kt.FLOAT32;case Q.DOUBLE:return kt.FLOAT64}};kt.toComponentDatatype=function(e){switch(e){case kt.INT8:return Q.BYTE;case kt.UINT8:return Q.UNSIGNED_BYTE;case kt.INT16:return Q.SHORT;case kt.UINT16:return Q.UNSIGNED_SHORT;case kt.INT32:return Q.INT;case kt.UINT32:return Q.UNSIGNED_INT;case kt.FLOAT32:return Q.FLOAT;case kt.FLOAT64:return Q.DOUBLE}};var Mt=Object.freeze(kt);var uZn=_(T(),1);var qRn=_(T(),1);var Uo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Uo.isVectorType=function(e){switch(e){case Uo.VEC2:case Uo.VEC3:case Uo.VEC4:return!0;default:return!1}};Uo.isMatrixType=function(e){switch(e){case Uo.MAT2:case Uo.MAT3:case Uo.MAT4:return!0;default:return!1}};Uo.getComponentCount=function(e){switch(e){case Uo.SCALAR:case Uo.STRING:case Uo.ENUM:case Uo.BOOLEAN:return 1;case Uo.VEC2:return 2;case Uo.VEC3:return 3;case Uo.VEC4:return 4;case Uo.MAT2:return 4;case Uo.MAT3:return 9;case Uo.MAT4:return 16}};Uo.getMathType=function(e){switch(e){case Uo.VEC2:return U;case Uo.VEC3:return m;case Uo.VEC4:return re;case Uo.MAT2:return Xi;case Uo.MAT3:return $;case Uo.MAT4:return F;default:return}};var mt=Object.freeze(Uo);function Ua(e){e=e??Y.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&Mt.isIntegerType(i)&&(e.normalized??!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Be(e.min,!0),this._max=Be(e.max,!0),this._normalized=r;let s=Be(e.offset,!0),a=Be(e.scale,!0),c=l(s)||l(a),d=!0;l(s)||(s=this.expandConstant(0,d)),l(a)||(a=this.expandConstant(1,d)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Be(e.noData,!0),this._default=Be(e.default,!0),this._required=e.required??!0,this._extras=Be(e.extras,!0),this._extensions=Be(e.extensions,!0)}Ua.fromJson=function(e){e=e??Y.EMPTY_OBJECT;let t=e.id,n=e.property,i=BDe(n),o=YDe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new Ua({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(Ua.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 BDe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===mt.SCALAR||mt.isMatrixType(t)||mt.isVectorType(t))return!1;if(l(Mt[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 YDe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===mt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===mt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===mt.SCALAR||mt.isMatrixType(n)||mt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===mt.BOOLEAN||n===mt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===mt.BOOLEAN||i===mt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Mt[i]))return{type:mt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(Mt[n]))return{type:mt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}Ua.prototype.normalize=function(e){return this._normalized?UK(e,this._valueType,Mt.normalize):e};Ua.prototype.unnormalize=function(e){return this._normalized?UK(e,this._valueType,Mt.unnormalize):e};Ua.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ua.valueTransformInPlace(e,this._offset,this._scale,Mt.applyValueTransform)};Ua.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ua.valueTransformInPlace(e,this._offset,this._scale,Mt.unapplyValueTransform)};Ua.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=mt.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};Ua.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!cle(e,t))return e};function cle(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(!cle(e[n],t[n]))return!1;return!0}Ua.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=mt.getMathType(this._type),i=this._isArray,o=mt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Ua.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=mt.getMathType(this._type),i=this._isArray,o=mt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Ua.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?zDe(this,e):lle(this,e)};function zDe(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=lle(e,t[i]);if(l(o))return o}}function lle(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return mt.isVectorType(n)?HDe(t,n,i):mt.isMatrixType(n)?KDe(t,n,i):n===mt.STRING?JDe(t):n===mt.BOOLEAN?QDe(t):n===mt.ENUM?jDe(t,o):qDe(t,i,r)}function HDe(e,t,n){if(!Mt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===mt.VEC2&&!(e instanceof U))return`vector value ${e} must be a Cartesian2`;if(t===mt.VEC3&&!(e instanceof m))return`vector value ${e} must be a Cartesian3`;if(t===mt.VEC4&&!(e instanceof re))return`vector value ${e} must be a Cartesian4`}function KDe(e,t,n){if(!Mt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===mt.MAT2&&!(e instanceof Xi))return`matrix value ${e} must be a Matrix2`;if(t===mt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===mt.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function JDe(e){if(typeof e!="string")return Ik(e,mt.STRING)}function QDe(e){if(typeof e!="boolean")return Ik(e,mt.BOOLEAN)}function jDe(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 qDe(e,t,n){let i=typeof e;switch(t){case Mt.INT8:case Mt.UINT8:case Mt.INT16:case Mt.UINT16:case Mt.INT32:case Mt.UINT32:case Mt.FLOAT32:case Mt.FLOAT64:return i!=="number"?Ik(e,t):isFinite(e)?sle(e,t,n):ale(e,t);case Mt.INT64:case Mt.UINT64:return i!=="number"&&i!=="bigint"?Ik(e,t):i==="number"&&!isFinite(e)?ale(e,t):sle(e,t,n)}}function Ik(e,t){return`value ${e} does not match type ${t}`}function rle(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function sle(e,t,n){if(n){let i=Mt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?rle(e,t,n):void 0}if(e<Mt.getMinimum(t)||e>Mt.getMaximum(t))return rle(e,t,n)}function ale(e,t){return`value ${e} of type ${t} must be finite`}function UK(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=UK(e[i],t,n);return e}Ua.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]=Ua.valueTransformInPlace(e[o],t[o],n[o],i);return e};var Lf=Ua;function nW(e){e=e??Y.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,d=i.enumType,u=r===mt.STRING,h=r===mt.BOOLEAN,p=0,g;if(a){let b=n.arrayOffsetType??n.offsetType;b=Mt[b]??Mt.UINT32;let R=n.arrayOffsets??n.arrayOffsetBufferView;g=new DK(o[R],b,t+1),p+=g.typedArray.byteLength}let f=mt.getComponentCount(r),y;a?y=g.get(t)-g.get(0):s?y=t*i.arrayLength:y=t;let x=f*y,S;if(u){let b=n.stringOffsetType??n.offsetType;b=Mt[b]??Mt.UINT32;let R=n.stringOffsets??n.stringOffsetBufferView;S=new DK(o[R],b,x+1),p+=S.typedArray.byteLength}(u||h)&&(c=Mt.UINT8);let C;u?C=S.get(x)-S.get(0):h?C=Math.ceil(x/8):C=x;let V=n.values??n.bufferView,L=new DK(o[V],c,C);p+=L.typedArray.byteLength;let Z=n.offset,E=n.scale,P=i.hasValueTransform||l(Z)||l(E);Z=Z??i.offset,E=E??i.scale,Z=dle(Z),E=dle(E);let W,v,A=this;u?W=function(b){return tOe(b,A._values,A._stringOffsets)}:h?(W=function(b){return nOe(b,A._values)},v=function(b,R){iOe(b,A._values,R)}):l(d)?(W=function(b){let R=A._values.get(b);return d.namesByValue[R]},v=function(b,R){let G=d.valuesByName[R];A._values.set(b,G)}):(W=function(b){return A._values.get(b)},v=function(b,R){A._values.set(b,R)}),this._arrayOffsets=g,this._stringOffsets=S,this._values=L,this._classProperty=i,this._count=t,this._vectorComponentCount=f,this._min=n.min,this._max=n.max,this._offset=Z,this._scale=E,this._hasValueTransform=P,this._getValue=W,this._setValue=v,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(nW.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}}});nW.prototype.get=function(e){let t=$De(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=uOe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};nW.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=mOe(this,t),t=n.unnormalize(t),eOe(this,e,t)};nW.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function dle(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function $De(e,t){mle(e)&&hle(e);let n=e._classProperty,i=n.isArray,o=n.type,r=mt.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Be(s,!0):s}return!i&&r===1?e._getValue(t):ule(e,n,t)}function ule(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=mt.getComponentCount(t.type);i*=s,o*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function eOe(e,t,n){lOe(e,t,n)&&hle(e);let i=e._classProperty,o=i.isArray,r=i.type,s=mt.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Be(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let u=(i.arrayLength??1)*e._vectorComponentCount;a=t*u,c=u}for(let d=0;d<c;++d)e._setValue(a+d,n[d])}function tOe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Xl(t.typedArray,i,o)}function nOe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function iOe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function oOe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function rOe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function sOe(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 aOe(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 cOe(e){switch(e){case Mt.INT8:return Q.BYTE;case Mt.UINT8:return Q.UNSIGNED_BYTE;case Mt.INT16:return Q.SHORT;case Mt.UINT16:return Q.UNSIGNED_SHORT;case Mt.INT32:return Q.INT;case Mt.UINT32:return Q.UNSIGNED_INT;case Mt.FLOAT32:return Q.FLOAT;case Mt.FLOAT64:return Q.DOUBLE}}function mle(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===mt.STRING||i===Mt.INT64&&!Ht.supportsBigInt64Array()||i===Mt.UINT64&&!Ht.supportsBigUint64Array()}function lOe(e,t,n){if(mle(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 hle(e){e._unpackedValues=dOe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function dOe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=mt.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=ule(e,i,a);return n}function uOe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Lf.valueTransformInPlace(t,e._offset,e._scale,Mt.applyValueTransform)}function mOe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Lf.valueTransformInPlace(t,e._offset,e._scale,Mt.unapplyValueTransform)}function DK(e,t,n){let i=this,o,r,s;if(t===Mt.INT64)Ht.supportsBigInt()?Ht.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return rOe(a,i)}):(Vt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return oOe(a,i)});else if(t===Mt.UINT64)Ht.supportsBigInt()?Ht.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return aOe(a,i)}):(Vt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return sOe(a,i)});else{let a=cOe(t);o=Q.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,d){i.typedArray[c]=d}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var iW=nW;function eh(e){e=e??Y.EMPTY_OBJECT;let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new iW({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(eh.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});eh.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};eh.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};eh.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};eh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=hOe(this._class,t),i};eh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};eh.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)};eh.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};eh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};eh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function hOe(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=Be(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Nu=eh;var qPn=_(T(),1);var BZn=_(T(),1);var FZn=_(T(),1);function Pg(){}Object.defineProperties(Pg.prototype,{cacheKey:{get:function(){fe.throwInstantiationError()}}});Pg.prototype.load=function(){fe.throwInstantiationError()};Pg.prototype.unload=function(){};Pg.prototype.process=function(e){return!1};Pg.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=`
|
|
|
${t.message}`);let n=new ce(e);return l(t)&&(n.stack=`Original stack:
|
|
|
${t.stack}
|
|
|
Handler stack:
|
|
|
${n.stack}`),n};Pg.prototype.isDestroyed=function(){return!1};Pg.prototype.destroy=function(){return this.unload(),me(this)};var Qi=Pg;var MZn=_(T(),1),fOe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},_t=Object.freeze(fOe);function yb(e){e=e??Y.EMPTY_OBJECT;let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=_t.UNLOADED,this._promise=void 0}l(Object.create)&&(yb.prototype=Object.create(Qi.prototype),yb.prototype.constructor=yb);Object.defineProperties(yb.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});yb.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=pOe(this),this._promise)};async function pOe(e){let t=e._resource;e._state=_t.LOADING;try{let n=await yb._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=_t.READY,e)}catch(n){if(e.isDestroyed())return;e._state=_t.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}yb._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};yb.prototype.unload=function(){this._typedArray=void 0};var z_=yb;var pGn=_(T(),1);var iGn=_(T());var HZn=_(T()),YZn=function(){var e="b9H79Tebbbe9nk9Geueu9Geub9Gbb9Gouuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiYKdilveoveovrrwrrDDoDbqqbelve9Weiiviebeoweuec;G:Qdkr:nlAo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbHK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbOl79IV9RbADwebcekdLQq:X9MKdbk:xhdgud9:8Jjjjjbc;qw9Rgo8Kjjjjbdndnaembcbhrxekabcbyd;C:kjjbgwc:GeV86bbaoc;adfcbcjdz:vjjjb8AdnaiTmbaoc;adfadalzNjjjb8Akaoc;abfalfcbcbcjdal9RalcFe0Ez:vjjjb8Aaoc;abfaoc;adfalzNjjjb8AaocUf9cb83ibaoc8Wf9cb83ibaocyf9cb83ibaocaf9cb83ibaocKf9cb83ibaoczf9cb83ibao9cb83iwao9cb83ibcj;abal9Uc;WFbGcjdalca0EhDdnaicd6mbavcd9imbawTmbadcefhqaDci2gkal2hxaoc;alfclfhmaoc;qlfceVhPaoc;qofclVhsaoc;qofcKfhzaoc;qofczfhHcbhOincdhAcbhrdnavci6mbaz9cb83ibaH9cb83ibao9cb83i;yoao9cb83i;qoadaOfgrybbhCcbhXincbhQcbhLdninaralfhKarybbgYaC7aLVhLaQcP0meaKhraYhCaQcefgQaXfai6mbkkcbhCaoc;qofhQincwh8AcwhEdnaLaC93grcFeGg3cs0mbclhEa3ci0mba3cb9hcethEkdnarcw4cFeGg3cs0mbclh8Aa3ci0mba3cb9hceth8Aka8AaEfh3aQydbh5cwh8AcwhEdnarcz4cFeGg8Ecs0mbclhEa8Eci0mba8Ecb9hcethEka3a5fh3dnarcFFFFb0mbclh8AarcFFF8F0mbarcFFFr0ceth8AkaQa3aEfa8AfBdbaQclfhQaCcefgCcw9hmbkaKhraYhCaXczfgXai6mbkcbhrcehQashLinaQaraLydbaoc;qofarcdtfydb6EhraLclfhLaQcefgQcw9hmbkcihAkcbh3aoc;qlfcbcjdz:vjjjb8Aaoc;alfcwfcbBdbao9cb83i;alarclth8FadhaaDhhaqh5inaoc;qlfadcba3cufgrara30Eal2falzNjjjb8Aaiahaiah6EhgdnaDaia39Ra3aDfai6EgYcsfc9WGgraY9nmbaoc;qofaYfcbaraY9Rz:vjjjb8Akada3al2fh8Jcbh8Kina8Ka8FVcl4hXaoc;alfa8Kcdtfh8LaOh8Mcbh8Nina8NaOfhQdndndndndndna8KPldebidkaPa8Mc98GgLfhra5aLfh8Aaoc;qlfaQc98GgLfRbbhCcwhQinarRbbaQtaCVhCarcefhraQcwfgQca9hmbkaYTmla8Ncith8Ea8JaLfhEcbhKinaERbbhLcwhra8AhQinaQRbbartaLVhLaQcefhQarcwfgrca9hmbkaoc;qofaKfaLaC7aX93a8E486bba8Aalfh8AaEalfhEaLhCaKcefgKaY9hmbxlkkaYTmia8Mc9:Ghra8NcitcwGhEaoc;qlfaQceVfRbbcwtaoc;qlfaQc9:GfRbbVhLaoc;qofhQaghCinaQa5arfRbbcwtaaarfRbbVg8AaL9RgLcetaLcztcz91cs47cFFiGaE486bbaralfhraQcefhQa8AhLa3aCcufgC9hmbxikkaYTmda8JaQfhraoc;qlfaQfRbbhLaoc;qofhQaghCinaQarRbbg8AaL9RgLcetaLcKtcK91cr4786bbaQcefhQaralfhra8AhLa3aCcufgC9hmbxdkkaYTmeka8LydbhEcbhKaoc;qofhrincdhLcbhQinaLaraQfRbbcb9hfhLaQcefgQcz9hmbkclhCcbhQinaCaraQfRbbcd0fhCaQcefgQcz9hmbkcwh8AcbhQina8AaraQfRbbcP0fh8AaQcefgQcz9hmbkaLaCaLaC6EgQa8AaQa8A6EgQczaQcz6EaEfhEarczfhraKczfgKaY6mbka8LaEBdbka8Mcefh8Ma8Ncefg8Ncl9hmbka8Kcefg8KaA9hmbkaaaxfhaahakfhha5axfh5a3akfg3ai6mbkcbhrcehQamhLinaQaraLydbaoc;alfarcdtfydb6EhraLclfhLaQcefgChQaAaC9hmbkaoaOcd4fa8FcdVararcdSE86bbaOclfgOal6mbkkabaefh8Kabcefhralcd4gecbawEhqadcefhHaoc;abfceVhzcbhxdndninaiax9nmeaoc;qofcbcjdz:vjjjb8Aa8Kar9Raq6mdadaxal2gQfhkcbh8JaHaQfhsarcbaqz:vjjjbghaqfh5aDaiax9RaxaDfai6EgPcsfgrcl4cifcd4hAarc9WGg8LThmindndndndndndndndndndnawTmbaoa8Jcd4fRbbgLciGPlbedlbkaPTmdaka8Jfhraoc;abfa8JfRbbhLaoc;qofhQaPhCinaQarRbbg8AaL9RgLcetaLcKtcK91cr4786bbaQcefhQaralfhra8AhLaCcufgCmbxikkaPTmia8JcitcwGhEaoc;abfa8JceVfRbbcwtaoc;abfa8Jc9:GgrfRbbVhLakarfhraoc;qofhQaPhCinaQar8Vbbg8AaL9RgLcetaLcztcz91cs47cFFiGaE486bbaQcefhQaralfhra8AhLaCcufgCmbxdkkaza8Jc98GgEfhrasaEfh8Aaoc;abfaEfRbbhCcwhQinarRbbaQtaCVhCarcefhraQcwfgQca9hmbkaPTmbaLcl4hYa8JcitcKGh3akaEfhEcbhKinaERbbhLcwhra8AhQinaQRbbartaLVhLaQcefhQarcwfgrca9hmbkaoc;qofaKfaLaC7aY93a3486bba8Aalfh8AaEalfhEaLhCaKcefgKaP9hmbkkawmbcbhrxlka8LTmbcbhrdninaoc;qofarfgQcwf8PibaQ8Pib:e9qTmearczfgra8L9pmdxbkkdnavmbcehrxikcbhEaAhKaAhYinaoc;qofaEfgrcwf8Pibhyar8Pibh8PcdhLcbhQinaLaraQfRbbcb9hfhLaQcefgQcz9hmbkclhCcbhQinaCaraQfRbbcd0fhCaQcefgQcz9hmbkcwh8AcbhQina8AaraQfRbbcP0fh8AaQcefgQcz9hmbkaLaCaLaC6Egra8Aara8A6Egrczarcz6EaYfhYarcucbaya8P:e9cb9sEgQaraQ6EaKfhKaEczfgEa8L9pmdxbkkaha8Jcd4fgrarRbbcda8JcetcoGtV86bbxikdnaKaP6mbaYaP6mbaha8Jcd4fgrarRbbcia8JcetcoGtV86bba8Ka59RaP6mra5aoc;qofaPzNjjjbaPfh5xikaKaY9phrkaha8Jcd4fgQaQRbbara8JcetcoGtV86bbka8Ka59RaA6mla5cbaAz:vjjjbgOaAfhYdndna8Lmbamhrxekdna8KaY9RcK9pmbamhrxekarcdtc:q1jjbfcj1jjbawEg5ydxggcetc;:FFFeGh8Fcuh3cuagtcu7cFeGhacbh8Maoc;qofhLinaoc;qofa8MfhXczhEdndndnagPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhExekcbhra8FhEinaEaaaLarfRbb9nfhEarcefgrcz9hmbkkcih8Ecbh8AinczhQdndndna5a8AcdtfydbgKPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhQxekaKcetc;:FFFeGhQcuaKtcu7cFeGhCcbhrinaQaCaLarfRbb9nfhQarcefgrcz9hmbkkdndnaQaE6mbaKa39hmeaQaE9hmea5a8EcdtfydbcwSmeka8Ah8EaQhEka8Acefg8Aci9hmbkaOa8Mco4fgrarRbba8Ea8Mci4coGtV86bbdndndna5a8Ecdtfydbg3PDdbbbbbbbebkdncwa39Tg8ETmbcua3tcu7hQdndna3ceSmbcbh8NaLhXinaXhra8Eh8AcbhCinarRbbgEaQcFeGgKaEaK6EaCa3tVhCarcefhra8Acufg8AmbkaYaC86bbaXa8EfhXaYcefhYa8Na8Efg8Ncz6mbxdkkcbh8NaLhXinaXhra8Eh8AcbhCinarRbbgEaQcFeGgKaEaK6EaCcetVhCarcefhra8Acufg8AmbkaYaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa8EfhXaYcefhYa8Na8Efg8Ncz6mbkkcbhrinaYaLarfRbbgC86bbaYaCaQcFeG9pfhYarcefgrcz9hmbxikkdna3ceSmbinaYcb86bbaYcefhYxbkkinaYcb86bbaYcefhYxbkkaYaX8Pbb83bbaYcwfaXcwf8Pbb83bbaYczfhYka8Mczfg8Ma8L9pgrmeaLczfhLa8KaY9RcK9pmbkkarTmlaYh5aYTmlka8Jcefg8Jal9hmbkaoc;abfakaPcufal2falzNjjjb8AaPaxfhxa5hra5mbkcbhrxdkdna8Kar9RaqalfgQcKcaawEgLaQaL0EgC9pmbcbhrxdkdnaQaL9pmbarcbaCaQ9RgQz:vjjjbaQfhrkaraoc;adfalzNjjjbalfhrdnawTmbaraoaezNjjjbaefhrkarab9Rhrxekcbhrkaoc;qwf8KjjjjbarkCbabaeadaialcdz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;C:kjjbk:Ese5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd;m:kjjbgrc;GeV86bbalc;abfcFecjez:vjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc;i1jjbfydbcdtfydbh3aLaoc;e1jjbfydbcdtfydbh8AaLaoc;a1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc;a1jjbfydbcdtfydbgKTaLavc;e1jjbfydbcdtfydbg8AceSGaLavc;i1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavc:W1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkdnaeaP9nmbcbhvxekcbhvinaeavfavc:W1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:kjjbk:Adewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb;m:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkdnaoar9nmbcbskaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b0Ec:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A0Ec:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;YqdXui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:vjjjb8AcbhodnadTmbcbhoaiTmbdndnabaeSmbaehrxekavcuadcdtgwadcFFFFi0Ecbyd;u:kjjbHjjjjbbgrBd:SeavceBd:mdaraeawzNjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaradaiavc:Sefz:ojjjbavyd:GehDadci9Ugqcbyd;u:kjjbHjjjjbbheavc:Sefavyd:mdgkcdtfaeBdbavakcefgwBd:mdaecbaqz:vjjjbhxavc:SefawcdtfcuaicdtaicFFFFi0Ecbyd;u:kjjbHjjjjbbgmBdbavakcdfgPBd:mdalc;ebfhsaDheamhwinawalIdbasaeydbgzcwazcw6EcdtfIdbMUdbaeclfheawclfhwaicufgimbkavc:SefaPcdtfcuaqcdtadcFFFF970Ecbyd;u:kjjbHjjjjbbgPBdbdnadci6mbarheaPhwaqhiinawamaeydbcdtfIdbamaeclfydbcdtfIdbMamaecwfydbcdtfIdbMUdbaecxfheawclfhwaicufgimbkkakcifhoalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhzcbhwcbhXcehQinaehLcihkarawci2gKcdtfgeydbhsaeclfydbhdabaXcx2fgicwfaecwfydbgYBdbaiclfadBdbaiasBdbaxawfce86bbaOaYBdwaOadBdlaOasBdbaPawcdtfcbBdbdnazTmbcihkaLhiinaOakcdtfaiydbgeBdbakaeaY9haeas9haead9hGGfhkaiclfhiazcufgzmbkkaXcefhXcbhzinaCaAarazaKfcdtfydbcdtgifydbcdtfgYheaDaifgdydbgshidnasTmbdninaeydbawSmeaeclfheaicufgiTmdxbkkaeaYascdtfc98fydbBdbadadydbcufBdbkazcefgzci9hmbkdndnakTmbcuhwJbbbbh8Acbhdavyd:KehYavyd:OehKindndnaDaOadcdtfydbcdtgzfydbgembadcefhdxekadcs0hiamazfgsIdbhEasalcbadcefgdaiEcdtfIdbaHaecwaecw6EcdtfIdbMg3Udba3aE:th3aecdthiaKaYazfydbcdtfheinaPaeydbgzcdtfgsa3asIdbMgEUdbaEa8Aa8AaE9DgsEh8AazawasEhwaeclfheaic98fgimbkkadak9hmbkawcu9hmekaQaq9pmdindnaxaQfRbbmbaQhwxdkaqaQcefgQ9hmbxikkakczakcz6EhzaOheaLhOawcu9hmbkkaocdtavc:Seffc98fhedninaoTmeaeydbcbyd;q:kjjbH:bjjjbbaec98fheaocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd;u:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;u:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;u:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:vjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic;K1jjbz:njjjbkQbabaeadaic;m:jjjbz:njjjbk9DeeuabcFeaicdtz:vjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;:kivuo99lu8Jjjjjbcj;Hb9Rgl8Kjjjjbcbhvalc:m;Gbfcbc;Kbz:vjjjb8AalcuadcdtadcFFFFi0Egocbyd;u:kjjbHjjjjbbgrBd:m9GalceBd;S9Galcwfcbyd:8:kjjbBdbalcb8Pd:0:kjjb83ibalc;W;Gbfcwfcbyd;i:kjjbBdbalcb8Pd;a:kjjb83i;W9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;W;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;49GhDalIdlhkalId;09GhxalIdbhmalId;W9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;Gbz:vjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;Gbz:vjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd;u:kjjbHjjjjbbgiBd:q9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealc:m;Gbfaifydbcbyd;q:kjjbH:bjjjbbaic98fhixbkkalcj;Hbf8Kjjjjbk9teiucbcbyd;y:kjjbgeabcifc98GfgbBd;y:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:kjjbgeabcrfc94GfgbBd;y:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;y:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;y:kjjbfgdBd;y:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk;Qddbcjwk;mdbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;mqkzebbbebbbdbbb9G:vbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var f=new Uint8Array(g.length),y=0;y<g.length;++y){var x=g.charCodeAt(y);f[y]=x>96?x-97:x>64?x-39:x+4}for(var S=0,y=0;y<g.length;++y)f[S++]=f[y]<60?t[f[y]]:(f[y]-60)*64+f[++y];return f.buffer.slice(0,S)}function r(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,f,y,x){var S=n.exports.sbrk,C=S(f.length*4),V=S(y*4),L=new Uint8Array(n.exports.memory.buffer),Z=s(f);L.set(Z,C),x&&x(C,C,f.length,y);var E=g(V,C,f.length,y);L=new Uint8Array(n.exports.memory.buffer);var P=new Uint32Array(y);new Uint8Array(P.buffer).set(L.subarray(V,V+y*4)),Z.set(L.subarray(C,C+f.length*4)),S(C-S(0));for(var W=0;W<f.length;++W)f[W]=P[f[W]];return[P,E]}function c(g,f,y,x){var S=n.exports.sbrk,C=S(y*4),V=S(y*x),L=new Uint8Array(n.exports.memory.buffer);L.set(s(f),V),g(C,V,y,x),L=new Uint8Array(n.exports.memory.buffer);var Z=new Uint32Array(y);return new Uint8Array(Z.buffer).set(L.subarray(C,C+y*4)),S(C-S(0)),Z}function d(g,f,y,x,S){var C=n.exports.sbrk,V=C(f),L=C(x*S),Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(y),L);var E=g(V,f,L,x,S),P=new Uint8Array(E);return P.set(Z.subarray(V,V+E)),C(V-C(0)),P}function u(g){for(var f=0,y=0;y<g.length;++y){var x=g[y];f=f<x?x:f}return f}function h(g,f){if(r(f==2||f==4),f==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,f,y,x,S,C,V){var L=n.exports.sbrk,Z=L(y*x),E=L(y*C),P=new Uint8Array(n.exports.memory.buffer);P.set(s(f),E),g(Z,y,x,S,E,V);var W=new Uint8Array(y*x);return W.set(P.subarray(Z,Z+y*x)),L(Z-L(0)),W}return{ready:i,supported:!0,reorderMesh:function(g,f,y){var x=f?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,u(g)+1,x)},reorderPoints:function(g,f){return r(g instanceof Float32Array),r(g.length%f==0),r(f>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/f,f*4)},encodeVertexBuffer:function(g,f,y){r(y>0&&y<=256),r(y%4==0);var x=n.exports.meshopt_encodeVertexBufferBound(f,y);return d(n.exports.meshopt_encodeVertexBuffer,x,g,f,y)},encodeIndexBuffer:function(g,f,y){r(y==2||y==4),r(f%3==0);var x=h(g,y),S=n.exports.meshopt_encodeIndexBufferBound(f,u(x)+1);return d(n.exports.meshopt_encodeIndexBuffer,S,x,f,4)},encodeIndexSequence:function(g,f,y){r(y==2||y==4);var x=h(g,y),S=n.exports.meshopt_encodeIndexSequenceBound(f,u(x)+1);return d(n.exports.meshopt_encodeIndexSequence,S,x,f,4)},encodeGltfBuffer:function(g,f,y,x){var S={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(S[x]),S[x](g,f,y)},encodeFilterOct:function(g,f,y,x){return r(y==4||y==8),r(x>=1&&x<=16),p(n.exports.meshopt_encodeFilterOct,g,f,y,x,16)},encodeFilterQuat:function(g,f,y,x){return r(y==8),r(x>=4&&x<=16),p(n.exports.meshopt_encodeFilterQuat,g,f,y,x,16)},encodeFilterExp:function(g,f,y,x,S){r(y>0&&y%4==0),r(x>=1&&x<=24);var C={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,f,y,x,y,S?C[S]:1)}}}();var JZn=_(T()),fle=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:W:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:986qdbk;jYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz1jjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbhodnawTmbaxa8Acd4fRbbhokaocFeGh5cbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz1jjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:jjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q1jjbfcj1jjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bbarcwf9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfag9c8F1:NghcKtc8F91aicdfa8J9c8N1:Nfg8KRbbG86bbarcVfcba8KahcjeGcr4fghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fag9c8F1:NgicKtc8F91aha8J9c8N1:NfghRbbG86bbarc96fcbahaicjeGcr4fgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbb83bbarcwfaicwf8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbcbaocl49Rh8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E93aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z1jjjb8AazazcjdfaAcufad2fadz1jjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbyd:K1jjbgeabcifc98GfgbBd:K1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk81dbcjwk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:Kwkl8WNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;X9Mqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:183lYud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxavaialfgmar9Rgoad;8qbbcj;abad9Uc;WFbGcjdadca0EhPdndndnadTmbaoadfhscbhzinaeaz9nmdamax9RaD6miabazad2fhHaxaDfhOaPaeaz9RazaPfae6EgAcsfgocl4cifcd4hCavcj;cbfaoc9WGgXcetfhQavcj;cbfaXci2fhLavcj;cbfaXfhKcbhYaoc;ab6h8AincbhodnawTmbaxaYcd4fRbbhokaocFeGhEcbh3avcj;cbfh5indndndndnaEa3cet4ciGgoc9:fPdebdkamaO9RaX6mwavcj;cbfa3aX2faOaX;8qbbaOaAfhOxdkavcj;cbfa3aX2fcbaX;8kbxekamaO9RaC6moaoclVcbawEhraOaCfhocbhidna8Ambamao9Rc;Gb6mbcbhlina5alfhidndndndndndnaOalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiczfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaicafaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngicitc:q1jjbfpbibaic:q:yjjbfRbbgipsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaiaoclffaqc:q:yjjbfRbbfhoxikaic8Wfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngicitc:q1jjbfpbibaic:q:yjjbfRbbgipsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaiaocwffaqc:q:yjjbfRbbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitc:q1jjbfpbibaic:q:yjjbfRbbgipsaoRbegqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqc:q:yjjbfRbbfhokalc;abfhialcjefaX0meaihlamao9Rc;Fb0mbkkdnaiaX9pmbaici4hlinamao9RcK6mwa5aifhqdndndndndndnaOaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spkbbaaaoclffahc:q:yjjbfRbbfhoxikaqaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spkbbaaaocwffahc:q:yjjbfRbbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpkbbaaaocdffahc:q:yjjbfRbbfhokalcdfhlaiczfgiaX6mbkkaohOaoTmoka5aXfh5a3cefg3cl9hmbkdndndndnawTmbasaYcd4fRbbglciGPlbedwbkaXTmdavcjdfaYfhlavaYfpbdbhgcbhoinalavcj;cbfaofpblbg8JaKaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaQaofpblbg8MaLaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Ecep9Ta8Epxeeeeeeeeeeeeeeeeg8Fp9op9Hp9rg8Eagp9Uggp9Abbbaladfglaga8Ea8Epmlv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ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:SPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;7eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgopklbaiaopklbaiabalcitfgdaeciGglcitgv;8qbbdnalTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;7eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkadaiav;8qbbkk:oDllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiczfpxbbbbbbbbbbbbbbbbgkpklbaiakpklbaiabalcitfgoaeciGgvcitgw;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkaoaiaw;8qbbkk;uddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaic8WfpxbbbbbbbbbbbbbbbbgopklbaicafaopklbaiczfaopklbaiaopklbaiabavcdtfgdalciGgecdtgv;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkadaiav;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(S){r=S.instance,r.exports.__wasm_call_ctors()});function a(S){for(var C=new Uint8Array(S.length),V=0;V<S.length;++V){var L=S.charCodeAt(V);C[V]=L>96?L-97:L>64?L-39:L+4}for(var Z=0,V=0;V<S.length;++V)C[Z++]=C[V]<60?i[C[V]]:(C[V]-60)*64+C[++V];return C.buffer.slice(0,Z)}function c(S,C,V,L,Z,E,P){var W=S.exports.sbrk,v=L+3&-4,A=W(v*Z),b=W(E.length),R=new Uint8Array(S.exports.memory.buffer);R.set(E,b);var G=C(A,L,Z,b,E.length);if(G==0&&P&&P(A,v,Z),V.set(R.subarray(A,A+L*Z)),W(A-W(0)),G!=0)throw new Error("Malformed buffer data: "+G)}var d={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},u={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function g(S){var C={object:new Worker(S),pending:0,requests:{}};return C.object.onmessage=function(V){var L=V.data;C.pending-=L.count,C.requests[L.id][L.action](L.value),delete C.requests[L.id]},C}function f(S){for(var C="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+x.name+";"+c.toString()+x.toString(),V=new Blob([C],{type:"text/javascript"}),L=URL.createObjectURL(V),Z=h.length;Z<S;++Z)h[Z]=g(L);for(var Z=S;Z<h.length;++Z)h[Z].object.postMessage({});h.length=S,URL.revokeObjectURL(L)}function y(S,C,V,L,Z){for(var E=h[0],P=1;P<h.length;++P)h[P].pending<E.pending&&(E=h[P]);return new Promise(function(W,v){var A=new Uint8Array(V),b=++p;E.pending+=S,E.requests[b]={resolve:W,reject:v},E.object.postMessage({id:b,count:S,size:C,source:A,mode:L,filter:Z},[A.buffer])})}function x(S){var C=S.data;if(!C.id)return self.close();self.ready.then(function(V){try{var L=new Uint8Array(C.count*C.size);c(V,V.exports[C.mode],L,C.count,C.size,C.source,V.exports[C.filter]),self.postMessage({id:C.id,count:C.count,action:"resolve",value:L},[L.buffer])}catch(Z){self.postMessage({id:C.id,count:C.count,action:"reject",value:Z})}})}return{ready:s,supported:!0,useWorkers:function(S){f(S)},decodeVertexBuffer:function(S,C,V,L,Z){c(r,r.exports.meshopt_decodeVertexBuffer,S,C,V,L,r.exports[d[Z]])},decodeIndexBuffer:function(S,C,V,L){c(r,r.exports.meshopt_decodeIndexBuffer,S,C,V,L)},decodeIndexSequence:function(S,C,V,L){c(r,r.exports.meshopt_decodeIndexSequence,S,C,V,L)},decodeGltfBuffer:function(S,C,V,L,Z,E){c(r,r.exports[u[Z]],S,C,V,L,r.exports[d[E]])},decodeGltfBufferAsync:function(S,C,V,L,Z){return h.length>0?y(S,C,V,u[L],d[Z]):s.then(function(){var E=new Uint8Array(S*C);return c(r,r.exports[u[L]],E,S,C,V,r.exports[d[Z]]),E})}}}();var qZn=_(T()),QZn=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuec:G:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq:x:yesdbk:Z9VvKue99euY99Ou8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd:m:jjjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd:m:jjjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd:m:jjjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhLcbhKindndnaQabaXcdtfgYydbgCc:v;t;h;Ev2aLGgOcdtfgAydbgHcuSmbceheinazaHcdtfydbaCSmdaOaefhHaecefheaQaHaLGgOcdtfgAydbgHcu9hmbkkazaKcdtfaCBdbaAaKBdbaKhHaKcefhKkaYaHBdbaXcefgXad9hmbkkaQcbyd1:jjjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd:m:jjjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd:m:jjjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd:m:jjjbHjjjjbbhLascxfasyd2gecdtfaLBdbasaecefBd2a5cbyd:m:jjjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhYcuaecdtgOaecFFFFi0Ecbyd:m:jjjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnalTmbavcd4hCaecufhKinaYhednazTmbazaYcdtfydbhekaiaeaC2cdtfgeydlgHcH4aH7c:F:b:DD2aeydbgHcH4aH7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aKGhHaYcdth8FdndndnazTmbaQaHcdtfgAydbgecuSmeaiaza8FfydbaC2cdtfhXcehOinaiazaecdtfydbaC2cdtfaXcxz:ojjjbTmiaHaOfheaOcefhOaQaeaKGgHcdtfgAydbgecu9hmbxdkkaQaHcdtfgAydbgecuSmbaiaYaC2cdtfhXcehOinaiaeaC2cdtfaXcxz:ojjjbTmdaHaOfheaOcefhOaQaeaKGgHcdtfgAydbgecu9hmbkkaAaYBdbaYhekaLa8FfaeBdbaYcefgYal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaLhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaQcbyd1:jjjbH:bjjjbbasasyd2cufBd2alcbyd:m:jjjbHjjjjbbhKascxfasyd2gecdtfaKBdbasaecefBd2a5cbyd:m:jjjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd:m:jjjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhYcbhAindndna3aAcitfydbgQaO9hmbaYaOBdba8KaOBdbxekdna8AaQcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhXa8JaCfhHcbheinaXaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaQaeydbcuSEBdbaYaQaOaYydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaLhHa8EhOaghCahhAcbheindndnaeaHydbgQ9hmbdnaeaOydbgQ9hmbaAydbhQdnaCydbgXcu9hmbaQcu9hmbaKaefcb86bbxikaKaefhYdnaeaXSmbaeaQSmbaYce86bbxikaYcl86bbxdkdnaea8EaQcdtgXfydb9hmbdnaCydbgYcuSmbaeaYSmbaAydbg8FcuSmbaea8FSmbagaXfydbg3cuSmba3aQSmbahaXfydbgXcuSmbaXaQSmbdnaLaYcdtfydbgQaLaXcdtfydb9hmbaQaLa8FcdtfydbgXSmbaXaLa3cdtfydb9hmbaKaefcd86bbxlkaKaefcl86bbxikaKaefcl86bbxdkaKaefcl86bbxekaKaefaKaQfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaLhHalhOindnaqaeydbfRbbTmbaKaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaLhealhHindnaqRbbTmbaKaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaLhealhOaKhHindnaKaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaKhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd:m:jjjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd:m:jjjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hYdnazTmba8Jcdth8FcbhQayhXinaoazaQcdtfydbaY2cdtfhAasc;WbfheaXhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaXa8FfhXaQcefgQal9hmbxdkka8Jcdth8FcbhQayhXinaoaQaY2cdtfhAasc;WbfheaXhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaXa8FfhXaQcefgQal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd:m:jjjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd:m:jjjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd:m:jjjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgQcx2fgeIdbaaaHydbgXcx2fgOIdbg8P:tgIaaaHcwfydbgYcx2fgCIdlaOIdlg8R:tg8SNaCIdba8P:tgRaeIdla8R:tg8UN:tg8Va8VNa8UaCIdwaOIdwg8W:tg8XNa8SaeIdwa8W:tg8UN:tg8Sa8SNa8UaRNa8XaIN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8S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UdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaraicltfhQcbhHa8JhCinaQaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkara8LcltfhQcbhHa8JhCinaQaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaXcifgXad6mbkkcbhOxekcehOcbhrkcbh3dndnamcwGg9cmbJbbbbh8UcbhJcbhocbhCxekcbhea5cbyd:m:jjjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbh8Finaba8FcdtfhYcbhXinaLaYaXcdtgec;a1jjbfydbcdtfydbcdtfydbhHdnaCaLaYaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgQydbgeBdbaQhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgQydbgeBdbaQhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaXcefgXci9hmbka8Fcifg8Fad6mbkkcbhJdnalTmbcbhQindnaLaQcdtgefydbaQ9hmbaQhHdnaCaefgXydbgeaQSmbaXhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaXaHBdbkaQcefgQal9hmbkcbheaLhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd:m:jjjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhQinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgXaIaXIdbMUdbaHcwfgXa8SaXIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaQcufgQmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhQinaAaOydbcltfgHcxfgXaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaXIdbgIaIa8S9DEUdbaOclfhOaecxfheaQcufgQmbkkdnaJmbcbhJJFFuuh8UxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8UaAheaJhHinaeIdbg8Sa8Ua8Ua8S9EEh8UaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaKhHalhQcbhOincbaeydbgXaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaXhAaQcufgQmbkaOce4h3kcuada39RcifgTcx2aTc;v:Q;v:Qe0Ecbyd:m:jjjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd:m:jjjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd:m:jjjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd:m:jjjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaLz:cjjjbabh3cbhEcbh5inaba5cdtfhwcbheindnaLa3aefydbgOcdtg8FfydbgQaLawaec;q1jjbfydbcdtfydbgHcdtg8LfydbgXSmbaKaHfRbbgYcv2aKaOfR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ydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhAabhecbhQindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgXSmbaOaXSmbabaAcdtfgYaHBdbaYcwfaXBdbaYclfaOBdbaAcifhAkaecxfheaQcifgQad6mbkdndna9cTmbaAak9nmba8UaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgQaOBdbaQclfaeclfydbBdbaQcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaA6mbkJFFuuh8UaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8UaOEh8UaeclfheaHcufgHmbxdkkaAhdkadak0mbxdkkasclfabadalaLz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Uac9FmbadhOxekina8UJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgQaABdbaQclfaeclfydbBdbaQcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8UdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8UaAEh8UaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Uac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhLabheinaKaeydbgAfRbbc3thXaecwfgYydbhHdndnahaAcdtg3fydbaeclfg8FydbgCSmbcbhQagaCcdtfydbaA9hmekcjjjj94hQkaeaXaQVaAVBdbaKaCfRbbc3thXdndnahaCcdtfydbaHSmbcbhQagaHcdtfydbaC9hmekcjjjj94hQka8FaXaQVaCVBdbaKaHfRbbc3thQdndnahaHcdtfydbaASmbcbhCaga3fydbaH9hmekcjjjj94hCkaYaQaCVaHVBdbaecxfheaLcifgLaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd1:jjjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Qodvuv998Jjjjjbca9Rgvczfcwfcbyd11jjbBdbavcb8Pdj1jjb83izavcwfcbydN1jjbBdbavcb8Pd:m1jjb83ibdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavczfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdbavIdzgk:tgqaqJbbbb9DEgqavIdlavIdCgx:tgmamaq9DEgqavIdwavIdKgm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:DCoDud99rue99iul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd:m:jjjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd:m:jjjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd:m:jjjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbhPindna3axaPcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5aPcefgPad9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8EaD:Y:tg8Fa8EaK:Y:tgaa5:ZghaH:tNNNaOaH:taaNa8Aah:tNa8AaH:ta8FNahaO:tNM:va8EMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd:m:jjjbHjjjjbbg5BdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbhYindndndna3axaYcdtgKfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbcehiinaxaecdtgefydbaCSmdamaifheaicefhia3aeaAGgmcdtfgEydbgecu9hmbkkaEaYBdbaDhiaDcefhDxeka5aefydbhika5aKfaiBdbaYcefgYad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd:m:jjjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hKdnadTmbdnalTmbaKcdth3a5hCaqhealhmadhAinaEaCydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaecxfheama3fhmaAcufgAmbxdkka5hmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd:m:jjjbHjjjjbbgeBdaawcoBd2awaicbyd:m:jjjbHjjjjbbg3Bd8KaecFeaYz:ljjjbhxdnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8AaKcdthPalheina8Aaec;81jjbalEgmIdwaEa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndnaxaAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka5clfh5aqcxfhqaeaPfheadaCcefgC9hmbkkabaxaYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd1:jjjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Ydidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcifc98GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcrfc94GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:jjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:jjjbfgdBd:q:jjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:Iedbcjwk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc1Dkxebbbdbbb:GNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var y=new Uint8Array(f.length),x=0;x<f.length;++x){var S=f.charCodeAt(x);y[x]=S>96?S-97:S>64?S-39:S+4}for(var C=0,x=0;x<f.length;++x)y[C++]=y[x]<60?t[y[x]]:(y[x]-60)*64+y[++x];return y.buffer.slice(0,C)}function r(f){if(!f)throw new Error("Assertion failed")}function s(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}function a(f,y,x){var S=n.exports.sbrk,C=S(y.length*4),V=S(x*4),L=new Uint8Array(n.exports.memory.buffer),Z=s(y);L.set(Z,C);var E=f(V,C,y.length,x);L=new Uint8Array(n.exports.memory.buffer);var P=new Uint32Array(x);new Uint8Array(P.buffer).set(L.subarray(V,V+x*4)),Z.set(L.subarray(C,C+y.length*4)),S(C-S(0));for(var W=0;W<y.length;++W)y[W]=P[y[W]];return[P,E]}function c(f){for(var y=0,x=0;x<f.length;++x){var S=f[x];y=y<S?S:y}return y}function d(f,y,x,S,C,V,L,Z,E){var P=n.exports.sbrk,W=P(4),v=P(x*4),A=P(C*V),b=P(x*4),R=new Uint8Array(n.exports.memory.buffer);R.set(s(S),A),R.set(s(y),b);var G=f(v,b,x,A,C,V,L,Z,E,W);R=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(G);s(I).set(R.subarray(v,v+G*4));var w=new Float32Array(1);return s(w).set(R.subarray(W,W+4)),P(W-P(0)),[I,w[0]]}function u(f,y,x,S,C,V,L,Z,E,P,W,v,A){var b=n.exports.sbrk,R=b(4),G=b(x*4),I=b(C*V),w=b(C*Z),M=b(E.length*4),O=b(x*4),k=P?b(C):0,B=new Uint8Array(n.exports.memory.buffer);B.set(s(S),I),B.set(s(L),w),B.set(s(E),M),B.set(s(y),O),P&&B.set(s(P),k);var N=f(G,O,x,I,C,V,w,Z,M,E.length,k,W,v,A,R);B=new Uint8Array(n.exports.memory.buffer);var z=new Uint32Array(N);s(z).set(B.subarray(G,G+N*4));var K=new Float32Array(1);return s(K).set(B.subarray(R,R+4)),b(R-b(0)),[z,K[0]]}function h(f,y,x,S){var C=n.exports.sbrk,V=C(x*S),L=new Uint8Array(n.exports.memory.buffer);L.set(s(y),V);var Z=f(V,x,S);return C(V-C(0)),Z}function p(f,y,x,S,C,V,L,Z){var E=n.exports.sbrk,P=E(Z*4),W=E(x*S),v=E(x*V),A=new Uint8Array(n.exports.memory.buffer);A.set(s(y),W),C&&A.set(s(C),v);var b=f(P,W,x,S,v,V,L,Z);A=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(b);return s(R).set(A.subarray(P,P+b*4)),E(P-E(0)),R}var g={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(f){r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0);var y=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return a(n.exports.meshopt_optimizeVertexFetchRemap,y,c(f)+1)},simplify:function(f,y,x,S,C,V){r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),r(S>=0&&S<=f.length),r(S%3==0),r(C>=0);for(var L=0,Z=0;Z<(V?V.length:0);++Z)r(V[Z]in g),L|=g[V[Z]];var E=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),P=d(n.exports.meshopt_simplify,E,f.length,y,y.length/x,x*4,S,C,L);return P[0]=f instanceof Uint32Array?P[0]:new f.constructor(P[0]),P},simplifyWithAttributes:function(f,y,x,S,C,V,L,Z,E,P){r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),r(S instanceof Float32Array),r(S.length%C==0),r(C>=0),r(L==null||L instanceof Uint8Array),r(L==null||L.length==y.length/x),r(Z>=0&&Z<=f.length),r(Z%3==0),r(E>=0),r(Array.isArray(V)),r(C>=V.length),r(V.length<=32);for(var W=0;W<V.length;++W)r(V[W]>=0);for(var v=0,W=0;W<(P?P.length:0);++W)r(P[W]in g),v|=g[P[W]];var A=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),b=u(n.exports.meshopt_simplifyWithAttributes,A,f.length,y,y.length/x,x*4,S,C*4,new Float32Array(V),L?new Uint8Array(L):null,Z,E,v);return b[0]=f instanceof Uint32Array?b[0]:new f.constructor(b[0]),b},getScale:function(f,y){return r(f instanceof Float32Array),r(f.length%y==0),r(y>=3),h(n.exports.meshopt_simplifyScale,f,f.length/y,y*4)},simplifyPoints:function(f,y,x,S,C,V){return r(f instanceof Float32Array),r(f.length%y==0),r(y>=3),r(x>=0&&x<=f.length/y),S?(r(S instanceof Float32Array),r(S.length%C==0),r(C>=3),r(f.length/y==S.length/C),p(n.exports.meshopt_simplifyPoints,f,f.length/y,y*4,S,C*4,V,x)):p(n.exports.meshopt_simplifyPoints,f,f.length/y,y*4,void 0,0,0,x)}}}();var tGn=_(T()),$Zn=function(){var e="b9H79TebbbeVx9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gvuuuuueu9Gwuuuuuuuub9Gxuuuuuuuuuuuueu9Gkuuuuuuuuuu99eu9Gouuuuuub9Gruuuuuuub9GluuuubiOHdilvorwDDqkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;29zHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:w8KDPue99eux99dui99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:njjjb8Adndnalcb9imbaoal9nmbamcuaocdtaocFFFFi0Egscbyd:e1jjbHjjjjbbgzBd:CwamceBd;8wamascbyd:e1jjbHjjjjbbgHBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgOBd:KwamciBd;8waihsalhAinazasydbcdtfcbBdbasclfhsaAcufgAmbkaihsalhAinazasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkaihsalhCcbhXindnazasydbcdtgQfgAydbcb9imbaHaQfaXBdbaAaAydbgQcjjjj94VBdbaQaXfhXkasclfhsaCcufgCmbkalci9UhLdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhXaHaAydbcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaXcdtfgXaXydbgXcefBdbaOaXcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaihsalhAindnazasydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaHaCfgCaCydbaQ9RBdbkasclfhsaAcufgAmbxdkkamcuaocdtgsaocFFFFi0EgAcbyd:e1jjbHjjjjbbgzBd:CwamceBd;8wamaAcbyd:e1jjbHjjjjbbgHBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgOBd:KwamciBd;8wazcbasz:njjjbhXalci9UhLaihsalhAinaXasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkdnaoTmbcbhsaHhA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inascwfIdbgEayayaE9EEhyasclfIdbgEa8Ra8RaE9EEh8RasIdbgEa8Sa8SaE9EEh8SascKfhsaAcufgAmbkkahJbbbZNhgamaocetgscuaocu9kEcbyd:e1jjbHjjjjbbgABd:4waAcFeasz:njjjbhCdnaXmbcbhAJFFuuhEa8Ahscuh8PinascwfIdbay:tghahNasIdba8S:tghahNasclfIdba8R:tghahNMM:rghaEa8PcuSahaE9DVgXEhEaAa8PaXEh8PascKfhsaLaAcefgA9hmbkkamczfcbcjwz:njjjb8Aamcwf9cb83ibam9cb83ibagaxNhRJbbjZak:th8Ncbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YJbbbbh8ZJbbbbh80cbh81cbhPinJbbbbhEdna8UTmbJbbjZa8U:Z:vhEkJbbbbhhdna80a80Na8Ya8YNa8Za8ZNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8XaENh5a8WaENh8Fa8VaENhaa8PhQdndndndndna8UaPVTmbamydwgBTmea80ahNh8Ja8ZahNh8La8YahNh8Maeamydbcdtfh83cbh3JFFuuhEcvhXcuhQindnaza83a3cdtfydbcdtgsfydbgvTmbaOaHasfydbcdtfhAindndnaCaiaAydbgKcx2fgsclfydbgrcetf8Vebcs4aCasydbgLcetf8Vebcs4faCascwfydbglcetf8Vebcs4fgombcbhsxekcehsazaLcdtfydbgLceSmbcehsazarcdtfydbgrceSmbcehsazalcdtfydbglceSmbdnarcdSaLcdSfalcdSfcd6mbaocefhsxekaocdfhskdnasaX9kmba8AaKcK2fgLIdwa5:thhaLIdla8F:th8KaLIdbaa:th8EdndnakJbbbb9DTmba8E:lg8Ea8K:lg8Ka8Ea8K9EEg8Kah:lgha8Kah9EEag:vJbbjZMhhxekahahNa8Ea8ENa8Ka8KNMM:rag:va8NNJbbjZMJ9VO:d86JbbjZaLIdCa8JNaLIdxa8MNa8LaLIdzNMMakN:tghahJ9VO:d869DENhhkaKaQasaX6ahaE9DVgLEhQasaXaLEhXahaEaLEhEkaAclfhAavcufgvmbkka3cefg3aB9hmbkkaQcu9hmekama5Ud:ODama8FUd:KDamaaUd:GDamcuBd:qDamcFFF;7rBdjDaIcba8AaYamc:GDfakJbbbb9Damc:qDfamcjDfz:ejjjbamyd:qDhQdndnaxJbbbb9ETmba8UaD6mbaQcuSmeceh3amIdjDaR9EmixdkaQcu9hmekdna8UTmbdnamydlgza8Uci2fgsciGTmbadasfcba8Uazcu7fciGcefz:njjjb8AkabaPcltfgzam8Pib83dbazcwfamcwf8Pib83dbaPcefhPkc3hzinazc98Smvamc:Cwfazfydbcbydj1jjbH:bjjjbbazc98fhzxbkkcbh3a8Uaq9pmbamydwaCaiaQcx2fgsydbcetf8Vebcs4aCascwfydbcetf8Vebcs4faCasclfydbcetf8Vebcs4ffaw9nmekcbhscbhAdna81TmbcbhAamczfhXinamczfaAcdtfaXydbgLBdbaXclfhXaAaYaLfRbbTfhAa81cufg81mbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDaAc;8eaAclfc:bd6Eh81inamcjDfasfcFFF;7rBdbasclfgscz9hmbka81cdthBdnalTmbaeaXcdtfhocbhrindnazaoarcdtfydbcdtgsfydbgvTmbaOaHasfydbcdtfhAcuhLcuhsinazaiaAydbgKcx2fgXclfydbcdtfydbazaXydbcdtfydbfazaXcwfydbcdtfydbfgXasaXas6gXEhsaKaLaXEhLaAclfhAavcufgvmbkaLcuSmba8AaLcK2fgAIdway:tgEaENaAIdba8S:tgEaENaAIdla8R:tgEaENMM:rhEcbhAindndnasamc:qDfaAfgvydbgX6mbasaX9hmeaEamcjDfaAfIdb9FTmekavasBdbamc:GDfaAfaLBdbamcjDfaAfaEUdbxdkaAclfgAcz9hmbkkarcefgral9hmbkkamczfaBfhLcbhscbhAindnamc:GDfasfydbgXcuSmbaLaAcdtfaXBdbaAcefhAkasclfgscz9hmbkaAa81fg81TmbJFFuuhhcuhKamczfhsa81hvcuhLina8AasydbgXcK2fgAIdway:tgEaENaAIdba8S:tgEaENaAIdla8R:tgEaENMM:rhEdndnazaiaXcx2fgAclfydbcdtfydbazaAydbcdtfydbfazaAcwfydbcdtfydbfgAaL6mbaAaL9hmeaEah9DTmekaEhhaAhLaXhKkasclfhsavcufgvmbkaKcuSmbaKhQkdnamaiaQcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YJbbbbh8ZJbbbbh80kcbhXinaOaHaraXcdtfydbcdtgAfydbcdtfgKhsazaAfgvydbgLhAdnaLTmbdninasydbaQSmeasclfhsaAcufgATmdxbkkasaKaLcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaQcK2fgsIdbhEasIdlhhasIdwh8KasIdxh8EasIdzh5asIdCh8FaYaQfce86bba80a8FMh80a8Za5Mh8Za8Ya8EMh8Ya8Xa8KMh8Xa8WahMh8Wa8VaEMh8Vamydxh8Uxbkkamc:WDf8KjjjjbaPk;Vvivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbararydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark:;idiud99dndnabaecitfgwydlgDciGgqciSmbinabcbaDcd4gDalaqcdtfIdbawIdb:tgkJbbbb9FEgwaecefgefadaialavaoarz:ejjjbak:larIdb9FTmdabawaD7aefgecitfgwydlgDciGgqci9hmbkkabaecitfgeclfhbdnavmbcuhwindnaiaeydbgDfRbbmbadaDcK2fgqIdwalIdw:tgkakNaqIdbalIdb:tgkakNaqIdlalIdl:tgkakNMM:rgkarIdb9DTmbarakUdbaoaDBdbkaecwfheawcefgwabydbcd46mbxdkkcuhwindnaiaeydbgDfRbbmbadaDcK2fgqIdbalIdb:t:lgkaqIdlalIdl:t:lgxakax9EEgkaqIdwalIdw:t:lgxakax9EEgkarIdb9DTmbarakUdbaoaDBdbkaecwfheawcefgwabydbcd46mbkkk;llevudnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0abydxaq9pVakVgDce9hmbavawcltfgxab8Pdb83dbaxcwfabcwfgx8Pdb83dbdnaxydbgqTmbaoabydbcdtfhxaqhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkdnabydxglci2gsabydlgxfgkciGTmbarakfcbalaxcu7fciGcefz:njjjb8Aabydxci2hsabydlhxabydwhqkab9cb83dwababydbaqfBdbabascifc98GaxfBdlaP8Vebhscbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk8LbabaeadaialavaoarawaDaDaqJbbbbz:cjjjbk;Jkovud99euv99eul998Jjjjjbc:W;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:W:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaoc8Wfawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeaocbBd8Sao9cb83iKao9cb83izaoczfaoc8Wfawci2cxaoc8Sfcbz1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:W:qefawcxaoc8Sfcbz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:W:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:W:qefheaoc8WfhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabaxUd8KabasUdaabazUd3abaCaxaPN:tUdKabaXasaPN:tUdCabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabae86b8UdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabav86bRdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:W;aef8Kjjjjbk;Yodouk99cbho8Jjjjjbca9RgrczfcwfcbBdbar9cb83izarcwfcbBdbar9cb83ibavcd4hwaicd4hDdnadTmbaDcdthqaehkinalaoaw2cdtfIdbhxcbhvinarczfavfgiaoaiydbgiakavfIdbgmax:taeavaqai2ffIdbalaiaw2cdtfIdb:t9DEBdbaravfgiaoaiydbgiaxamMaeavaqai2ffIdbalaiaw2cdtfIdbM9EEBdbavclfgvcx9hmbkakaqfhkaocefgoad9hmbkkJbbbbhxcbhvcbhkcbhiinalaravfydbgoaw2cdtfIdbalarczfavfydbgqaw2cdtfIdbaeaoaD2cdtfgoIdwaeaqaD2cdtfgqIdw:tgmamNaoIdbaqIdb:tgmamNaoIdlaqIdl:tgmamNMM:rMMgmaxamax9EgoEhxaiakaoEhkavclfhvaicefgici9hmbkJbbbbhmdnaearakcdtgifydbgoaD2cdtfgvIdwaearczfaifydbgraD2cdtfgiIdwgP:tgsasNavIdbaiIdbgz:tgHaHNavIdlaiIdlgO:tgAaANMM:rgCJbbbb9ETmbaCalaoaw2cdtfIdbMalaraw2cdtfIdb:taCaCM:vhmkaxJbbbZNhCasamNaPMhPaAamNaOMhOaHamNazMhzdnadTmbaDcdthvawcdthiindnalIdbgXaecwfIdbaP:tgxaxNaeIdbaz:tgmamNaeclfIdbaO:tgsasNMM:rgHMgQaC9ETmbJbbbbhAdnaHJbbbb9ETmbaQaC:taHaHM:vhAkaAaxNaPMhPaAasNaOMhOaAamNazMhzaXaCaHMMJbbbZNhCkaeavfhealaifhladcufgdmbkkabaCUdxabaPUdwabaOUdlabazUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:3lequ8JjjjjbcjP9Rgl8Kjjjjbcbhvalcjxfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjxfaDcefRbbfRbb9RcFeGci6aoalcjxfaDRbbfRbb9RcFeGci6faoalcjxfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjxffaocefgo86bbaxalcjxffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjxffao86bbarcifhravcefgvad9hmbkalcFeaicetz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkcetfgw8UebgDcu9kmbawax87ebaocjlfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjlfaDz:mjjjb8AalcjPf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var y=new Uint8Array(f.length),x=0;x<f.length;++x){var S=f.charCodeAt(x);y[x]=S>96?S-97:S>64?S-39:S+4}for(var C=0,x=0;x<f.length;++x)y[C++]=y[x]<60?t[y[x]]:(y[x]-60)*64+y[++x];return y.buffer.slice(0,C)}function r(f){if(!f)throw new Error("Assertion failed")}function s(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}var a=48,c=16;function d(f,y){var x=f.meshlets[y*4+0],S=f.meshlets[y*4+1],C=f.meshlets[y*4+2],V=f.meshlets[y*4+3];return{vertices:f.vertices.subarray(x,x+C),triangles:f.triangles.subarray(S,S+V*3)}}function u(f,y,x,S,C,V,L){var Z=n.exports.sbrk,E=n.exports.meshopt_buildMeshletsBound(f.length,C,V),P=Z(E*c),W=Z(E*C*4),v=Z(E*V*3),A=Z(f.byteLength),b=Z(y.byteLength),R=new Uint8Array(n.exports.memory.buffer);R.set(s(f),A),R.set(s(y),b);var G=n.exports.meshopt_buildMeshlets(P,W,v,A,f.length,b,x,S,C,V,L);R=new Uint8Array(n.exports.memory.buffer);for(var I=R.subarray(P,P+G*c),w=new Uint32Array(I.buffer,I.byteOffset,I.byteLength/4).slice(),M=0;M<G;++M){var O=w[M*4+0],k=w[M*4+1],x=w[M*4+2],B=w[M*4+3];n.exports.meshopt_optimizeMeshlet(W+O*4,v+k,B,x)}var N=w[(G-1)*4+0],z=w[(G-1)*4+1],K=w[(G-1)*4+2],te=w[(G-1)*4+3],H=N+K,j=z+(te*3+3&-4),ee={meshlets:w,vertices:new Uint32Array(R.buffer,W,H).slice(),triangles:new Uint8Array(R.buffer,v,j*3).slice(),meshletCount:G};return Z(P-Z(0)),ee}function h(f){var y=new Float32Array(n.exports.memory.buffer,f,a/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(f,y,x,S){var C=n.exports.sbrk,V=[],L=C(y.byteLength),Z=C(f.vertices.byteLength),E=C(f.triangles.byteLength),P=C(a),W=new Uint8Array(n.exports.memory.buffer);W.set(s(y),L),W.set(s(f.vertices),Z),W.set(s(f.triangles),E);for(var v=0;v<f.meshletCount;++v){var A=f.meshlets[v*4+0],b=f.meshlets[v*4+0+1],R=f.meshlets[v*4+0+3];n.exports.meshopt_computeMeshletBounds(P,Z+A*4,E+b,R,L,x,S),V.push(h(P))}return C(L-C(0)),V}function g(f,y,x,S){var C=n.exports.sbrk,V=C(a),L=C(f.byteLength),Z=C(y.byteLength),E=new Uint8Array(n.exports.memory.buffer);E.set(s(f),L),E.set(s(y),Z),n.exports.meshopt_computeClusterBounds(V,L,f.length,Z,x,S);var P=h(V);return C(V-C(0)),P}return{ready:i,supported:!0,buildMeshlets:function(f,y,x,S,C,V){r(f.length%3==0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),r(S<=256||S>0),r(C<=512),r(C%4==0),V=V||0;var L=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return u(L,y,y.length/x,x*4,S,C,V)},computeClusterBounds:function(f,y,x){r(f.length%3==0),r(f.length/3<=512),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3);var S=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return g(S,y,y.length/x,x*4)},computeMeshletBounds:function(f,y,x){return r(f.meshletCount!=0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),p(f,y,y.length/x,x*4)},extractMeshlet:function(f,y){return r(y>=0&&y<f.meshletCount),d(f,y)}}}();function H_(e){e=e??Y.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,d=a.byteOffset,u=a.byteLength,h=!1,p,g,f,y;if(ci(a,"EXT_meshopt_compression")){let S=a.extensions.EXT_meshopt_compression;c=S.buffer,d=S.byteOffset??0,u=S.byteLength,h=!0,p=S.byteStride,g=S.count,f=S.mode,y=S.filter??"NONE"}let x=n.buffers[c];this._hasMeshopt=h,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=f,this._meshoptFilter=y,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=x,this._bufferId=c,this._byteOffset=d,this._byteLength=u,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=_t.UNLOADED,this._promise=void 0}l(Object.create)&&(H_.prototype=Object.create(Qi.prototype),H_.prototype.constructor=H_);Object.defineProperties(H_.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function bOe(e){try{let t=gOe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);fle.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=_t.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=_t.FAILED,e.getError("Failed to load buffer view",t)}}H_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=_t.LOADING,this._promise=bOe(this),this._promise)};function gOe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}H_.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var x1=H_;var PGn=_(T(),1);var TGn=_(T(),1);function Yr(){}Yr._maxDecodingConcurrency=Math.max(Ht.hardwareConcurrency-1,1);Yr._decoderTaskProcessor=void 0;Yr._taskProcessorReady=!1;Yr._error=void 0;Yr._getDecoderTaskProcessor=function(){if(!l(Yr._decoderTaskProcessor)){let e=new yi("decodeDraco",Yr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?Yr._taskProcessorReady=!0:Yr._error=new ce("Draco decoder could not be initialized.")}).catch(t=>{Yr._error=t}),Yr._decoderTaskProcessor=e}return Yr._decoderTaskProcessor};Yr.decodePointCloud=function(e){let t=Yr._getDecoderTaskProcessor();if(l(Yr._error))throw Yr._error;if(Yr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Yr.decodeBufferView=function(e){let t=Yr._getDecoderTaskProcessor();if(l(Yr._error))throw Yr._error;if(Yr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var xb=Yr;var VGn=_(T(),1);var li={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function yOe(e){switch(e){case li.POSITION:return"positionMC";case li.NORMAL:return"normalMC";case li.TANGENT:return"tangentMC";case li.TEXCOORD:return"texCoord";case li.COLOR:return"color";case li.JOINTS:return"joints";case li.WEIGHTS:return"weights";case li.FEATURE_ID:return"featureId"}}li.hasSetIndex=function(e){switch(e){case li.POSITION:case li.NORMAL:case li.TANGENT:return!1;case li.TEXCOORD:case li.COLOR:case li.JOINTS:case li.WEIGHTS:case li.FEATURE_ID:return!0}};li.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return li.POSITION;case"NORMAL":return li.NORMAL;case"TANGENT":return li.TANGENT;case"TEXCOORD":return li.TEXCOORD;case"COLOR":return li.COLOR;case"JOINTS":return li.JOINTS;case"WEIGHTS":return li.WEIGHTS;case"_FEATURE_ID":return li.FEATURE_ID}};li.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return li.POSITION;case"RGBA":case"RGB":case"RGB565":return li.COLOR;case"NORMAL":case"NORMAL_OCT16P":return li.NORMAL;case"BATCH_ID":return li.FEATURE_ID}};li.getGlslType=function(e){switch(e){case li.POSITION:case li.NORMAL:case li.TANGENT:return"vec3";case li.TEXCOORD:return"vec2";case li.COLOR:return"vec4";case li.JOINTS:return"ivec4";case li.WEIGHTS:return"vec4";case li.FEATURE_ID:return"int"}};li.getVariableName=function(e,t){let n=yOe(e);return l(t)&&(n+=`_${t}`),n};var yt=Object.freeze(li);function vg(e){e=e??Y.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.primitive,o=e.draco,r=e.gltfResource,s=e.baseResource,a=e.cacheKey;this._resourceCache=t,this._gltfResource=r,this._baseResource=s,this._gltf=n,this._primitive=i,this._draco=o,this._cacheKey=a,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=_t.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(vg.prototype=Object.create(Qi.prototype),vg.prototype.constructor=vg);Object.defineProperties(vg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function xOe(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=_t.PROCESSING,e)}catch(n){if(e.isDestroyed())return;ple(e,n)}}vg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=_t.LOADING,this._promise=xOe(this),this._promise)};function ple(e,t){throw e.unload(),e._state=_t.FAILED,e.getError("Failed to load Draco",t)}async function _Oe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=_t.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var K_={};K_[yt.POSITION]="POSITION";K_[yt.NORMAL]="NORMAL";K_[yt.COLOR]="COLOR";K_[yt.TEXCOORD]="TEX_COORD";function TOe(e){for(let t in K_)if(K_.hasOwnProperty(t)&&e.startsWith(t))return K_[t]}vg.prototype.process=function(e){if(this._state===_t.READY)return!0;if(this._state!==_t.PROCESSING||(l(this._dracoError)&&ple(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,n=this._primitive,i=this._gltf,o=i.bufferViews,r=t.bufferView,s=o[r],a=t.attributes,c=[];for(let h in n.attributes)if(n.attributes.hasOwnProperty(h)){let p=TOe(h);l(p)&&i.accessors[n.attributes[h]].componentType===Q.FLOAT&&(c.includes(p)||c.push(p))}let d={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:c},u=xb.decodeBufferView(d);if(!l(u))return!1;this._decodePromise=_Oe(this,u)};vg.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0};var _1=vg;var DGn=_(T(),1);function _b(e){e=e??Y.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,d=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=d,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=_t.UNLOADED,this._promise=void 0}l(Object.create)&&(_b.prototype=Object.create(Qi.prototype),_b.prototype.constructor=_b);Object.defineProperties(_b.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});_b.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=SOe(this),this._promise):(this._promise=COe(this),this._promise)};function ble(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 SOe(e){e._state=_t.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 LOe(i);if(e.isDestroyed())return;let r=ble(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=_t.READY,e}catch(n){return e.isDestroyed()?void 0:gle(e,n,"Failed to load embedded image")}}async function COe(e){e._state=_t.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await ZOe(i);if(e.isDestroyed())return;let r=ble(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=_t.READY,e}catch(o){return e.isDestroyed()?void 0:gle(e,o,`Failed to load image: ${n}`)}}function gle(e,t,n){return e.unload(),e._state=_t.FAILED,Promise.reject(e.getError(n,t))}function VOe(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 ce("Image format is not recognized")}async function LOe(e){let t=VOe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ll(n)}return _b._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var ROe=/(^data:image\/ktx2)|(\.ktx2$)/i;function ZOe(e){let t=e.getUrlComponent(!1,!0);return ROe.test(t)?Ll(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}_b.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};_b._loadImageFromTypedArray=qx;var T1=_b;var nEn=_(T(),1);var BGn=_(T(),1),GOe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Da=Object.freeze(GOe);function wg(e){e=e??Y.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,c=e.cacheKey,d=e.asynchronous??!0,u=e.loadBuffer??!1,h=e.loadTypedArray??!1,p=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=p,this._primitive=s,this._draco=a,this._cacheKey=c,this._asynchronous=d,this._loadBuffer=u,this._loadTypedArray=h,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=_t.UNLOADED,this._promise=void 0}l(Object.create)&&(wg.prototype=Object.create(Qi.prototype),wg.prototype.constructor=wg);Object.defineProperties(wg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var EOe=new BK;wg.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=IOe(this),this._promise):(this._promise=XOe(this),this._promise)};async function IOe(e){e._state=_t.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=_t.LOADED,e)}catch(n){if(e.isDestroyed())return;OK(e,n)}}async function XOe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=_t.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=WOe(e,a),e._state=_t.PROCESSING,e}catch(s){if(e.isDestroyed())return;OK(e,s)}}function WOe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ne.getSizeInBytes(s),c=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let h=r*a,p=new Uint8Array(c,d,h);c=new Uint8Array(p).buffer,d=0,Is("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Ne.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Ne.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Ne.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function OK(e,t){throw e.unload(),e._state=_t.FAILED,e.getError("Failed to load index buffer",t)}function BK(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}BK.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};BK.prototype.execute=function(){this.buffer=yle(this.typedArray,this.indexDatatype,this.context)};function yle(e,t,n){let i=Ct.createIndexBuffer({typedArray:e,context:n,usage:ke.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}wg.prototype.process=function(e){if(this._state===_t.READY)return!0;if(this._state!==_t.LOADED&&this._state!==_t.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=Q.fromTypedArray(t),this._indexDatatype=n)}catch(o){OK(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=EOe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Da.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=yle(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=_t.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};wg.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0};var S1=wg;var sWn=_(T(),1);var REn=_(T(),1);var oEn=_(T(),1);function POe(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var vs=POe;var uEn=_(T(),1);var aEn=_(T(),1);function vOe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var mr=vOe;function Qt(){}Qt.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}}};Qt.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}}};Qt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Qt.objectLegacy(i,n):Qt.object(i,n)};Qt.accessor=function(e,t){return Qt.topLevel(e,"accessors",t)};Qt.accessorWithSemantic=function(e,t,n){let i={};return Qt.mesh(e,function(o){return Qt.meshPrimitive(o,function(r){let s=Qt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let d=n(a);if(l(d))return d}});return l(s)?s:Qt.meshPrimitiveTarget(r,function(a){return Qt.meshPrimitiveTargetAttribute(a,function(c,d){if(d.indexOf(t)===0&&!l(i[c])){i[c]=!0;let u=n(c);if(l(u))return u}})})})})};Qt.accessorContainingVertexAttributeData=function(e,t){let n={};return Qt.mesh(e,function(i){return Qt.meshPrimitive(i,function(o){let r=Qt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:Qt.meshPrimitiveTarget(o,function(s){return Qt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};Qt.accessorContainingIndexData=function(e,t){let n={};return Qt.mesh(e,function(i){return Qt.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let s=t(r);if(l(s))return s}})})};Qt.animation=function(e,t){return Qt.topLevel(e,"animations",t)};Qt.animationChannel=function(e,t){let n=e.channels;return Qt.object(n,t)};Qt.animationSampler=function(e,t){let n=e.samplers;return Qt.object(n,t)};Qt.buffer=function(e,t){return Qt.topLevel(e,"buffers",t)};Qt.bufferView=function(e,t){return Qt.topLevel(e,"bufferViews",t)};Qt.camera=function(e,t){return Qt.topLevel(e,"cameras",t)};Qt.image=function(e,t){return Qt.topLevel(e,"images",t)};Qt.material=function(e,t){return Qt.topLevel(e,"materials",t)};Qt.materialValue=function(e,t){let n=e.values;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}};Qt.mesh=function(e,t){return Qt.topLevel(e,"meshes",t)};Qt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(l(s))return s}}};Qt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Qt.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}}};Qt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};Qt.node=function(e,t){return Qt.topLevel(e,"nodes",t)};Qt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let d=a.children;if(l(d)&&(c=Qt.nodeInTree(e,d,n),l(c)))return c}}}};Qt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Qt.nodeInTree(e,i,n)};Qt.program=function(e,t){return mr(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.programs,t):Qt.topLevel(e,"programs",t)};Qt.sampler=function(e,t){return Qt.topLevel(e,"samplers",t)};Qt.scene=function(e,t){return Qt.topLevel(e,"scenes",t)};Qt.shader=function(e,t){return mr(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.shaders,t):Qt.topLevel(e,"shaders",t)};Qt.skin=function(e,t){return Qt.topLevel(e,"skins",t)};Qt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(l(s))return s}}};Qt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Qt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Qt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Qt.technique=function(e,t){return mr(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.techniques,t):Qt.topLevel(e,"techniques",t)};Qt.texture=function(e,t){return Qt.topLevel(e,"textures",t)};var We=Qt;var yEn=_(T(),1);var hEn=_(T(),1);function wOe(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 Gd=wOe;function FOe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return Q.getSizeInBytes(t.componentType)*Gd(t.type)}var Nl=FOe;function AOe(e){We.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),We.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),We.mesh(e,function(n){We.meshPrimitive(n,function(i){if(i.mode=i.mode??ie.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=vs(e.materials,o)}})}),We.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,l(o)){let r=e.bufferViews[o];r.byteStride=Nl(e,i),r.target=ie.ARRAY_BUFFER}}),We.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ie.ELEMENT_ARRAY_BUFFER}}),We.material(e,function(n){let i=n.extensions??Y.EMPTY_OBJECT,o=i.KHR_materials_common;if(l(o)){let c=o.technique,d=l(o.values)?o.values:{};o.values=d,d.ambient=l(d.ambient)?d.ambient:[0,0,0,1],d.emission=l(d.emission)?d.emission:[0,0,0,1],d.transparency=d.transparency??1,c!=="CONSTANT"&&(d.diffuse=l(d.diffuse)?d.diffuse:[0,0,0,1],c!=="LAMBERT"&&(d.specular=l(d.specular)?d.specular:[0,0,0,1],d.shininess=d.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;l(r)&&We.materialValue(n,function(c){l(c.index)&&J_(c)}),J_(n.emissiveTexture),J_(n.normalTexture),J_(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,J_(s.baseColorTexture),J_(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,J_(a.specularGlossinessTexture))}),We.animation(e,function(n){We.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=MOe(e);return We.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]}),We.sampler(e,function(n){n.wrapS=n.wrapS??ie.REPEAT,n.wrapT=n.wrapT??ie.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function MOe(e){let t={};return We.animation(e,function(n){We.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function J_(e){l(e)&&(e.texCoord=e.texCoord??0)}var oW=AOe;var IEn=_(T(),1);function NOe(e){return We.shader(e,function(t){Xk(t)}),We.buffer(e,function(t){Xk(t)}),We.image(e,function(t){Xk(t)}),Xk(e),e}function Xk(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Fg=NOe;var YEn=_(T(),1);var AEn=_(T(),1);var PEn=_(T(),1);function kOe(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 rW=kOe;function UOe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),rW(e,t),n.length===0&&delete e.extensionsUsed}}var Q_=UOe;var DOe=4;function OOe(e){if(Dm(e)!=="glTF")throw new ce("File is not valid binary glTF");let n=xle(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ce("Binary glTF version is not 1 or 2");return i===1?BOe(e,n):YOe(e,n)}function xle(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*DOe,!0);return o}function BOe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new ce("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Xl(e,r,i),c=JSON.parse(a);Fg(c);let d=e.subarray(s,n),u=c.buffers;if(l(u)&&Object.keys(u).length>0){let h=u.binary_glTF??u.KHR_binary_glTF;l(h)&&(h.extras._pipeline.source=d,delete h.uri)}return Q_(c,"KHR_binary_glTF"),c}function YOe(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=xle(e,i,2),a=s[0],c=s[1];i+=8;let d=e.subarray(i,i+a);if(i+=a,c===1313821514){let u=Xl(d);o=JSON.parse(u),Fg(o)}else c===5130562&&(r=d)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var sW=OOe;var JEn=_(T(),1);function zOe(e){return We.shader(e,function(t){Wk(t)}),We.buffer(e,function(t){Wk(t)}),We.image(e,function(t){Wk(t)}),Wk(e),e}function Wk(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var aW=zOe;var GXn=_(T(),1);var $En=_(T(),1);function HOe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),vs(n,t,!0)}var ku=HOe;var lIn=_(T(),1);var nIn=_(T(),1);function KOe(e){switch(e){case Q.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case Q.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case Q.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case Q.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case Q.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case Q.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case Q.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case Q.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var Tb=KOe;function JOe(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Gd(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],d=c.buffer,h=i[d].extras._pipeline.source,p=t.count,g=Nl(e,t),f=t.byteOffset+c.byteOffset+h.byteOffset,y=t.componentType,x=Q.getSizeInBytes(y),S=new DataView(h.buffer),C=new Array(r),V=Tb(y);for(let L=0;L<p;L++){V(S,f,r,x,C);for(let Z=0;Z<r;Z++){let E=C[Z];s[Z]=Math.min(s[Z],E),a[Z]=Math.max(a[Z],E)}f+=g}return{min:s,max:a}}var j_=JOe;var pIn=_(T(),1);var QOe=[ie.FUNC_ADD,ie.FUNC_ADD],jOe=[ie.ONE,ie.ZERO,ie.ONE,ie.ZERO];function _le(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var qOe=[ie.ZERO,ie.ONE,ie.SRC_COLOR,ie.ONE_MINUS_SRC_COLOR,ie.SRC_ALPHA,ie.ONE_MINUS_SRC_ALPHA,ie.DST_ALPHA,ie.ONE_MINUS_DST_ALPHA,ie.DST_COLOR,ie.ONE_MINUS_DST_COLOR];function $Oe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(qOe.indexOf(e[n])===-1)return t;return e}function e3e(e){let t={},n={},i=e.techniques;return l(i)&&(We.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(_le(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??QOe,blendFactors:$Oe(c.blendFuncSeparate,jOe)})}_le(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),ku(e,"KHR_blend")),We.material(e,function(o){if(l(o.technique)){let r=n[o.technique];We.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var cW=e3e;var ZIn=_(T(),1);var _In=_(T(),1);function t3e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),vs(n,t,!0),ku(e,t)}var lW=t3e;function n3e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,We.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(We.techniqueAttribute(a,function(h,p){u=a.parameters[h],d.attributes[p]={semantic:u.semantic}}),We.techniqueUniform(a,function(h,p){u=a.parameters[h],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},l(n[c])||(n[c]={}),n[c][h]=p}),l(o[a.program]))d.program=o[a.program];else{let h=e.programs[a.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[h.fragmentShader];p.fragmentShader=vs(r.shaders,g,!0);let f=e.shaders[h.vertexShader];p.vertexShader=vs(r.shaders,f,!0),d.program=vs(r.programs,p),o[a.program]=d.program}i[c]=vs(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,ku(e,"KHR_techniques_webgl"),lW(e,"KHR_techniques_webgl"))}return We.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};We.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var dW=n3e;var MIn=_(T(),1);var WIn=_(T(),1);function i3e(e,t){To.typeOf.object("material",e),To.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,d=t(c.index,c);if(l(d))return d}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,d=t(c.index,c);if(l(d))return d}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:d}=s;if(l(c)){let u=t(c.index,c);if(l(u))return u}if(l(d)){let u=t(d.index,d);if(l(u))return u}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:d,emission:u,specular:h}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(h)&&l(h.index)){let p=t(h.index,h);if(l(p))return p}}}let o=We.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var C1=i3e;var Tle=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function o3e(e,t){return t=t??Tle,Tle.forEach(function(n){t.indexOf(n)>-1&&s3e(e,n)}),e}var r3e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function s3e(e,t){let n=r3e[t],i=e[n];if(l(i)){let o=0,r=Zf[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(Rf[t](e,a-o),o++)}}function Rf(){}Rf.accessor=function(e,t){e.accessors.splice(t,1),We.mesh(e,function(i){We.meshPrimitive(i,function(o){We.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),We.meshPrimitiveTarget(o,function(a){We.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),We.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),We.animation(e,function(i){We.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Rf.buffer=function(e,t){e.buffers.splice(t,1),We.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--})};Rf.bufferView=function(e,t){if(e.bufferViews.splice(t,1),We.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),We.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),We.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),mr(e,"KHR_draco_mesh_compression")&&We.mesh(e,function(i){We.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--})}),mr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.bufferView)&&d.bufferView>t&&d.bufferView--,l(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,l(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(mr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let d in c)if(c.hasOwnProperty(d)){let u=c[d];l(u.values)&&u.values>t&&u.values--,l(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,l(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};Rf.image=function(e,t){e.images.splice(t,1),We.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})};Rf.mesh=function(e,t){e.meshes.splice(t,1),We.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Rf.node=function(e,t){e.nodes.splice(t,1),We.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})}),We.animation(e,function(i){We.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),We.technique(e,function(i){We.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),We.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}))}),We.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Rf.material=function(e,t){e.materials.splice(t,1),We.mesh(e,function(i){We.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Rf.sampler=function(e,t){e.samplers.splice(t,1),We.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Rf.texture=function(e,t){if(e.textures.splice(t,1),We.material(e,function(i){C1(i,function(o,r){r.index>t&&--r.index})}),mr(e,"EXT_feature_metadata")){We.mesh(e,function(r){We.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let h=0;h<u;++h){let g=d[h].featureIds.texture;g.index>t&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c].texture;u.index>t&&--u.index}}}}if(mr(e,"EXT_mesh_features")&&We.mesh(e,function(i){We.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;d<c;++d){let u=a[d];l(u.texture)&&u.texture.index>t&&--u.texture.index}}}})}),mr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let d in c)if(c.hasOwnProperty(d)){let u=c[d];u.index>t&&--u.index}}}}};function Zf(){}Zf.accessor=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){We.meshPrimitiveAttribute(i,function(r){t[r]=!0}),We.meshPrimitiveTarget(i,function(r){We.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),We.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),We.animation(e,function(n){We.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),mr(e,"EXT_mesh_gpu_instancing")&&We.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})}),mr(e,"CESIUM_primitive_outline")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Zf.buffer=function(e){let t={};return We.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};Zf.bufferView=function(e){let t={};if(We.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),We.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),We.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),mr(e,"KHR_draco_mesh_compression")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),mr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(mr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.values)&&(t[d.values]=!0),l(d.arrayOffsets)&&(t[d.arrayOffsets]=!0),l(d.stringOffsets)&&(t[d.stringOffsets]=!0)}}}}return t};Zf.image=function(e){let t={};return We.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};Zf.mesh=function(e){let t={};return We.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 Sle(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!Sle(e,o,n)}).length===0}Zf.node=function(e){let t={};return We.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),We.skinJoint(n,function(i){t[i]=!0})}),We.animation(e,function(n){We.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),We.technique(e,function(n){We.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),We.node(e,function(n,i){Sle(e,i,t)||(t[i]=!0)}),t};Zf.material=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Zf.texture=function(e){let t={};if(We.material(e,function(n){C1(n,function(i){t[i]=!0})}),mr(e,"EXT_feature_metadata")){We.mesh(e,function(o){We.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;u<d;++u){let p=c[u].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].texture;t[d.index]=!0}}}}if(mr(e,"EXT_mesh_features")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let d=s[c];l(d.texture)&&(t[d.texture.index]=!0)}}}})}),mr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];t[d.index]=!0}}}}return t};Zf.sampler=function(e){let t={};return We.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var uW=o3e;var tXn=_(T(),1);var UIn=_(T(),1);function a3e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:vs(e.buffers,n),byteOffset:0,byteLength:t.length};return vs(e.bufferViews,o)}var mW=a3e;var KIn=_(T(),1);function c3e(e,t){let n=Nl(e,t),i=Q.getSizeInBytes(t.componentType),o=Gd(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,d=t.byteOffset+a.byteOffset+c.byteOffset,u=new DataView(c.buffer),h=new Array(o),p=Tb(t.componentType);for(let g=0;g<r;++g){p(u,d,o,i,h);for(let f=0;f<o;++f)s[g*o+f]=h[f];d+=n}return s}var hW=c3e;function l3e(e){let t;return We.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ie.BYTE?Pk(e,i,Q.UNSIGNED_BYTE):t!==ie.UNSIGNED_BYTE&&t!==ie.UNSIGNED_SHORT&&Pk(e,i,Q.UNSIGNED_SHORT)}),We.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ie.BYTE?Pk(e,i,Q.UNSIGNED_BYTE):t===ie.SHORT&&Pk(e,i,Q.UNSIGNED_SHORT)}),e}function Pk(e,t,n){let i=Q.createTypedArray(n,hW(e,t)),o=new Uint8Array(i.buffer);t.bufferView=mW(e,o),t.componentType=n,t.byteOffset=0}var fW=l3e;var sXn=_(T(),1);function d3e(e,t){return Q_(e,t),t==="CESIUM_RTC"&&u3e(e),YK(e,t)}function u3e(e){We.technique(e,function(t){We.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function YK(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)YK(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)&&YK(e[o],t);return i}}var q_=d3e;var vk={.8:g3e,"1.0":M3e,"2.0":void 0};function m3e(e,t){t=t??Y.EMPTY_OBJECT;let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(vk,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(vk,i)||(i="1.0"));let o=vk[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=vk[i];return t.keepLegacyExtensions||(U3e(e,t),D3e(e)),e}function Lle(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 h3e(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.primitive??ie.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function f3e(e){let t=e.nodes,n=new m,i=new we;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;m.fromArray(a,0,n),we.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;l(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function p3e(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new m,a=new we;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let d=t[c],u=d.channels,h=d.parameters,p=d.samplers;if(l(u)){let g=u.length;for(let f=0;f<g;++f){let y=u[f];if(y.target.path==="rotation"){let x=h[p[y.sampler].output];if(l(r[x]))continue;r[x]=!0;let S=n[x],C=i[S.bufferView],L=o[C.buffer].extras._pipeline.source,Z=L.byteOffset+C.byteOffset+S.byteOffset,E=S.componentType,P=S.count,W=Gd(S.type),v=S.count*W,A=Q.createArrayBufferView(E,L.buffer,Z,v);for(let b=0;b<P;b++){let R=b*W;m.unpack(A,R,s);let G=A[R+3];we.fromAxisAngle(s,G,a),we.pack(a,A,R)}}}}}}function b3e(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function g3e(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,Lle(e),h3e(e),f3e(e),p3e(e),b3e(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,ku(e,"KHR_materials_common")}}function y3e(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function Cle(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 x3e(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,l(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=Cle(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),We.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),We.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),We.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),We.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),We.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),We.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),We.mesh(e,function(s){We.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),We.meshPrimitiveAttribute(a,function(c,d){a.attributes[d]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),We.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,d=c.length;if(d>0)for(s.mesh=n.meshes[c[0]],t=1;t<d;++t){let u={mesh:n.meshes[c[t]]},h=vs(e.nodes,u);l(a)||(a=[],s.children=a),a.push(h)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),We.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t<d;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),We.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),We.animation(e,function(s){let a={};s.samplers=Cle(s.samplers,a),We.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),We.animationChannel(s,function(c){c.sampler=a[c.sampler];let d=c.target;l(d)&&(d.node=n.nodes[d.id],delete d.id)})}),We.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),We.materialValue(s,function(c,d){typeof c=="string"&&(s.values[d]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&We.materialValue(c,function(d,u){typeof d=="string"&&(c.values[u]={index:n.textures[d]})})}}),We.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),We.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function _3e(e){We.animation(e,function(t){We.animationSampler(t,function(n){delete n.name})})}function T3e(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}We.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function S3e(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var C3e={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function V3e(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(C3e[o])&&e.extensionsRequired.push(o)}}}function L3e(e){We.buffer(e,function(t){delete t.type})}function R3e(e){We.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function Z3e(e){We.mesh(e,function(t){We.meshPrimitive(t,function(n){We.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),We.technique(e,function(t){We.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var G3e={POSITION:!0,NORMAL:!0,TANGENT:!0},E3e={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function I3e(e){let t={};We.mesh(e,function(n){We.meshPrimitive(n,function(i){We.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=E3e[a];l(u)?(d=u+c,t[r]=d):l(G3e[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),We.technique(e,function(n){We.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function X3e(e){We.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 HK(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Nl(e,t)}function W3e(e){We.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),We.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=HK(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function P3e(e){let t,n,i,o=e.bufferViews,r={};We.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};We.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let d=0,u=0,h=c.length;for(t=0;t<h;++t){let p=c[t],g=HK(e,p),f=p.byteOffset,y=p.count*g;delete p.byteStride;let x=t<h-1,S=x?HK(e,c[t+1]):void 0;if(g!==S){let C=Be(i,!0);r[a]&&(C.byteStride=g),C.byteOffset+=d,C.byteLength=f+y-d;let V=vs(o,C);for(n=u;n<=t;++n)p=c[n],p.bufferView=V,p.byteOffset=p.byteOffset-d;d=x?c[t+1].byteOffset:void 0,u=t+1}}}uW(e,["accessor","bufferView","buffer"])}function v3e(e){We.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=j_(e,n);n.min=i.min,n.max=i.max}})}function Rle(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||m.fromArray(e.translation).equals(m.ZERO))&&(!l(e.scale)||m.fromArray(e.scale).equals(new m(1,1,1)))&&(!l(e.rotation)||re.fromArray(e.rotation).equals(new re(0,0,0,1)))&&(!l(e.matrix)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Zle(e,t){We.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}}}),We.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Rle(n)&&Zle(e,i))}}),delete e.nodes[t]}function w3e(e){return We.node(e,function(t,n){Rle(t)&&Zle(e,n)}),e}function F3e(e){We.animation(e,function(t){We.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=j_(e,i);i.min=o.min,i.max=o.max}})})}function A3e(e){We.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=j_(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function M3e(e){e.asset=e.asset??{},e.asset.version="2.0",Lle(e),y3e(e),w3e(e),x3e(e),_3e(e),S3e(e),V3e(e),W3e(e),P3e(e),v3e(e),F3e(e),A3e(e),L3e(e),R3e(e),Z3e(e),I3e(e),fW(e),X3e(e),cW(e),dW(e),T3e(e)}var N3e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],k3e=["u_diffuse","u_diffuse_mat"];function KK(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function JK(e){return l(e.index)}function QK(e){return Array.isArray(e)&&e.length===4}function Gle(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 U3e(e,t){t=t??Y.EMPTY_OBJECT;let n=t.baseColorTextureNames??N3e,i=t.baseColorFactorNames??k3e;We.material(e,function(o){We.materialValue(o,function(r,s){n.indexOf(s)!==-1&&JK(r)?(KK(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&QK(r)&&(KK(o),o.pbrMetallicRoughness.baseColorFactor=Gle(r))})}),q_(e,"KHR_techniques_webgl"),q_(e,"KHR_blend")}function zK(e,t){l(t)&&(QK(t)?e.pbrMetallicRoughness.baseColorFactor=Gle(t):JK(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Vle(e,t){l(t)&&(QK(t)?e.emissiveFactor=t.slice(0,3):JK(t)&&(e.emissiveTexture=t))}function D3e(e){We.material(e,function(t){let n=(t.extensions??Y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,d=n.transparent;KK(t),n.technique==="CONSTANT"?(ku(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},zK(t,s),zK(t,o)):(zK(t,r),Vle(t,o),Vle(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),q_(e,"KHR_materials_common")}var pW=m3e;var UXn=_(T(),1);function Tc(){}Tc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=`
|
|
|
${n.message}`);let o=new ce(i);return l(n)&&(o.stack=`Original stack:
|
|
|
${n.stack}
|
|
|
Handler stack:
|
|
|
${o.stack}`),o};Tc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:m.ZERO,l(e.rotation)?e.rotation:we.IDENTITY,l(e.scale)?e.scale:m.ONE)};Tc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Tc.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}};Tc.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}};Tc.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};Tc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=yt.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=an.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),d;return c&&(d=r?"vec4":an.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:d}};var O3e=new m,B3e=new m;Tc.getPositionMinMax=function(e,t,n){let i=Tc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=m.add(r,t,B3e),o=m.add(o,n,O3e)),{min:r,max:o}};Tc.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===vo.Y?n=F.clone(vo.Y_UP_TO_Z_UP,n):e===vo.X&&(n=F.clone(vo.X_UP_TO_Z_UP,n)),t===vo.Z&&(n=F.multiplyTransformation(n,vo.Z_UP_TO_X_UP,n)),n};var Y3e=new $;Tc.getCullFace=function(e,t){if(!Ae.isTriangles(t))return Ti.BACK;let n=F.getMatrix3(e,Y3e);return $.determinant(n)<0?Ti.FRONT:Ti.BACK};Tc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Tc.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};Tc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Tc.supportedExtensions[i])throw new ce(`Unsupported glTF Extension: ${i}`)}};var qt=Tc;function Ag(e){e=e??Y.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=_t.UNLOADED,this._promise=void 0}l(Object.create)&&(Ag.prototype=Object.create(Qi.prototype),Ag.prototype.constructor=Ag);Object.defineProperties(Ag.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});Ag.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=_t.LOADING,l(this._gltfJson)?(this._promise=Ele(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Ile(this,this._typedArray),this._promise):(this._promise=z3e(this),this._promise))};async function z3e(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;jK(e,n)}return Ile(e,t)}function jK(e,t){e.unload(),e._state=_t.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function H3e(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!mr(t,"KHR_techniques_webgl")&&!mr(t,"KHR_materials_common"))return Promise.resolve();let n=[];We.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),pW(t)}function K3e(e){let t=[];return We.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&xp(i)&&(delete n.uri,t.push(Re.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function J3e(e,t){let n=[];return We.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function Ele(e,t){try{Fg(t),await K3e(t),await H3e(e,t),oW(t),await J3e(e,t),aW(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new ce(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&qt.checkSupportedExtensions(i),e._gltf=t,e._state=_t.READY,e}catch(n){if(e.isDestroyed())return;jK(e,n)}}async function Ile(e,t){let n;try{Dm(t)==="glTF"?n=sW(t):n=Qo(t)}catch(i){if(e.isDestroyed())return;jK(e,i)}return Ele(e,n)}Ag.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};Ag.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var V1=Ag;var kWn=_(T(),1);var RWn=_(T(),1);var pWn=_(T(),1);var cWn=_(T(),1),Q3e={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Gf=Object.freeze(Q3e);var Zo={};function j3e(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function q3e(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function $3e(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function eBe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function tBe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function nBe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function iBe(){this.attributes=[]}function oBe(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function rBe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function sBe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function aBe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function cBe(){this.nodes=[]}var lBe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function dBe(){this.input=[],this.interpolation=void 0,this.output=[]}function uBe(){this.node=void 0,this.path=void 0}function mBe(){this.sampler=void 0,this.target=void 0}function hBe(){this.name=void 0,this.samplers=[],this.channels=[]}function fBe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function pBe(){this.name=void 0,this.stages=[]}function Xle(){this.credits=[]}function bBe(){this.asset=new Xle,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=F.clone(F.IDENTITY),this.extensions={}}function gBe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0}function Mg(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=re.clone(Mg.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Mg.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Mg.DEFAULT_ROUGHNESS_FACTOR}Mg.DEFAULT_BASE_COLOR_FACTOR=re.ONE;Mg.DEFAULT_METALLIC_FACTOR=1;Mg.DEFAULT_ROUGHNESS_FACTOR=1;function $_(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=re.clone($_.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=m.clone($_.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=$_.DEFAULT_GLOSSINESS_FACTOR}$_.DEFAULT_DIFFUSE_FACTOR=re.ONE;$_.DEFAULT_SPECULAR_FACTOR=m.ONE;$_.DEFAULT_GLOSSINESS_FACTOR=1;function bW(){this.specularFactor=bW.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=m.clone(bW.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}bW.DEFAULT_SPECULAR_FACTOR=1;bW.DEFAULT_SPECULAR_COLOR_FACTOR=m.ONE;function gW(){this.anisotropyStrength=gW.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=gW.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}gW.DEFAULT_ANISOTROPY_STRENGTH=0;gW.DEFAULT_ANISOTROPY_ROTATION=0;function yW(){this.clearcoatFactor=yW.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=yW.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}yW.DEFAULT_CLEARCOAT_FACTOR=0;yW.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function qK(){this.metallicRoughness=new Mg,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=m.clone(qK.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Gf.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}qK.DEFAULT_EMISSIVE_FACTOR=m.ZERO;Zo.Quantization=j3e;Zo.Attribute=q3e;Zo.Indices=$3e;Zo.FeatureIdAttribute=eBe;Zo.FeatureIdTexture=nBe;Zo.FeatureIdImplicitRange=tBe;Zo.MorphTarget=iBe;Zo.Primitive=oBe;Zo.Instances=rBe;Zo.Skin=sBe;Zo.Node=aBe;Zo.Scene=cBe;Zo.AnimatedPropertyType=Object.freeze(lBe);Zo.AnimationSampler=dBe;Zo.AnimationTarget=uBe;Zo.AnimationChannel=mBe;Zo.Animation=hBe;Zo.ArticulationStage=fBe;Zo.Articulation=pBe;Zo.Asset=Xle;Zo.Components=bBe;Zo.TextureReader=gBe;Zo.MetallicRoughness=Mg;Zo.SpecularGlossiness=$_;Zo.Specular=bW;Zo.Anisotropy=gW;Zo.Clearcoat=yW;Zo.Material=qK;var Vn=Zo;var wk={};wk.getImageIdFromTexture=function(e){e=e??Y.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};wk.createSampler=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=Ln.REPEAT,r=Ln.REPEAT,s=en.LINEAR,a=fi.LINEAR,c=n.index,u=t.textures[c].sampler;if(l(u)){let h=t.samplers[u];o=h.wrapS??o,r=h.wrapT??r,s=h.minFilter??s,a=h.magFilter??a}return i&&s!==en.LINEAR&&s!==en.NEAREST&&(s===en.NEAREST_MIPMAP_NEAREST||s===en.NEAREST_MIPMAP_LINEAR?s=en.NEAREST:s=en.LINEAR),new tn({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var yBe=new U(1,1);wk.createModelTextureReader=function(e){e=e??Y.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,o=t.texCoord??0,r,s=t.extensions?.KHR_texture_transform;if(l(s)){o=s.texCoord??o;let c=l(s.offset)?U.unpack(s.offset):U.ZERO,d=s.rotation??0,u=l(s.scale)?U.unpack(s.scale):yBe;d=-d,r=new $(Math.cos(d)*u.x,-Math.sin(d)*u.y,c.x,Math.sin(d)*u.x,Math.cos(d)*u.y,c.y,0,0,1)}let a=new Vn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var kl=wk;function Ng(e){e=e??Y.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=e.asynchronous??!0,d=i.index,u=kl.getImageIdFromTexture({gltf:n,textureId:d,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=u,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=_t.UNLOADED,this._promise=void 0}l(Object.create)&&(Ng.prototype=Object.create(Qi.prototype),Ng.prototype.constructor=Ng);Object.defineProperties(Ng.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var xBe=new $K;async function _Be(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=_t.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=_t.FAILED,e.getError("Failed to load texture",n)}}Ng.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=_t.LOADING,this._promise=_Be(this),this._promise)};function $K(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}$K.prototype.set=function(e,t,n,i,o,r){this.gltf=e,this.textureInfo=t,this.textureId=n,this.image=i,this.mipLevels=o,this.context=r};$K.prototype.execute=function(){this.texture=Wle(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function Wle(e,t,n,i,o,r){let s=i.internalFormat,a=!1;ot.isCompressedFormat(s)&&!l(o)&&(a=!0);let c=kl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),d=c.minificationFilter,u=c.wrapS,h=c.wrapT,p=d===en.NEAREST_MIPMAP_NEAREST||d===en.NEAREST_MIPMAP_LINEAR||d===en.LINEAR_MIPMAP_NEAREST||d===en.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,f=g||u===Ln.REPEAT||u===Ln.MIRRORED_REPEAT||h===Ln.REPEAT||h===Ln.MIRRORED_REPEAT,y=!X.isPowerOfTwo(i.width)||!X.isPowerOfTwo(i.height),x=f&&y,S;return l(s)?(!r.webgl2&&ot.isCompressedFormat(s)&&y&&f&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),S=vt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(x&&(i=gg(i)),S=vt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&S.generateMipmap(),S}Ng.prototype.process=function(e){if(this._state===_t.READY)return!0;if(this._state!==_t.LOADED&&this._state!==_t.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=_t.PROCESSING;let t;if(this._asynchronous){let n=xBe;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Da.TEXTURE))return;t=n.texture}else t=Wle(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=_t.READY,this._resourceCache.statistics.addTextureLoader(this),!0};Ng.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var L1=Ng;var jWn=_(T(),1);function kg(e){e=e??Y.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.primitive,a=e.draco,c=e.attributeSemantic,d=e.accessorId,u=e.cacheKey,h=e.asynchronous??!0,p=e.loadBuffer??!1,g=e.loadTypedArray??!1;this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._primitive=s,this._draco=a,this._attributeSemantic=c,this._accessorId=d,this._cacheKey=u,this._asynchronous=h,this._loadBuffer=p,this._loadTypedArray=g,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=_t.UNLOADED,this._promise=void 0}l(Object.create)&&(kg.prototype=Object.create(Qi.prototype),kg.prototype.constructor=kg);Object.defineProperties(kg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function TBe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}kg.prototype.load=async function(){return l(this._promise)?this._promise:TBe(this._draco,this._attributeSemantic)?(this._promise=CBe(this),this._promise):(this._promise=LBe(this),this._promise)};function SBe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Vn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=an.VEC2,a.normalizationRange=r;else{let c=an.getMathType(i);if(c===Number){let d=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=d,a.normalizationRange=r,a.quantizedVolumeStepSize=d*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let d=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(d);let u=d.map(function(h){return h*s});a.quantizedVolumeStepSize=c.unpack(u)}}return a}async function CBe(e){e._state=_t.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=_t.LOADED,e)}catch{if(e.isDestroyed())return;eJ(e)}}function VBe(e){e._state=_t.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,d=o.data.quantization;l(d)&&(e._quantization=SBe(d,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function LBe(e){e._state=_t.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=_t.PROCESSING,e)}catch(n){if(e.isDestroyed())return;eJ(e,n)}}function eJ(e,t){throw e.unload(),e._state=_t.FAILED,e.getError("Failed to load vertex buffer",t)}function tJ(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}tJ.prototype.set=function(e,t){this.typedArray=e,this.context=t};tJ.prototype.execute=function(){this.buffer=Ple(this.typedArray,this.context)};function Ple(e,t){let n=Ct.createVertexBuffer({typedArray:e,context:t,usage:ke.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var RBe=new tJ;kg.prototype.process=function(e){if(this._state===_t.READY)return!0;if(this._state!==_t.LOADED&&this._state!==_t.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){eJ(this,i)}VBe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=RBe;if(i.set(n,e.context),!e.jobScheduler.execute(i,Da.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=Ple(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=_t.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};kg.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0};var R1=kg;var ZPn=_(T(),1);var _Pn=_(T(),1);var iPn=_(T(),1);function xW(e){e=e??Y.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=Be(e.extras,!0),this._extensions=Be(e.extensions,!0)}xW.fromJson=function(e){e=e??Y.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=Lf.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new xW({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(xW.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});xW.BATCH_TABLE_CLASS_NAME="_batchTable";var th=xW;var hPn=_(T(),1);var aPn=_(T(),1);function Fk(e){e=e??Y.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Be(e.extras,!0),this._extensions=Be(e.extensions,!0)}Fk.fromJson=function(e){return new Fk({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Fk.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 _W=Fk;function Ak(e){e=e??Y.EMPTY_OBJECT;let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=e.valueType??Mt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Be(e.extras,!0),this._extensions=Be(e.extensions,!0)}Ak.fromJson=function(e){e=e??Y.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(o){return _W.fromJson(o)});return new Ak({id:t,values:i,valueType:Mt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(Ak.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 TW=Ak;function Mk(e){e=e??Y.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=Be(e.extras,!0),this._extensions=Be(e.extensions,!0)}Mk.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=TW.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]=th.fromJson({id:i,class:e.classes[i],enums:t}));return new Mk({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Mk.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 Ed=Mk;function eT(e){e=e??Y.EMPTY_OBJECT;let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?Ed.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=_t.UNLOADED,this._promise=void 0}l(Object.create)&&(eT.prototype=Object.create(Qi.prototype),eT.prototype.constructor=eT);Object.defineProperties(eT.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});eT.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=ZBe(this),this._promise)};async function ZBe(e){let t=e._resource;e._state=_t.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Ed.fromJson(n),e._state=_t.READY,e)}catch(n){if(e.isDestroyed())return;e._state=_t.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}eT.prototype.unload=function(){this._schema=void 0};var Z1=eT;var vPn=_(T(),1);var nh={};function G1(e){return Qh(e.url)}function Nk(e){let{byteOffset:t,byteLength:n}=e;if(ci(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function GBe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function vle(e,t){return`${G1(e)}-buffer-id-${t}`}function SW(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return G1(o)}return vle(n,t)}function nJ(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=SW(a,s,n,i),d=Nk(r);return`${c}-range-${d}`}function wle(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let p=i.getDerivedResource({url:s});return G1(p)}let a=e.bufferViews[r],c=a.buffer,d=e.buffers[c],u=SW(d,c,n,i),h=Nk(a);return`${u}-range-${h}`}function EBe(e,t){let n=kl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}nh.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${G1(n)}`};nh.getExternalBufferCacheKey=function(e){e=e??Y.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${G1(t)}`};nh.getEmbeddedBufferCacheKey=function(e){e=e??Y.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${vle(t,n)}`};nh.getGltfCacheKey=function(e){e=e??Y.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${G1(t)}`};nh.getBufferViewCacheKey=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ci(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=SW(a,s,i,o),d=Nk(r);return`buffer-view:${c}-range-${d}`};nh.getDracoCacheKey=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${nJ(t,n,i,o)}`};nh.getVertexBufferCacheKey=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:c=!1,loadBuffer:d=!1,loadTypedArray:u=!1}=e,h="";if(c&&(h+="-dequantize"),d&&(h+="-buffer",h+=`-context-${o.context.id}`),u&&(h+="-typed-array"),l(s))return`vertex-buffer:${nJ(t,s,n,i)}-draco-${a}${h}`;let p=t.bufferViews[r],g=p.buffer,f=t.buffers[g],y=SW(f,g,n,i),x=Nk(p);return`vertex-buffer:${y}-range-${x}${h}`};nh.getIndexBufferCacheKey=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,d="";if(a&&(d+="-buffer",d+=`-context-${r.context.id}`),c&&(d+="-typed-array"),l(s))return`index-buffer:${nJ(t,s,i,o)}-draco${d}`;let u=t.accessors[n],h=u.bufferView,p=t.bufferViews[h],g=p.buffer,f=t.buffers[g],y=SW(f,g,i,o),x=GBe(u,p);return`index-buffer:${y}-accessor-${x}${d}`};nh.getImageCacheKey=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${wle(t,n,i,o)}`};nh.getTextureCacheKey=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=kl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),d=wle(t,c,i,o),u=EBe(t,n);return`texture:${d}-sampler-${u}-context-${s.context.id}`};var Ul=nh;var APn=_(T(),1);function CW(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}CW.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};CW.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};CW.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};CW.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 VW=CW;function Nn(){}Nn.cacheEntries={};Nn.statistics=new VW;function IBe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new IBe(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=e??Y.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=Ul.getSchemaCacheKey({schema:t,resource:n}),o=Nn.get(i);return l(o)?o:(o=new Z1({schema:t,resource:n,cacheKey:i}),Nn.add(o))};Nn.getEmbeddedBufferLoader=function(e){e=e??Y.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,o=Ul.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Nn.get(o);return l(r)?r:(r=new z_({typedArray:i,cacheKey:o}),Nn.add(r))};Nn.getExternalBufferLoader=function(e){e=e??Y.EMPTY_OBJECT;let{resource:t}=e,n=Ul.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new z_({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=e??Y.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=Ul.getGltfCacheKey({gltfResource:t}),s=Nn.get(r);return l(s)?s:(s=new V1({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Nn.add(s))};Nn.getBufferViewLoader=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=Ul.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Nn.get(r);return l(s)?s:(s=new x1({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Nn.add(s))};Nn.getDracoLoader=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e,s=Ul.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),a=Nn.get(s);return l(a)?a:(a=new _1({resourceCache:Nn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:s}),Nn.add(a))};Nn.getVertexBufferLoader=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:s,draco:a,attributeSemantic:c,accessorId:d,asynchronous:u=!0,dequantize:h=!1,loadBuffer:p=!1,loadTypedArray:g=!1}=e,f=Ul.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,attributeSemantic:c,dequantize:h,loadBuffer:p,loadTypedArray:g}),y=Nn.get(f);return l(y)?y:(y=new R1({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:s,draco:a,attributeSemantic:c,accessorId:d,cacheKey:f,asynchronous:u,dequantize:h,loadBuffer:p,loadTypedArray:g}),Nn.add(y))};Nn.getIndexBufferLoader=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:d=!1,loadTypedArray:u=!1}=e,h=Ul.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:d,loadTypedArray:u}),p=Nn.get(h);return l(p)?p:(p=new S1({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:s,draco:a,cacheKey:h,asynchronous:c,loadBuffer:d,loadTypedArray:u}),Nn.add(p))};Nn.getImageLoader=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=Ul.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Nn.get(r);return l(s)?s:(s=new T1({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Nn.add(s))};Nn.getTextureLoader=function(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=Ul.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),d=Nn.get(c);return l(d)?d:(d=new L1({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Nn.add(d))};Nn.clearForSpecs=function(){let e=[R1,S1,_1,L1,T1,x1,z_,Z1,V1],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var Li=Nn;function _a(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(_a.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}}});_a.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};_a.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};_a.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};_a.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};_a.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};_a.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};_a.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};_a.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===os.OCTREE&&(t=3),e>>t};_a.fromSubtreeJson=async function(e,t,n,i,o){let r=new _a(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=XBe(n);let a=s.json;r._subtreeJson=a;let c;if(ci(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let C=a.tileMetadata;c=a.propertyTables[C]}let d=[];if(l(a.contentMetadata)){let C=a.contentMetadata.length;for(let V=0;V<C;V++){let L=a.contentMetadata[V];d.push(a.propertyTables[L])}}let u,h=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let C=p.class,V=h.classes[C];u=new tW({subtreeMetadata:p,class:V})}r._metadata=u,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=d;let g={constant:0};a.contentAvailabilityHeaders=[],ci(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let f=WBe(a.buffers),y=PBe(a.bufferViews,f);vBe(a,y),l(c)&&Fle(c,y);for(let C=0;C<d.length;C++){let V=d[C];Fle(V,y)}let x=await wBe(r,f,s.binary),S=ABe(y,x);return MBe(r,a,i,S),l(c)&&(NBe(r,i,S),UBe(r)),kBe(r,i,S),DBe(r),r._ready=!0,r};function XBe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Qo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function WBe(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 PBe(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 vBe(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function Fle(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=r.values??r.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=r.stringOffsets??r.stringOffsetBufferView;l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=r.arrayOffsets??r.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function wBe(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=FBe(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function FBe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Li.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function ABe(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function MBe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=ci(t,"3DTILES_metadata"),d=l(e._tilePropertyTableJson),u=c||d;e._tileAvailability=iJ(t.tileAvailability,i,s,u);let h=e._contentPropertyTableJsons.length>0;u=u||h;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=iJ(t.contentAvailabilityHeaders[p],i,s,u);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=iJ(t.childSubtreeAvailability,i,a)}function iJ(e,t,n,i){if(l(e.constant))return new g1({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 g1({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function NBe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Nu({class:a,count:o,properties:i.properties,bufferViews:n})}function kBe(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],u=o[a].availableCount,h=c.class,p=r.classes[h],g=new Nu({class:p,count:u,properties:c.properties,bufferViews:n});s.push(g)}}function Ale(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 UBe(e){let t=Ale(e._tileAvailability);e._tileJumpBuffer=t}function DBe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Ale(o);t.push(r)}}_a.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new ce("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};_a.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new ce("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function OBe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function BBe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}_a.prototype.getTileMetadataView=function(e){let t=OBe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new y1({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};_a.prototype.getContentMetadataView=function(e,t){let n=BBe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new y1({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};_a.prototype.isDestroyed=function(){return!1};_a.prototype.destroy=function(){return l(this._bufferLoader)&&Li.unload(this._bufferLoader),me(this)};var tT=_a;var h2n=_(T(),1),YBe={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"},nT=Object.freeze(YBe);var b2n=_(T(),1);var ih={};ih.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:ih.parseBoundingVolumeSemantic("TILE",e),minimumHeight:ih._parseMinimumHeight("TILE",e),maximumHeight:ih._parseMaximumHeight("TILE",e)},content:{boundingVolume:ih.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:ih._parseMinimumHeight("CONTENT",e),maximumHeight:ih._parseMaximumHeight("CONTENT",e)}}};ih.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};ih._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};ih._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var iT=ih;function rl(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(rl.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}}});rl.fromSubtreeJson=async function(e,t,n,i,o,r){r=r??0;let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,d=await tT.fromSubtreeJson(n,i,s,a,c),u=new rl(e,t,n);return u._implicitSubtree=d,zBe(u,d),u._ready=!0,u};function zBe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=KBe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=HBe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],d=c.tile,u=iYe(e,d,c.childIndex);d.children.push(u),r.numberOfTilesTotal++}}function HBe(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function KBe(e,t,n,i){let s=Mle(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],d=[],u=e._implicitTileset;for(let h=1;h<u.subtreeLevels;h++){let p=t.getLevelOffset(h),g=u.branchingFactor*c.length;for(let f=0;f<g;f++){let y=p+f;if(!t.tileIsAvailableAtIndex(y)){d.push(void 0);continue}let x=t.getParentMortonIndex(f),S=c[x],C=f%u.branchingFactor,V=Mle(e,t,S,C,y);S.children.push(V),a.numberOfTilesTotal++,d.push(V)}c=d,d=[]}return{rootTile:s,bottomRow:c}}function Nle(e,t,n){let i=nT.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Mle(e,t,n,i,o,r){let s=e._implicitTileset,a;r??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,d,u;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let E=iT.parseAllBoundingVolumeSemantics(c);d=E.tile,u=E.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let E=0;E<p;E++)if(t.contentIsAvailableAtCoordinates(a,E)){g=!0;break}let f=jBe(s,a,i,r,n,d),y=[];for(let E=0;E<s.contentCount;E++){if(!t.contentIsAvailableAtIndex(o,E))continue;let v={uri:s.contentUriTemplates[E].getDerivedResource({templateValues:a.getTemplateValues()}).url},A=qBe(f,u);l(A)&&(v.boundingVolume=A),y.push(Rt(v,s.contentHeaders[E]))}let x=Nle(c,s,a),S={boundingVolume:f,geometricError:x,refine:s.refine,contents:y},C=!0,V=Be(s.tileHeader,C);delete V.boundingVolume,delete V.transform,delete V.metadata;let L=Rt(S,V,C),Z=Ble(e,s.baseResource,L,n);return Z.implicitCoordinates=a,Z.implicitSubtree=t,Z.metadata=c,Z.hasImplicitContentMetadata=g,Z}function kk(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ci(e,"3DTILES_bounding_volume_S2")||l(e.region))}function rJ(e,t){l(t)&&(ci(e,"3DTILES_bounding_volume_S2")?QBe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&JBe(e.region,t.minimumHeight,t.maximumHeight))}function JBe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function QBe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function jBe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!kk(r.boundingVolume,r)&&kk(e.boundingVolume,r)?s=kle(e,t,n,i??!1,o):s=r.boundingVolume,rJ(s,r),s}function qBe(e,t){let n;return l(t)&&(n=t.boundingVolume),kk(n,t)?rJ(n,t):kk(e,t)&&(n=Be(e,!0),rJ(n,t)),n}function kle(e,t,n,i,o){let r=e.boundingVolume;return ci(r,"3DTILES_bounding_volume_S2")?Ule(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:Ole(r.region,t.level,t.x,t.y,t.z)}:{box:Dle(r.box,t.level,t.x,t.y,t.z)}}function Ule(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:$p.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=c%2===0?UC.encode2D(i,o,r):UC.encode2D(i,r,o),u=$p.fromFacePositionLevel(c,BigInt(d),i),h,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;h=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else h=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:$p.getTokenFromId(u._cellId),minimumHeight:h,maximumHeight:p}}}}var $Be=new m,eYe=new m,oJ=new m,tYe=new $;function Dle(e,t,n,i,o){if(t===0)return e;let r=m.unpack(e,0,eYe),s=$.unpack(e,3,tYe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,h=m.fromElements(a,a,1,$Be);l(o)&&(u=-1+(2*o+1)*a,h.z=a);let p=m.fromElements(c,d,u,oJ);p=$.multiplyByVector(s,p,oJ),p=m.add(p,r,oJ);let g=$.clone(s);g=$.multiplyByScale(g,h,g);let f=new Array(12);return m.pack(p,f),$.pack(g,f,3),f}var nYe=new le;function Ole(e,t,n,i,o){if(t===0)return e.slice();let r=le.unpack(e,0,nYe),s=e[4],a=e[5],c=Math.pow(2,-t),d=c*r.width,u=X.negativePiToPi(r.west+n*d),h=X.negativePiToPi(u+d),p=c*r.height,g=X.negativePiToPi(r.south+i*p),f=X.negativePiToPi(g+p),y=s,x=a;if(l(o)){let S=c*(a-s);y+=o*S,x=y+S}return[u,g,h,f,y,x]}function iYe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=kle(i,o,n,!1,t),s=Nle(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=Ble(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function Ble(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}rl.prototype.hasProperty=function(e,t){return!1};rl.prototype.getFeature=function(e){};rl.prototype.applyDebugSettings=function(e,t){};rl.prototype.applyStyle=function(e){};rl.prototype.update=function(e,t){};rl.prototype.pick=function(e,t,n){};rl.prototype.isDestroyed=function(){return!1};rl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),me(this)};rl._deriveBoundingBox=Dle;rl._deriveBoundingRegion=Ole;rl._deriveBoundingVolumeS2=Ule;var E1=rl;var e4n=_(T(),1);var v2n=_(T(),1),oYe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Dl=Object.freeze(oYe);var BQn=_(T(),1);var ovn=_(T(),1);var M2n=_(T(),1);function I1(e,t){this._distance=t,this._normal=new Yle(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(I1.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});I1.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new I1(e.normal,e.distance),t};I1.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new I1(e.normal,e.distance)};function Yle(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(Yle.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 oT=I1;function Sc(e){e=e??Y.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.edgeColor=D.clone(e.edgeColor??D.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Qle:jle,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 Qle(e){return e===Jt.OUTSIDE}function jle(e){return e===Jt.INSIDE}Object.defineProperties(Sc.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?Qle:jle)}},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 zle(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Sc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){zle(n,i)},e.index=t,zle(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Sc.prototype.get=function(e){return this._planes[e]};function qle(e,t){let n=e.length;for(let i=0;i<n;++i)if(dn.equals(e[i],t))return i;return-1}Sc.prototype.contains=function(e){return qle(this._planes,e)!==-1};Sc.prototype.remove=function(e){let t=this._planes,n=qle(t,e);if(n===-1)return!1;e instanceof oT&&(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 oT&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Sc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof oT&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var rYe=new re,sYe=new re;function Hle(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=Fn.octEncodeToCartesian4(a.normal,sYe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let d=re.packFloat(a.distance,rYe);i[r+4]=d.x,i[r+5]=d.y,i[r+6]=d.z,i[r+7]=d.w,r+=8}}function Kle(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function $le(e,t){let n=Dt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var aYe=new U;Sc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Sc.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=$le(o,aYe);s.y*=2,i?(t=new vt({context:n,width:s.x,height:s.y,pixelFormat:ot.RGBA,pixelDatatype:je.FLOAT,sampler:tn.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new vt({context:n,width:s.x,height:s.y,pixelFormat:ot.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:tn.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(Kle(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Hle(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),Kle(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),Hle(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var cYe=new F,Jle=new dn(m.UNIT_X,0);Sc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=F.multiply(t,o,cYe));let r=Jt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Jt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];dn.transform(a,o,Jle);let c=e.intersectPlane(Jle);if(c===Jt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Sc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Sc.useFloatTexture=function(e){return e.floatingPointTexture};Sc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Sc.useFloatTexture(t)?e.length:e.length*2,r=$le(o,n);return r.y*=2,r};Sc.prototype.isDestroyed=function(){return!1};Sc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),me(this)};var ys=Sc;var Avn=_(T(),1);var hvn=_(T(),1);function rT(e){this._ellipsoid=e.ellipsoid??ne.default,this._positions=[...e.positions]}Object.defineProperties(rT.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});rT.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new rT({positions:e.positions,ellipsoid:e.ellipsoid})};rT.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};rT.prototype.computeRectangle=function(e){return jp.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var lYe=new le,ede=new m;rT.prototype.computeSphericalExtents=function(e){l(e)||(e=new le);let t=this.computeRectangle(lYe),n=he.toCartesian(le.southwest(t),this.ellipsoid,ede),i=Math.sqrt(n.x*n.x+n.y*n.y),o=X.fastApproximateAtan2(i,n.z),r=X.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=he.toCartesian(le.northeast(t),this.ellipsoid,ede),i=Math.sqrt(n.x*n.x+n.y*n.y),o=X.fastApproximateAtan2(i,n.z),r=X.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var X1=rT;var pvn=_(T(),1),LW=`in vec2 v_textureCoordinates;
|
|
|
|
|
|
uniform int u_polygonsLength;
|
|
|
uniform int u_extentsLength;
|
|
|
uniform highp sampler2D u_polygonTexture;
|
|
|
uniform highp sampler2D u_extentsTexture;
|
|
|
|
|
|
int getPolygonIndex(float dimension, vec2 coord) {
|
|
|
vec2 uv = coord.xy * dimension;
|
|
|
return int(floor(uv.y) * dimension + floor(uv.x));
|
|
|
}
|
|
|
|
|
|
vec2 getLookupUv(ivec2 dimensions, int i) {
|
|
|
int pixY = i / dimensions.x;
|
|
|
int pixX = i - (pixY * dimensions.x);
|
|
|
float pixelWidth = 1.0 / float(dimensions.x);
|
|
|
float pixelHeight = 1.0 / float(dimensions.y);
|
|
|
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
|
|
|
float v = (float(pixY) + 0.5) * pixelHeight;
|
|
|
return vec2(u, v);
|
|
|
}
|
|
|
|
|
|
vec4 getExtents(int i) {
|
|
|
return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i));
|
|
|
}
|
|
|
|
|
|
ivec2 getPositionsLengthAndExtentsIndex(int i) {
|
|
|
vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
|
|
|
vec4 value = texture(u_polygonTexture, uv);
|
|
|
return ivec2(int(value.x), int(value.y));
|
|
|
}
|
|
|
|
|
|
vec2 getPolygonPosition(int i) {
|
|
|
vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
|
|
|
return texture(u_polygonTexture, uv).xy;
|
|
|
}
|
|
|
|
|
|
vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) {
|
|
|
float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y);
|
|
|
float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x);
|
|
|
return vec2(latitude, longitude);
|
|
|
}
|
|
|
|
|
|
void main() {
|
|
|
int lastPolygonIndex = 0;
|
|
|
out_FragColor = vec4(1.0);
|
|
|
|
|
|
// Get the relevant region of the texture
|
|
|
float dimension = float(u_extentsLength);
|
|
|
if (u_extentsLength > 2) {
|
|
|
dimension = ceil(log2(float(u_extentsLength)));
|
|
|
}
|
|
|
int regionIndex = getPolygonIndex(dimension, v_textureCoordinates);
|
|
|
|
|
|
for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {
|
|
|
ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);
|
|
|
int positionsLength = positionsLengthAndExtents.x;
|
|
|
int polygonExtentsIndex = positionsLengthAndExtents.y;
|
|
|
lastPolygonIndex += 1;
|
|
|
|
|
|
// Only compute signed distance for the relevant part of the atlas
|
|
|
if (polygonExtentsIndex == regionIndex) {
|
|
|
float clipAmount = czm_infinity;
|
|
|
vec4 extents = getExtents(polygonExtentsIndex);
|
|
|
vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension;
|
|
|
vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents);
|
|
|
float s = 1.0;
|
|
|
|
|
|
// Check each edge for absolute distance
|
|
|
for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) {
|
|
|
vec2 a = getPolygonPosition(lastPolygonIndex + i);
|
|
|
vec2 b = getPolygonPosition(lastPolygonIndex + j);
|
|
|
|
|
|
vec2 ab = b - a;
|
|
|
vec2 pa = p - a;
|
|
|
float t = dot(pa, ab) / dot(ab, ab);
|
|
|
t = clamp(t, 0.0, 1.0);
|
|
|
|
|
|
vec2 pq = pa - t * ab;
|
|
|
float d = length(pq);
|
|
|
|
|
|
// Inside / outside computation to determine sign
|
|
|
bvec3 cond = bvec3(p.y >= a.y,
|
|
|
p.y < b.y,
|
|
|
ab.x * pa.y > ab.y * pa.x);
|
|
|
if (all(cond) || all(not(cond))) s = -s;
|
|
|
if (abs(d) < abs(clipAmount)) {
|
|
|
clipAmount = d;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// Normalize the range to [0,1]
|
|
|
vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;
|
|
|
// In the case where we've iterated through multiple polygons, take the minimum
|
|
|
out_FragColor = min(out_FragColor, result);
|
|
|
}
|
|
|
|
|
|
lastPolygonIndex += positionsLength;
|
|
|
}
|
|
|
}`;function rs(e){e=e??Y.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new be,this.polygonRemoved=new be,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(rs.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});rs.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};rs.prototype.get=function(e){return this._polygons[e]};rs.prototype.contains=function(e){return this._polygons.some(t=>X1.equals(t,e))};rs.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>X1.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var dYe=new le;function uYe(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=le.clone(a);u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI);let h=[r];for(let p=0;p<t.length;++p){let g=t[p];if(l(g)&&l(le.simpleIntersection(g,u))&&!le.equals(g,u)){let f=n[p];h.push(...f),f.reduce((y,x)=>le.union(e[x].computeSphericalExtents(dYe),y,y),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=le.clone(a,u),u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI),p=-1}}t.push(u),n.push(h)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}rs.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function mYe(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=uYe(i),s=0;for(let[c,d]of i.entries()){let u=d.length;t[s++]=u,t[s++]=r.get(c);for(let h=0;h<u;++h){let p=d.positions[h],g=Math.hypot(p.x,p.y),f=X.fastApproximateAtan2(g,p.z),y=X.fastApproximateAtan2(p.x,p.y);t[s++]=f,t[s++]=y}}let a=0;for(let c of o){let d=1/(c.east-c.west),u=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=u,n[a++]=d}e._extentsCount=o.length}var sJ=new U;rs.prototype.update=function(e){let t=e.context;if(!rs.isSupported(e))throw new ce("ClippingPolygonCollections are only supported for WebGL 2.");let n=this._polygons.reduce((s,a)=>s+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let s=rs.getTextureResolution(i,this.pixelsNeededForPolygonPositions,sJ);i=new vt({context:t,width:s.x,height:s.y,pixelFormat:ot.RG,pixelDatatype:je.FLOAT,sampler:tn.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(l(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let s=rs.getTextureResolution(o,this.pixelsNeededForExtents,sJ);o=new vt({context:t,width:s.x,height:s.y,pixelFormat:ot.RGBA,pixelDatatype:je.FLOAT,sampler:tn.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(mYe(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(r)){let s=rs.getClippingDistanceTextureResolution(this,sJ);r=new vt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?ot.RED:ot.LUMINANCE,pixelDatatype:je.FLOAT,sampler:new tn({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:en.LINEAR,magnificationFilter:fi.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=hYe(this)};rs.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function hYe(e){let t=e._polygonsTexture,n=e._extentsTexture;return new Fc({fragmentShaderSource:LW,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 tde=new le,fYe=new le;rs.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Jt.OUTSIDE;this.inverse&&(o=Jt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let u=e.boundingVolume.computeCorners();c=le.fromCartesianArray(u,t,tde)}l(c)||(c=le.fromBoundingSphere(e.boundingSphere,t,tde));let d=le.simpleIntersection(c,a,fYe);l(d)&&(o=Jt.INTERSECTING)}return o};rs.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};rs.isSupported=function(e){return e?.context.webgl2};rs.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Dt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};rs.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Dt.maximumTextureSize,4096),t.y=Math.min(Dt.maximumTextureSize,4096),t)};rs.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):rs.getTextureResolution(n,e.pixelsNeededForExtents,t)};rs.prototype.isDestroyed=function(){return!1};rs.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),me(this)};var oh=rs;var Xwn=_(T(),1);var Bvn=_(T(),1);var Nvn=_(T(),1),RW={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};RW.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?RW.SUNLIGHT:RW.SCENE_LIGHT:RW.NONE};var Sb=Object.freeze(RW);function nde(){this.lightIntensity=10,this.rayleighCoefficient=new m(55e-7,13e-6,284e-7),this.mieCoefficient=new m(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=Sb.NONE}nde.requiresColorCorrect=function(e){return!(X.equalsEpsilon(e.hueShift,0,X.EPSILON7)&&X.equalsEpsilon(e.saturationShift,0,X.EPSILON7)&&X.equalsEpsilon(e.brightnessShift,0,X.EPSILON7))};var sT=nde;var zvn=_(T(),1),rh=`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 Kvn=_(T(),1),ZW=`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 Qvn=_(T(),1),GW=`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 qvn=_(T(),1),EW=`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 ewn=_(T(),1),IW=`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 ti(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??Y.EMPTY_OBJECT;let t=Math.min(e.mipmapLevels??7,Math.log2(Dt.maximumCubeMapSize));this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=ti.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new q;let n=Math.pow(2,t-1);this._textureDimensions=new U(n,n),this._radiiAndDynamicAtmosphereColor=new m,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??60*60,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??ti.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(ti.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){m.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=m.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});ti._maximumComputeCommandCount=8;ti._activeComputeCommandCount=0;ti._nextFrameCommandQueue=[];ti._queueCommand=(e,t)=>{if(ti._activeComputeCommandCount>=ti._maximumComputeCommandCount){ti._nextFrameCommandQueue.push(e);return}t.commandList.push(e),ti._activeComputeCommandCount++};ti._updateCommandQueue=e=>{if(ti._maximumComputeCommandCount=Math.log2(Dt.maximumCubeMapSize),ti._nextFrameCommandQueue.length>0&&ti._activeComputeCommandCount<ti._maximumComputeCommandCount){let t=ti._nextFrameCommandQueue.shift();for(;l(t)&&ti._activeComputeCommandCount<ti._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=ti._nextFrameCommandQueue.shift();continue}e.commandList.push(t),ti._activeComputeCommandCount++,t=ti._nextFrameCommandQueue.shift()}l(t)&&ti._nextFrameCommandQueue.push(t)}};ti.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};ti.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 pYe=new m,bYe=new m;function gYe(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,bYe),s=1.025,a=pYe,c=l(r)?m.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!m.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(m.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var ide=new m,yYe=new F,xYe=new re,_Ye=new D;function TYe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new Lr({context:n,width:i.x,height:i.y,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:ot.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new De({sources:[rh,GW]}),e._radianceMapFS=o),sT.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=Ft.eastNorthUpToFixedFrame(r,a,yYe),d=xYe;d.x=e.brightness,d.y=e.saturation,d.z=e.gamma,d.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let u=0;for(let h of Lr.faceNames()){let p=e._radianceMapTextures[u];l(p)&&!p.isDestroyed()&&p.destroy(),p=new vt({context:n,width:i.x,height:i.y,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:ot.RGBA}),e._radianceMapTextures[u]=p;let g=u,f=new Fc({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>Lr.getDirection(h,ide),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,_Ye)},owner:e});f.postExecute=()=>{if(e.isDestroyed()||f.canceled){ti._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let x=new Fr({context:n,colorTextures:[e._radianceMapTextures[g]]});x._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),x._unBind(),x.destroy(),ti._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[u]=f,ti._queueCommand(f,t),u++}e._radianceCommandsDirty=!1}}function SYe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,d=(h,p,g,f,y)=>()=>{if(e.isDestroyed()||h.canceled){ti._activeComputeCommandCount--;return}let x=e._convolutionComputeCommands;x[p]=void 0,n.copyFace(t,g,f,y),c++,ti._activeComputeCommandCount--,g.destroy(),e._specularMapTextures[p]=void 0;let S=e._specularMapTextures.length;c>=S&&(e._irradianceCommandDirty=!0,n.sampler=new tn({minificationFilter:en.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},u=0;for(let h=1;h<i;++h){for(let p of Lr.faceNames()){l(e._specularMapTextures[u])&&e._specularMapTextures[u].destroy();let g=e._specularMapTextures[u]=new vt({context:a,width:r,height:s,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:ot.RGBA}),f=e._va;l(f)||(f=Lr.createVertexArray(a,p),e._va=f);let y=e._convolveSP;l(y)||(y=nn.fromCache({context:a,vertexShaderSource:IW,fragmentShaderSource:EW,attributeLocations:{positions:0}}),e._convolveSP=y);let x=new Fc({shaderProgram:y,vertexArray:f,outputTexture:g,persists:!0,owner:e,uniformMap:{u_roughness:()=>h/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>Lr.getDirection(p,ide)}});x.postExecute=d(x,u,g,p,h),e._convolutionComputeCommands[u]=x,ti._queueCommand(x,t),++u}r/=2,s/=2}}var ode=new U(3,3);function CYe(e,t){let n=t.context,i=ode,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new vt({context:n,width:i.x,height:i.y,pixelDatatype:je.FLOAT,pixelFormat:ot.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new De({sources:[ZW]}),e._irradianceMapFS=r);let s=new Fc({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){ti._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,ti._activeComputeCommandCount--},e._irradianceComputeCommand=s,ti._queueCommand(s,t),e._irradianceTextureDirty=!0}function VYe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new Fr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=ode,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=m.unpack(r,s*4),m.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}ti.prototype.update=function(e){let t=e.mode;if(!ti.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}ti._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=gYe(this,e)||i===Sb.SUNLIGHT&&!q.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=q.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(TYe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(SYe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(CYe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){VYe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};ti.prototype.isDestroyed=function(){return!1};ti.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(),me(this)};ti.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};ti.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(D.fromCssColorString("#717145"));ti.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new m(.35449,.35449,.35449)),m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO]);var Cb=ti;var vwn=_(T(),1);var XW={HIGHLIGHT:0,REPLACE:1,MIX:2};XW.getColorBlend=function(e,t){if(e===XW.HIGHLIGHT)return 0;if(e===XW.REPLACE)return 1;if(e===XW.MIX)return X.clamp(t,X.EPSILON4,1)};var Cc=Object.freeze(XW);var M9n=_(T(),1);var OFn=_(T(),1);var LFn=_(T(),1);var Bwn=_(T(),1);var Nwn=_(T(),1);var rde={};function WW(e){this._count=e.count,this._properties=Be(e.properties,!0)}WW.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,rde)};WW.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,rde,e)};WW.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Be(n[e],!0)};WW.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Be(n,!0)};var Vb=WW;function Vc(e){e=e??Y.EMPTY_OBJECT,this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(Vc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});Vc.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))};Vc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Vc.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))};Vc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var aJ=[];Vc.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(aJ)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,aJ)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(aJ)),t};Vc.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};Vc.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 Vb({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Vc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Vc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Vc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Vc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Vc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Vc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Vc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var sl=Vc;var iFn=_(T(),1);var qwn=_(T(),1);function PW(e){e=e??Y.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=kl.createModelTextureReader({textureInfo:r,channels:ZYe(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,d=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=d,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(PW.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}}});PW.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(Vt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(Vt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==mt.SCALAR?(Vt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Mt.UINT8?(Vt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:mt.isVectorType(t)||t===mt.SCALAR?n!==Mt.UINT8?(Vt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(Vt(`Property texture property ${e.id} has an unsupported type`),!1)};var LYe=[void 0,"float","vec2","vec3","vec4"],RYe=[void 0,"int","ivec2","ivec3","ivec4"];PW.prototype.getGlslType=function(){let e=this._classProperty,t=mt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?LYe[t]:RYe[t]};PW.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function ZYe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var vW=PW;function cJ(e){e=e??Y.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new vW({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(cJ.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}}});cJ.prototype.getProperty=function(e){return this._properties[e]};var Lb=cJ;var mFn=_(T(),1);var aFn=_(T(),1);function sde(e){e=e??Y.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(sde.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 wW=sde;function lJ(e){e=e??Y.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 wW({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(lJ.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}}});lJ.prototype.getProperty=function(e){return this._properties[e]};var aT=lJ;var bFn=_(T(),1);function FW(e){e=e??Y.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(FW.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}}});FW.prototype.getPropertyTable=function(e){return this._propertyTables[e]};FW.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};FW.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var $s=FW;function GYe(e){e=e??Y.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],d=new Nu({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new sl({id:s,name:a.name,count:a.count,metadataTable:d,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new Lb({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new aT({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new $s({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var AW=GYe;var vFn=_(T(),1);function EYe(e){e=e??Y.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],d=n.classes[c.class],u=new Nu({count:c.count,properties:c.properties,class:d,bufferViews:e.bufferViews});o.push(new sl({id:a,count:c.count,metadataTable:u,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new Lb({id:a,propertyTexture:IYe(c),class:n.classes[c.class],textures:e.textures}))}return new $s({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function IYe(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:XYe(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=Rt(o.texture,r,!0)}return t}function XYe(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 MW=EYe;function Ug(e){e=e??Y.EMPTY_OBJECT;let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:d=!0}=e;this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=d,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=_t.UNLOADED,this._promise=void 0}l(Object.create)&&(Ug.prototype=Object.create(Qi.prototype),Ug.prototype.constructor=Ug);Object.defineProperties(Ug.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function WYe(e){try{let t=AYe(e),n=DYe(e),i=OYe(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=_t.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=_t.FAILED,e.getError("Failed to load structural metadata",t)}}Ug.prototype.load=function(){return l(this._promise)?this._promise:(this._state=_t.LOADING,this._promise=WYe(this),this._promise)};function PYe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function vYe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function wYe(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];PYe(o.properties,n)}return n}function FYe(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)&&vYe(r,n)}}return n}async function AYe(e){let t;l(e._extension)?t=wYe(e._extension):t=FYe(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Li.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function MYe(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&NYe(r,t)}return t}function NYe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function kYe(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)&&UYe(r,t)}}return t}function UYe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function DYe(e){let t;l(e._extension)?t=MYe(e._extension):t=kYe(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let d in t)if(t.hasOwnProperty(d)){let u=Li.getTextureLoader({gltf:n,textureInfo:t[d],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(u),e._textureIds.push(d),c.push(u.load())}return Promise.all(c)}async function OYe(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Li.getSchemaLoader({resource:i})}else n=Li.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}Ug.prototype.process=function(e){if(this._state===_t.READY)return!0;if(this._state!==_t.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let d=t[a].process(e);i=i&&d}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],d=this._bufferViewLoaders[a];if(!d.isDestroyed()){let u=new Uint8Array(d.typedArray);r[c]=u}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],d=t[a];d.isDestroyed()||(s[c]=d.texture)}return l(this._extension)?this._structuralMetadata=AW({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=MW({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),ade(this),this._state=_t.READY,!0};function ade(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Li.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function BYe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Li.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}Ug.prototype.unload=function(){ade(this),BYe(this),l(this._schemaLoader)&&Li.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var NW=Ug;var YFn=_(T(),1);var W1={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};W1.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return W1.TRANSLATION;case"ROTATION":return W1.ROTATION;case"SCALE":return W1.SCALE;case"_FEATURE_ID":return W1.FEATURE_ID}};var ss=Object.freeze(W1);var mAn=_(T(),1);var nAn=_(T(),1);var YYe=65534,zYe=255;function Uk(e){e=e??Y.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new dde(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],HYe(this)}Object.defineProperties(Uk.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function HYe(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],d=t[a+1],u=t[a+2],h=!1,p=h||n.hasEdge(c,d),g=h||n.hasEdge(d,u),f=h||n.hasEdge(u,c),y=cde(i,c,d,u,p,g,f);for(;l(y);){let x=s[y];if(!l(x)){x=r+o.length;let S=y;for(;S>=r;)S=o[S-r];o.push(S),s[y]=x}x>YYe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):x>zYe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=x,t[a]=x):y===d?(d=x,t[a+1]=x):(u=x,t[a+2]=x),y=cde(i,c,d,u,p,g,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function cde(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=dJ(e,t,a,c,d);if(u===0)return t;let h=0,p=o?1:0,g=r?1:0,f=dJ(e,n,h,p,g);if(f===0)return n;let y=s?1:0,x=0,S=r?1:0,C=dJ(e,i,y,x,S);if(C===0)return i;let V=u&f&C,L,Z,E;if(V&1)L=0,Z=1,E=2;else if(V&2)L=0,E=1,Z=2;else if(V&4)Z=0,L=1,E=2;else if(V&8)Z=0,E=1,L=2;else if(V&16)E=0,L=1,Z=2;else if(V&32)E=0,Z=1,L=2;else{let A=uJ(u),b=uJ(f),R=uJ(C);return A<b&&A<R?t:b<R?n:i}let P=t*3;e[P+L]=a,e[P+Z]=c,e[P+E]=d;let W=n*3;e[W+L]=h,e[W+Z]=p,e[W+E]=g;let v=i*3;e[v+L]=y,e[v+Z]=x,e[v+E]=S}function dJ(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function uJ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}Uk.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,d=n+a*i;for(let u=0;u<i;u++)s[d+u]=s[c+u]}return s};Uk.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,Dt.maximumTextureSize),i=n,o=lde(i),r=[];for(;i>1;)i>>=1,r.push(lde(i));let s=new vt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:ot.LUMINANCE,sampler:new tn({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:en.LINEAR_MIPMAP_LINEAR,magnificationFilter:fi.LINEAR})});return t.outlineTexture=s,s};function lde(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 dde(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}dde.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 cT=Uk;function ude(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function KYe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function Dk(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}Dk.prototype.postProcess=function(e){this.needsOutlines&&(JYe(this),jYe(this,e))};function JYe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new cT({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ne.fromTypedArray(n.typedArray);let r=QYe(o.outlineCoordinates),s=new ude(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let d=0;d<c;d++){let u=a[d].attribute;u.typedArray=o.updateAttribute(u.typedArray)}}function QYe(e){let t=new Vn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Q.FLOAT,t.type=an.VEC3,t.normalized=!1,t.count=e.length/3,t}function jYe(e,t){qYe(e.attributePlans,t),l(e.indicesPlan)&&$Ye(e.indicesPlan,t)}function qYe(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=Ct.createVertexBuffer({typedArray:s,context:t,usage:ke.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function $Ye(e,t){let n=e.indices;if(e.loadBuffer){let i=Ct.createIndexBuffer({typedArray:n.typedArray,context:t,usage:ke.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}Dk.AttributeLoadPlan=ude;Dk.IndicesLoadPlan=KYe;var lT=Dk;var pAn=_(T(),1);function eze(e){e=e??Y.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var kW=eze;var MAn=_(T(),1);var gAn=_(T(),1);function mde(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(mde.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var UW=mde;var xAn=_(T(),1);function hde(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(hde.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var DW=hde;var TAn=_(T(),1);function fde(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(fde.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var OW=fde;var LAn=_(T(),1);var CAn=_(T(),1),tze={Direct:"Direct",Indirect:"Indirect"},Dg=Object.freeze(tze);function pde(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(pde.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 P1=pde;var ZAn=_(T(),1);function bde(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(bde.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 BW=bde;function v1(){}function gde(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function nze(e){let t=m.fromArray(e.position,0,new m),n=m.fromArray(e.adjustmentParams,0,new m);return new UW({position:t,adjustmentParams:n})}function ize(e){let t=m.fromArray(e.position,0,new m),n=m.fromArray(e.adjustmentParams,0,new m),i=gde(e.covarianceMatrix);return new DW({position:t,adjustmentParams:n,covarianceMatrix:i})}function oze(e){let t=e.groupFlags,n=m.fromArray(e.rotationThetas,0,new m),i=[];for(let r of e.params){let s=new BW({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new OW({groupFlags:t,rotationThetas:n,params:i})}v1.load=function(e){let t=e.storageType;if(t===Dg.Direct)return v1.loadDirect(e);if(t===Dg.Indirect)return v1.loadIndirect(e);throw new ce(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};v1.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=nze(r);t.push(s)}let i=gde(e.covarianceDirectUpperTriangle);return new P1({storageType:Dg.Direct,anchorPointsDirect:t,covarianceDirect:i})};v1.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=ize(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=oze(s);o.push(a)}return new P1({storageType:Dg.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var YW=v1;var i9n=_(T(),1);var kAn=_(T(),1);function yde(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(yde.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 zW=yde;var DAn=_(T(),1);function xde(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(xde.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var HW=xde;var BAn=_(T(),1);function _de(e){this._ppeTextures=e}Object.defineProperties(_de.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var KW=_de;function Ir(e){e=e??Y.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=_t.UNLOADED,this._promise=void 0}l(Object.create)&&(Ir.prototype=Object.create(Qi.prototype),Ir.prototype.constructor=Ir);Object.defineProperties(Ir.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Ir.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=_t.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=_t.FAILED,this.getError("Failed to load GPM data",e)}};Ir.prototype.load=function(){return l(this._promise)?this._promise:(this._state=_t.LOADING,this._promise=this._loadResources(this),this._promise)};function rze(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}Ir.prototype._loadTextures=function(){let e;l(this._extension)&&(e=rze(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let d=Li.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(d),this._textureIds.push(c),a.push(d.load())}return Promise.all(a)};Ir.ppeTexturesMetadataSchemaCache=new Map;Ir._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}}}};Ir._obtainPpeTexturesMetadataSchema=function(e){let n=Ir._collectPpeTexturePropertyIdentifiers(e).toString(),i=Ir.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${Ir.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],d=`ppeTexture_${a}`,u=Ir._createPpeTextureClassJson(c,a);r.classes[d]=u}return i=Ed.fromJson(r),Ir.ppeTexturesMetadataSchemaCache.set(n,i),i};Ir._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=Ir._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};Ir._convertToStructuralMetadata=function(e,t){let n=[],i=Ir._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,u=a.traits.source,h=i.classes[c],p={class:c,properties:{[u]:{index:a.index,texCoord:a.texCoord}}};n.push(new Lb({id:s,name:a.name,propertyTexture:p,class:h,textures:t}))}return new $s({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Ir.prototype.process=function(e){if(this._state===_t.READY)return!0;if(this._state!==_t.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let d=0;d<n;++d){let h=t[d].process(e);i=i&&h}if(!i)return!1;let o={};for(let d=0;d<this._textureIds.length;++d){let u=this._textureIds[d],h=t[d];h.isDestroyed()||(o[u]=h.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let d=s.ppeTextures;for(let u of d){let h=u.traits,p=new HW({min:h.min,max:h.max,source:h.source}),g=new zW({traits:p,noData:u.noData,offset:u.offset,scale:u.scale,index:u.index,texCoord:u.texCoord});r.push(g)}}let a=new KW(r);this._meshPrimitiveGpmLocal=a;let c=Ir._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=_t.READY,!0};Ir.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Li.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Ir.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var JW=Ir;var{Attribute:sze,Indices:aze,FeatureIdAttribute:Tde,FeatureIdTexture:Sde,FeatureIdImplicitRange:Cde,MorphTarget:cze,Primitive:lze,Instances:dze,Skin:uze,Node:mze,AnimatedPropertyType:hze,AnimationSampler:fze,AnimationTarget:pze,AnimationChannel:bze,Animation:gze,ArticulationStage:yze,Articulation:xze,Asset:_ze,Scene:Tze,Components:Sze,MetallicRoughness:Cze,SpecularGlossiness:Vze,Specular:Lze,Anisotropy:mJ,Clearcoat:hJ,Material:Rze}=Vn,wo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function sh(e){e=e??Y.EMPTY_OBJECT;let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=vo.Y,forwardAxis:a=vo.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:d=!1,enablePick:u=!1,loadIndicesForWireframe:h=!1,loadPrimitiveOutline:p=!0,loadForClassification:g=!1,renameBatchIdSemantic:f=!1}=e,{baseResource:y=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=y,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=c,this._loadAttributesFor2D=d,this._enablePick=u,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=f,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=wo.NOT_LOADED,this._textureState=wo.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(sh.prototype=Object.create(Qi.prototype),sh.prototype.constructor=sh);Object.defineProperties(sh.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function Zze(e){e._state=wo.LOADING,e._textureState=wo.LOADING;try{let t=Li.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=wo.LOADED,e._textureState=wo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=wo.FAILED,e._textureState=wo.FAILED,Ok(e,t)}}async function Gze(e,t){Ht.supportsWebP.initialized||await Ht.supportsWebP.initialize(),e._supportedImageFormats=new kW({webp:Ht.supportsWebP(),basis:t.context.supportsBasis});let n=XHe(e,t);return e._state=wo.PROCESSING,e._textureState=wo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Li.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}sh.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=Zze(this),this._promise)};function Ok(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function Eze(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(l(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(l(r)){let s=r.process(t);s&&(l(e._components.structuralMetadata)&&Vt("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&s}n&&(e._state=wo.POST_PROCESSING)}function Ize(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&Xze(e,o)}}function Xze(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let c=r[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}sh.prototype._process=function(e){return this._state===wo.READY?!0:(this._state===wo.PROCESSING&&Eze(this,e),this._resourcesLoaded&&this._state===wo.POST_PROCESSING&&(Ize(this,e.context),this._state=wo.PROCESSED),this._resourcesLoaded&&this._state===wo.PROCESSED?(Wde(this),this._typedArray=void 0,this._state=wo.READY,!0):!1)};sh.prototype._processTextures=function(e){if(this._textureState===wo.READY)return!0;if(this._textureState!==wo.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&l(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=wo.READY,this._texturesLoaded=!0,!0):!1};sh.prototype.process=function(e){if(this._state===wo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=Gze(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=wo.FAILED;let o=this._processError;this._processError=void 0,Ok(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===wo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=wo.FAILED,Ok(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=wo.FAILED,Ok(this,o)}return this._incrementallyLoadTextures?n:n&&i};function Wze(e,t,n,i,o,r,s,a){let c=e.gltfJson,u=c.accessors[t].bufferView;return Li.getVertexBufferLoader({gltf:c,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:u,primitive:i,draco:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function Pze(e,t,n,i,o,r,s){return Li.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function vze(e,t){let n=Li.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Vde(e,t,n){let i=t.byteOffset,o=Nl(e,t),r=t.count,s=Gd(t.type),a=t.componentType,c=Q.getSizeInBytes(a),d=c*s,u=r*s;if(o===d)return n=new Uint8Array(n),Q.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let h=Q.createTypedArray(a,u),p=new DataView(n.buffer),g=new Array(s),f=Tb(t.componentType);i=n.byteOffset+i;for(let y=0;y<r;++y){f(p,i,s,c,g);for(let x=0;x<s;++x)h[y*s+x]=g[x];i+=o}return h}function wze(e,t){let n=e.type;if(n===an.SCALAR)return t.fill(0);let i=an.getMathType(n);return t.fill(i.clone(i.ZERO))}function Fze(e,t,n,i){let o=e.type,r=e.count;if(o===an.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===an.VEC4&&i)for(let s=0;s<r;s++)n[s]=we.unpack(t,s*4);else{let s=an.getMathType(o),a=an.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function Aze(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=Vde(r,n,t.typedArray);i=i??!1,Fze(n,s,o,i)}function Bk(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=vze(e,o),s=Aze(e,r,t,n,i);return e._loaderPromises.push(s),i}return wze(t,i)}function Id(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function Mze(e){return e===Number?0:new e}function Nze(e){switch(e){case Q.BYTE:return 127;case Q.UNSIGNED_BYTE:return 255;case Q.SHORT:return 32767;case Q.UNSIGNED_SHORT:return 65535;default:return 1}}var kze={VEC2:new U(-1,-1),VEC3:new m(-1,-1,-1),VEC4:new re(-1,-1,-1,-1)};function Uze(e,t){let n=Nze(e.componentDatatype),i=kze[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 Dze(e,t,n){let i=e.decodeMatrix,o=Id(n,e.decodedMin),r=Id(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Vn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new U(i[6],i[7]),s.quantizedVolumeStepSize=new U(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new m(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new m(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new re(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new re(i[0],i[6],i[12],i[18])),t.quantization=s}function Oze(e,t,n,i,o){let r=e.accessors[t],s=an.getMathType(r.type),a=r.normalized??!1,c=new sze;c.name=n,c.semantic=i,c.setIndex=o,c.constant=Mze(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=Id(s,r.min),c.max=Id(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=Nl(e,r),ci(r,"WEB3D_quantized_attributes")&&Dze(r.extensions.WEB3D_quantized_attributes,c,s);let d=c.semantic===yt.POSITION||c.semantic===yt.NORMAL||c.semantic===yt.TANGENT||c.semantic===yt.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&d&&Uze(c,s),c}function Lde(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var Bze={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function fJ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=Bze;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function Yze(e){let t=e===yt.POSITION,n=e===yt.FEATURE_ID,i=e===yt.TEXCOORD;return t||n||i}function zze(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Q.createArrayBufferView(o,t.typedArray.buffer)}}function Hze(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Vde(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function Rde(e,t,n,i,o,r,s,a){let c=e.gltfJson,d=c.accessors[t],u=d.bufferView,h=n.gltfSemantic,p=n.renamedSemantic,g=n.modelSemantic,f=l(g)?Lde(p):void 0,x=Oze(c,t,h,g,f);if(!l(o)&&!l(u))return x;let S=Wze(e,t,h,i,o,r,s,a),C=e._geometryLoaders.length;e._geometryLoaders.push(S);let V=S.load();return e._loaderPromises.push(V),e._geometryCallbacks[C]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[h])?zze(x,S,r,s):Hze(c,d,x,S,r,s)},x}function Zde(e,t,n,i,o,r,s,a){let c=n.modelSemantic,d=c===yt.POSITION,u=c===yt.FEATURE_ID,h=d&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=d&&e._enablePick&&!a.context.webgl2,g=e._loadForClassification&&u,f=e._loadAttributesAsTypedArray,y=!f,x=f||h||p||g,V=Rde(e,t,n,i,o,s?!1:y,s?!0:x,a),L=new lT.AttributeLoadPlan(V);return L.loadBuffer=y,L.loadTypedArray=x,L}function Kze(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=fJ(e,ss,i),d=c.modelSemantic,u=d===ss.TRANSLATION||d===ss.ROTATION||d===ss.SCALE,h=d===ss.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,f=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return Rde(e,t,c,void 0,void 0,f,p||h&&(!a||y||g),o)}function Jze(e,t,n,i,o,r,s){let a=e.gltfJson.accessors[t],c=a.bufferView;if(!l(i)&&!l(c))return;let d=new aze;d.count=a.count;let u=e._loadAttributesAsTypedArray,h=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,f=!u,y=u||h||p,C=Pze(e,t,n,i,r?!1:f,r?!0:y,s),V=e._geometryLoaders.length;e._geometryLoaders.push(C);let L=C.load();e._loaderPromises.push(L),e._geometryCallbacks[V]=()=>{d.indexDatatype=C.indexDatatype,d.buffer=C.buffer,d.typedArray=C.typedArray};let Z=new lT.IndicesLoadPlan(d);return Z.loadBuffer=f,Z.loadTypedArray=y,Z}function al(e,t,n,i){let o=e.gltfJson,r=kl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Li.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=kl.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let d=s.load().catch(u=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw u;e._textureState=wo.FAILED,e._textureErrors.push(u)}});return e._texturesPromises.push(d),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function Qze(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new Vze;return l(i)&&(c.diffuseTexture=al(e,i,n)),l(o)&&(c.specularGlossinessTexture=al(e,o,n)),c.diffuseFactor=Id(re,r),c.specularFactor=Id(m,s),c.glossinessFactor=a,c}function jze(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new Cze;return l(i)&&(c.baseColorTexture=al(e,i,n)),l(o)&&(c.metallicRoughnessTexture=al(e,o,n)),c.baseColorFactor=Id(re,r),c.metallicFactor=s,c.roughnessFactor=a,c}function qze(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new Lze;return l(o)&&(a.specularTexture=al(e,o,n)),l(s)&&(a.specularColorTexture=al(e,s,n)),a.specularFactor=i,a.specularColorFactor=Id(m,r),a}function $ze(e,t,n){let{anisotropyStrength:i=mJ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=mJ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new mJ;return l(r)&&(s.anisotropyTexture=al(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function eHe(e,t,n){let{clearcoatFactor:i=hJ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=hJ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new hJ;return l(o)&&(c.clearcoatTexture=al(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=al(e,s,n)),l(a)&&(c.clearcoatNormalTexture=al(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function tHe(e,t,n){let i=new Rze,o=t.extensions??Y.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=Qze(e,r,n):(l(d)&&(i.metallicRoughness=jze(e,d,n)),l(s)&&!i.unlit&&(i.specular=qze(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=$ze(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=eHe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=al(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=al(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=al(e,t.occlusionTexture,n)),i.emissiveFactor=Id(m,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Gde(e,t){let n=new Tde;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 Ede(e,t,n,i){let o=new Tde,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Lde(r.attribute),o.positionalLabel=i,o}function Ide(e,t){let n=new Cde;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 Xde(e,t,n,i){let o=new Cde,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function nHe(e,t,n,i){let o=new Sde;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=al(e,r,n,tn.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function iHe(e,t,n,i,o,r){let s=new Sde,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=al(e,c,i,tn.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function oHe(e,t,n,i,o){let r=new cze,s=void 0,a=void 0,c=!1;for(let d in t){if(!t.hasOwnProperty(d))continue;let u=t[d],h=fJ(e,yt,d),p=Zde(e,u,h,s,a,c,n,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function rHe(e,t,n,i){let o=new lze,r=new lT(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=tHe(e,e.gltfJson.materials[s],i));let a=t.extensions??Y.EMPTY_OBJECT,c=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=sHe(e,d,r));let u=e._loadForClassification,h=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(l(g))for(let Z in g){if(!g.hasOwnProperty(Z))continue;let E=g[Z],P=fJ(e,yt,Z),W=P.modelSemantic;if(u&&!Yze(W))continue;W===yt.FEATURE_ID&&(p=!0);let v=Zde(e,E,P,t,h,n,c,i);r.attributePlans.push(v),o.attributes.push(v.attribute)}let f=t.targets;if(l(f)&&!u)for(let Z=0;Z<f.length;++Z)o.morphTargets.push(oHe(e,f[Z],c,r,i));let y=t.indices;if(l(y)){let Z=Jze(e,y,t,h,p,c,i);l(Z)&&(r.indicesPlan=Z,o.indices=Z.indices)}let x=a.EXT_structural_metadata,S=a.EXT_mesh_features,C=a.EXT_feature_metadata,V=l(C);l(S)?aHe(e,o,S,i):V&&cHe(e,o,C,i),l(x)?lHe(o,x):V&&dHe(e,o,C);let L=t.mode;if(u&&L!==Ae.TRIANGLES)throw new ce("Only triangle meshes can be used for classification.");return o.primitiveType=L,o}function sHe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return Bk(e,i,!1)}function aHe(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,c;l(s.texture)?c=nHe(e,s,i,a):l(s.attribute)?c=Gde(s,a):c=Ide(s,a),t.featureIds.push(c)}}function cHe(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let d=s[c],u=d.featureTable,h=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,g=`featureId_${r}`;r++;let f;l(d.featureIds.attribute)?f=Ede(d,h,p,g):f=Xde(d,h,p,g),t.featureIds.push(f)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let d=a[c],u=d.featureTable,h=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,g=`featureId_${r}`;r++;let f=iHe(e,d,h,i,p,g);t.featureIds.push(f)}}function lHe(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function dHe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function uHe(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new dze,r=i.attributes;if(l(r))for(let d in r){if(!r.hasOwnProperty(d))continue;let u=r[d];o.attributes.push(Kze(e,u,r,d,n))}let s=i.extensions??Y.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?mHe(o,a):l(c)&&hHe(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function mHe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=Gde(o,r):s=Ide(o,r),e.featureIds.push(s)}}function hHe(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,d=i.indexOf(c),u=o[c].count,h=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=Ede(a,d,u,h):p=Xde(a,d,u,h),t.featureIds.push(p)}}function fHe(e,t,n){let i=new mze;i.name=t.name,i.matrix=Id(F,t.matrix),i.translation=Id(m,t.translation),i.rotation=Id(we,t.rotation),i.scale=Id(m,t.scale);let o=t.extensions??Y.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new ce("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=uHe(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],d=c.primitives;for(let p=0;p<d.length;++p)i.primitives.push(rHe(e,d[p],l(i.instances),n));let u=t.weights??c.weights,h=i.primitives[0].morphTargets;i.morphWeights=l(u)?u.slice():new Array(h.length).fill(0)}return i}function pHe(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=fHe(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function bHe(e,t,n){let i=new uze,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=Bk(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(F.IDENTITY);return i}function gHe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=bHe(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;l(s)&&(t[r].skin=i[s])}return i}async function yHe(e,t,n,i){let o=new NW({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 xHe(e,t,n,i){let o=new JW({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 _He(e,t){let n=new fze,i=e.gltfJson.accessors,o=i[t.input];n.input=Bk(e,o);let r=t.interpolation;n.interpolation=Om[r]??Om.LINEAR;let s=i[t.output];return n.output=Bk(e,s,!0),n}function THe(e,t){let n=new pze,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=hze[o],n}function SHe(e,t,n){let i=new bze,o=e.sampler;return i.sampler=t[o],i.target=THe(e.target,n),i}function CHe(e,t,n){let i=new gze;i.name=t.name;let o=t.samplers.map(function(s,a){let c=_He(e,s);return c.index=a,c}),r=t.channels.map(function(s){return SHe(s,o,n)});return i.samplers=o,i.channels=r,i}function VHe(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=CHe(e,o,t);return s.index=r,s})}function LHe(e){let t=new yze;t.name=e.name;let n=e.type.toUpperCase();return t.type=dc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function RHe(e){let t=new xze;return t.name=e.name,t.stages=e.stages.map(LHe),t}function ZHe(e){let n=(e.extensions??Y.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(RHe):[]}function GHe(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 EHe(e,t){let n=new Tze,i=GHe(e);return n.nodes=i.map(function(o){return t[o]}),n}var IHe=new m;function XHe(e,t){let n=e.gltfJson,i=n.extensions??Y.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let C=r.featureTables,V=r.featureTextures,L=l(C)?C:[],Z=l(V)?V:[];e._sortedPropertyTableIds=Object.keys(L).sort(),e._sortedFeatureTextureIds=Object.keys(Z).sort()}let a=pHe(e,t),c=gHe(e,a),d=VHe(e,a),u=ZHe(n),h=EHe(n,a),p=new Sze,g=new _ze,f=n.asset.copyright;if(l(f)){let C=f.split(";").map(function(V){return new Gt(V.trim())});g.credits=C}if(p.asset=g,p.scene=h,p.nodes=a,p.skins=c,p.animations=d,p.articulations=u,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let C=m.fromArray(s.center,0,IHe);p.transform=F.fromTranslation(C,p.transform)}if(e._components=p,l(o)||l(r)){let C=yHe(e,o,r,t);e._loaderPromises.push(C)}let y=i.NGA_gpm_local;if(l(y)){let C=YW.load(y);e._components.extensions.NGA_gpm_local=C}let x=n.meshes;if(l(x))for(let C of x){let V=C.primitives;if(l(V))for(let L of V){let Z=L.extensions;if(l(Z)){let E=Z.NGA_gpm_local;if(l(E)){let P=xHe(e,n,E,t);e._loaderPromises.push(P)}}}}let S=[];return S.push.apply(S,e._loaderPromises),e._incrementallyLoadTextures||S.push.apply(S,e._texturesPromises),Promise.all(S)}function WHe(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._textureLoaders.length=0}function Wde(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._bufferViewLoaders.length=0}function PHe(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._geometryLoaders.length=0}function vHe(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 wHe(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function FHe(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}sh.prototype.isUnloaded=function(){return this._state===wo.UNLOADED};sh.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Li.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,WHe(this),Wde(this),PHe(this),vHe(this),wHe(this),FHe(this),this._components=void 0,this._typedArray=void 0,this._state=wo.UNLOADED};var ah=sh;var rMn=_(T(),1);var nMn=_(T(),1);var k9n=_(T(),1),QW=`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 w1(){this._framebuffer=new pi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(w1.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 AHe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var pJ=new U;function MHe(e,t){let n=new De({defines:["LOG_DEPTH_WRITE"],sources:[QW]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return pJ.x=e._radius,pJ.y=e._strength,pJ}},o=Ue.fromCache({blending:fn.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:Ge.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ii({framebuffer:e.framebuffer,color:new D(0,0,0,0),depth:1,renderState:Ue.fromCache(),pass:Ge.CESIUM_3D_TILE,owner:e})}function NHe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),MHe(e,t)}function Pde(e){return e.drawBuffers&&e.fragmentDepth}w1.isSupported=Pde;function kHe(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=De.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}w1.prototype.update=function(e,t,n,i){if(!Pde(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,NHe(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let d=r[o];if(d.primitiveType!==Ae.POINTS||d.pass===Ge.TRANSLUCENT)continue;let u,h,p=d.derivedCommands.pointCloudProcessor;l(p)&&(u=p.command,h=p.originalShaderProgram),(!l(u)||d.dirty||h!==d.shaderProgram||u.framebuffer!==this.framebuffer)&&(u=$e.shallowClone(d,u),u.framebuffer=this.framebuffer,u.shaderProgram=kHe(e.context,d.shaderProgram),u.castShadows=!1,u.receiveShadows=!1,l(p)||(p={command:u,originalShaderProgram:d.shaderProgram},d.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=d.shaderProgram),r[o]=u}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};w1.prototype.isDestroyed=function(){return!1};w1.prototype.destroy=function(){return AHe(this),me(this)};var Rb=w1;function vde(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}vde.isSupported=function(e){return Rb.isSupported(e.context)};var Ef=vde;var xMn=_(T(),1);var Oa={},UHe=new re(0,0,0,1),Lc=new re,DHe=new ze,bJ=new U,gJ=new U;Oa.worldToWindowCoordinates=function(e,t,n){return Oa.worldWithEyeOffsetToWindowCoordinates(e,t,m.ZERO,n)};var wde=new re,Fde=new m;function jW(e,t,n,i){let o=n.viewMatrix,r=F.multiplyByVector(o,re.fromElements(e.x,e.y,e.z,1,wde),wde),s=m.multiplyComponents(t,m.normalize(r,Fde),Fde);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,r,i)}var OHe=new he(Math.PI,X.PI_OVER_TWO),BHe=new m,YHe=new m;Oa.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Oa.computeActualEllipsoidPosition(o,t,UHe);if(!l(r))return;let s=e.canvas,a=DHe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,d=!1;if(o.mode===oe.SCENE2D){let u=e.mapProjection,h=OHe,p=u.project(h,BHe),g=m.clone(c.position,YHe),f=c.frustum.clone(),y=F.computeViewportTransformation(a,0,1,new F),x=c.frustum.projectionMatrix,S=c.positionWC.y,C=m.fromElements(X.sign(S)*p.x-S,0,-c.positionWC.x),V=Ft.pointToGLWindowCoordinates(x,y,C);if(S===0||V.x<=0||V.x>=s.clientWidth)d=!0;else{if(V.x>s.clientWidth*.5){a.width=V.x,c.frustum.right=p.x-S,Lc=jW(r,n,c,Lc),Oa.clipToGLWindowCoordinates(a,Lc,bJ),a.x+=V.x,c.position.x=-c.position.x;let L=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-L,Lc=jW(r,n,c,Lc),Oa.clipToGLWindowCoordinates(a,Lc,gJ)}else{a.x+=V.x,a.width-=V.x,c.frustum.left=-p.x-S,Lc=jW(r,n,c,Lc),Oa.clipToGLWindowCoordinates(a,Lc,bJ),a.x=a.x-a.width,c.position.x=-c.position.x;let L=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-L,Lc=jW(r,n,c,Lc),Oa.clipToGLWindowCoordinates(a,Lc,gJ)}m.clone(g,c.position),c.frustum=f.clone(),i=U.clone(bJ,i),(i.x<0||i.x>s.clientWidth)&&(i.x=gJ.x)}}if(o.mode!==oe.SCENE2D||d){if(Lc=jW(r,n,c,Lc),Lc.z<0&&!(c.frustum instanceof un)&&!(c.frustum instanceof Ar))return;i=Oa.clipToGLWindowCoordinates(a,Lc,i)}return i.y=s.clientHeight-i.y,i};Oa.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Oa.worldToWindowCoordinates(e,t,n),!!l(n))return Oa.transformWindowToDrawingBuffer(e,n,n)};var Zb=new m,zHe=new he;Oa.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return m.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,zHe);if(!l(r))return;if(o.project(r,Zb),i===oe.COLUMBUS_VIEW)return m.fromElements(Zb.z,Zb.x,Zb.y,n);if(i===oe.SCENE2D)return m.fromElements(0,Zb.x,Zb.y,n);let s=e.morphTime;return m.fromElements(X.lerp(Zb.z,t.x,s),X.lerp(Zb.x,t.y,s),X.lerp(Zb.y,t.z,s),n)};var Ade=new m,Mde=new m,Nde=new F;Oa.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,Ade),F.computeViewportTransformation(e,0,1,Nde),F.multiplyByPoint(Nde,Ade,Mde),U.fromCartesian3(Mde,n)};Oa.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*o,t.y*r,n)};var HHe=new re,kde=new re;Oa.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,g)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=re.clone(re.UNIT_W,HHe);u.x=(t.x-d.x)/d.width*2-1,u.y=(t.y-d.y)/d.height*2-1,u.z=n*2-1,u.w=1;let h,p=e.camera.frustum;if(l(p.fovy)){h=F.multiplyByVector(r.inverseViewProjection,u,kde);let g=1/h.w;m.multiplyByScalar(h,g,h)}else{let g=p.offCenterFrustum;l(g)&&(p=g),h=kde,h.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(u.z*(a-c)-a-c)*.5,h.w=1,h=F.multiplyByVector(r.inverseView,h,h)}return m.fromCartesian4(h,i)};var Oi=Oa;var uNn=_(T(),1);var VMn=_(T(),1);var F1={};F1._deprecationWarning=Is;var Gb=Uint32Array.BYTES_PER_ELEMENT;F1.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Gb;let r=o.getUint32(t,!0);if(r!==1)throw new ce(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=Gb;let s=o.getUint32(t,!0);t+=Gb;let a=o.getUint32(t,!0);t+=Gb;let c=o.getUint32(t,!0);t+=Gb;let d=o.getUint32(t,!0);t+=Gb;let u=o.getUint32(t,!0);t+=Gb;let h;d>=570425344?(t-=Gb*2,h=a,d=c,u=0,a=0,c=0,F1._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=Gb,h=d,d=a,u=c,a=0,c=0,F1._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:h??0}:(p=Qo(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let f,y;d>0&&(f=Qo(i,t,d),t+=d,u>0&&(y=new Uint8Array(e,t,u),y=new Uint8Array(y),t+=u));let x=n+s-t;if(x===0)throw new ce("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,x):(F1._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+x))),{batchLength:h,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:y,gltf:S}};var qW=F1;var GMn=_(T(),1);function $W(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Ude(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Q.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function KHe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=Q.createTypedArray(n,i),o[t]=r),r}$W.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??Q.UNSIGNED_INT,n=n??1,Ude(this,e,t,n,1,i.byteOffset)):i};$W.prototype.hasProperty=function(e){return l(this.json[e])};$W.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Q.fromName(i.componentType)),Ude(this,e,t,n,this.featuresLength,i.byteOffset)):KHe(this,e,t,i)};$W.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var ch=$W;var zMn=_(T(),1);function eP(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput,s=JHe(n),a;l(s.jsonProperties)&&(a=new Vb({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new U_({extension:s.hierarchy,binaryBody:i}));let d=th.BATCH_TABLE_CLASS_NAME,u=s.binaryProperties,h,p,g;if(o){let x=jHe(t,d,u,i,r);g=x.transcodedSchema,p=[new aT({propertyAttribute:x.propertyAttributeJson,class:x.transcodedClass})]}else{let x=QHe(t,d,u,i);g=x.transcodedSchema;let S=x.featureTableJson;h=new Nu({count:S.count,properties:S.properties,class:x.transcodedClass,bufferViews:x.bufferViewsTypedArrays}),p=[]}let f=[];if(l(h)||l(a)||l(c)){let x=new sl({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:a,batchTableHierarchy:c});f.push(x)}let y={schema:g,propertyTables:f,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new $s(y)}function JHe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(eP._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function QHe(e,t,n,i){let o={},r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;if(!l(i))throw new ce(`Property ${h} requires a batch table binary.`);let p=n[h],g=Rd(p);r[h]={bufferView:a},o[h]=Dde(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let d=Ed.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:d,transcodedClass:d.classes[t]}}function jHe(e,t,n,i,o){let r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;let p=n[h];if(!l(i)&&!l(p.typedArray))throw new ce(`Property ${h} requires a batch table binary.`);let g=qt.sanitizeGlslIdentifier(h);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let f=Dde(p);f.name=h,r[g]=f;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let x=p.typedArray;l(x)||(x=Rd(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let S=new Vn.Attribute;S.name=y,S.count=e,S.type=p.type;let C=Q.fromTypedArray(x);(C===Q.INT||C===Q.UNSIGNED_INT||C===Q.DOUBLE)&&(eP._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),x=new Float32Array(x)),S.componentDatatype=Q.fromTypedArray(x),S.typedArray=x,o.push(S),s[g]={attribute:y}}let c={classes:{}};c.classes[t]={properties:r};let d=Ed.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:d,transcodedClass:d.classes[t]}}function Dde(e){let t=qHe(e.componentType);return{type:e.type,componentType:t}}function qHe(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"}}eP._deprecationWarning=Is;eP._oneTimeWarning=Vt;var Eb=eP;var dT={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},$He=Vn.FeatureIdAttribute;function Og(e){e=e??Y.EMPTY_OBJECT;let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,c=e.upAxis??vo.Y,d=e.forwardAxis??vo.X,u=e.loadAttributesAsTypedArray??!1,h=e.loadAttributesFor2D??!1,p=e.enablePick??!1,g=e.loadIndicesForWireframe??!1,f=e.loadPrimitiveOutline??!0,y=e.loadForClassification??!1;n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=h,this._enablePick=p,this._loadIndicesForWireframe=g,this._loadPrimitiveOutline=f,this._loadForClassification=y,this._state=dT.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(Og.prototype=Object.create(Qi.prototype),Og.prototype.constructor=Og);Object.defineProperties(Og.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Og.prototype.load=function(){if(l(this._promise))return this._promise;let e=qW.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new ch(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(a)&&(this._transform=F.fromTranslation(m.fromArray(a))),this._batchTable={json:o,binary:r};let c=new ah({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=dT.LOADING;let d=this;return this._promise=c.load().then(function(){if(!d.isDestroyed())return d._state=dT.PROCESSING,d}).catch(function(u){if(!d.isDestroyed())return eKe(d,u)}),this._promise};function eKe(e,t){return e.unload(),e._state=dT.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}Og.prototype.process=function(e){if(this._state===dT.READY)return!0;if(this._state!==dT.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),tKe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=dT.READY,!0};function tKe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=Eb({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new sl({name:th.BATCH_TABLE_CLASS_NAME,count:i});o=new $s({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)Ode(r[a]);t.structuralMetadata=o}function Ode(e){let t=e.children.length;for(let i=0;i<t;i++)Ode(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=qt.getAttributeBySemantic(o,yt.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new $He;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}Og.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var tP=Og;var PNn=_(T(),1);function Bg(e){e=e??Y.EMPTY_OBJECT,this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(Bg.prototype=Object.create(Qi.prototype),Bg.prototype.constructor=Bg);Object.defineProperties(Bg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Bg.prototype.load=function(){return Promise.resolve(this)};Bg.prototype.process=function(e){return l(this._components)||(this._components=fKe(this._geoJson,e),this._geoJson=void 0),!0};function nKe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function iKe(){this.features=[]}function yJ(e){let t=e[0],n=e[1],i=e[2]??0;return new m(t,n,i)}function xJ(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=yJ(e[o]);return[n]}function oKe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=xJ(e[i])[0];return n}function Bde(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=xJ(e[i])[0];return n}function rKe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,Bde(e[i]));return n}function sKe(e){return[yJ(e)]}function aKe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=yJ(e[i]);return n}var cKe={LineString:xJ,MultiLineString:oKe,MultiPolygon:rKe,Polygon:Bde,MultiPoint:aKe,Point:sKe},lKe={LineString:Ae.LINES,MultiLineString:Ae.LINES,MultiPolygon:Ae.LINES,Polygon:Ae.LINES,MultiPoint:Ae.POINTS,Point:Ae.POINTS};function Yde(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=cKe[n],o=lKe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new nKe;o===Ae.LINES?s.lines=i(r):o===Ae.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function dKe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Yde(n[o],t)}var uKe={FeatureCollection:dKe,Feature:Yde},Yk=new m;function mKe(e,t,n){let i=0,o=0,r=e.length;for(let v=0;v<r;v++){let A=e[v];if(l(A.lines)){let b=A.lines.length;for(let R=0;R<b;R++){let G=A.lines[R];i+=G.length,o+=(G.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ne.createTypedArray(i,o),d=Ne.fromTypedArray(c),u=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let v=0;v<r;v++){let A=e[v];if(!l(A.lines))continue;let b=A.lines.length;for(let R=0;R<b;R++){let G=A.lines[R],I=G.length;for(let w=0;w<I;w++){let M=G[w],O=m.fromDegrees(M.x,M.y,M.z,ne.WGS84,Yk),k=F.multiplyByPoint(t,O,Yk);m.minimumByComponent(u,k,u),m.maximumByComponent(h,k,h),m.pack(k,s,p*3),a[p]=v,w<I-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let f=Ct.createVertexBuffer({typedArray:s,context:n.context,usage:ke.STATIC_DRAW});f.vertexArrayDestroyable=!1;let y=Ct.createVertexBuffer({typedArray:a,context:n.context,usage:ke.STATIC_DRAW});y.vertexArrayDestroyable=!1;let x=Ct.createIndexBuffer({typedArray:c,context:n.context,usage:ke.STATIC_DRAW,indexDatatype:d});x.vertexArrayDestroyable=!1;let S=new Vn.Attribute;S.semantic=yt.POSITION,S.componentDatatype=Q.FLOAT,S.type=an.VEC3,S.count=i,S.min=u,S.max=h,S.buffer=f;let C=new Vn.Attribute;C.semantic=yt.FEATURE_ID,C.setIndex=0,C.componentDatatype=Q.FLOAT,C.type=an.SCALAR,C.count=i,C.buffer=y;let V=[S,C],L=new Vn.Material;L.unlit=!0;let Z=new Vn.Indices;Z.indexDatatype=d,Z.count=c.length,Z.buffer=x;let E=new Vn.FeatureIdAttribute;E.featureCount=r,E.propertyTableId=0,E.setIndex=0,E.positionalLabel="featureId_0";let P=[E],W=new Vn.Primitive;return W.attributes=V,W.indices=Z,W.featureIds=P,W.primitiveType=Ae.LINES,W.material=L,W}function hKe(e,t,n){let i=0,o=e.length;for(let V=0;V<o;V++){let L=e[V];l(L.points)&&(i+=L.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),d=0;for(let V=0;V<o;V++){let L=e[V];if(!l(L.points))continue;let Z=L.points.length;for(let E=0;E<Z;E++){let P=L.points[E],W=m.fromDegrees(P.x,P.y,P.z,ne.WGS84,Yk),v=F.multiplyByPoint(t,W,Yk);m.minimumByComponent(a,v,a),m.maximumByComponent(c,v,c),m.pack(v,r,d*3),s[d]=V,d++}}let u=Ct.createVertexBuffer({typedArray:r,context:n.context,usage:ke.STATIC_DRAW});u.vertexArrayDestroyable=!1;let h=Ct.createVertexBuffer({typedArray:s,context:n.context,usage:ke.STATIC_DRAW});h.vertexArrayDestroyable=!1;let p=new Vn.Attribute;p.semantic=yt.POSITION,p.componentDatatype=Q.FLOAT,p.type=an.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=u;let g=new Vn.Attribute;g.semantic=yt.FEATURE_ID,g.setIndex=0,g.componentDatatype=Q.FLOAT,g.type=an.SCALAR,g.count=i,g.buffer=h;let f=[p,g],y=new Vn.Material;y.unlit=!0;let x=new Vn.FeatureIdAttribute;x.featureCount=o,x.propertyTableId=0,x.setIndex=0,x.positionalLabel="featureId_0";let S=[x],C=new Vn.Primitive;return C.attributes=f,C.featureIds=S,C.primitiveType=Ae.POINTS,C.material=y,C}function fKe(e,t){let n=new iKe,i=uKe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new ce("GeoJSON must have at least one feature");let s={};for(let v=0;v<r;v++){let b=o[v].properties??Y.EMPTY_OBJECT;for(let R in b)b.hasOwnProperty(R)&&(l(s[R])||(s[R]=new Array(r)))}for(let v=0;v<r;v++){let A=o[v];for(let b in s)if(s.hasOwnProperty(b)){let R=A.properties[b]??"";s[b][v]=R}}let a=new Vb({count:r,properties:s}),d=[new sl({id:0,count:r,jsonMetadataTable:a})],u=Ed.fromJson({}),h=new $s({schema:u,propertyTables:d}),p=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),f=!1,y=!1;for(let v=0;v<r;v++){let A=o[v];if(l(A.lines)){f=!0;let b=A.lines.length;for(let R=0;R<b;R++){let G=A.lines[R],I=G.length;for(let w=0;w<I;w++)m.minimumByComponent(p,G[w],p),m.maximumByComponent(g,G[w],g)}}if(l(A.points)){y=!0;let b=A.points.length;for(let R=0;R<b;R++){let G=A.points[R];m.minimumByComponent(p,G,p),m.maximumByComponent(g,G,g)}}}let x=m.midpoint(p,g,new m),S=m.fromDegrees(x.x,x.y,x.z,ne.WGS84,new m),C=Ft.eastNorthUpToFixedFrame(S,ne.WGS84,new F),V=F.inverseTransformation(C,new F),L=[];f&&L.push(mKe(o,V,t)),y&&L.push(hKe(o,V,t));let Z=new Vn.Node;Z.index=0,Z.primitives=L;let E=[Z],P=new Vn.Scene;P.nodes=E;let W=new Vn.Components;return W.scene=P,W.nodes=E,W.transform=C,W.structuralMetadata=h,W}Bg.prototype.unload=function(){this._components=void 0};var nP=Bg;var f5n=_(T(),1);var MNn=_(T(),1);var zk={};zk._deprecationWarning=Is;var Yg=Uint32Array.BYTES_PER_ELEMENT;zk.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Yg;let r=o.getUint32(t,!0);if(r!==1)throw new ce(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=Yg;let s=o.getUint32(t,!0);t+=Yg;let a=o.getUint32(t,!0);if(a===0)throw new ce("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Yg;let c=o.getUint32(t,!0);t+=Yg;let d=o.getUint32(t,!0);t+=Yg;let u=o.getUint32(t,!0);t+=Yg;let h=o.getUint32(t,!0);if(h!==1&&h!==0)throw new ce(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${h} is not.`);t+=Yg;let p=Qo(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let f,y;d>0&&(f=Qo(i,t,d),t+=d,u>0&&(y=new Uint8Array(e,t,u),y=new Uint8Array(y),t+=u));let x=n+s-t;if(x===0)throw new ce("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,x):(zk._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+x))),{gltfFormat:h,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:y,gltf:S}};var iP=zk;var Ib={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},Hk=Vn.Attribute,pKe=Vn.FeatureIdAttribute,Hde=Vn.Instances;function Xb(e){e=e??Y.EMPTY_OBJECT;let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,c=e.upAxis??vo.Y,d=e.forwardAxis??vo.X,u=e.loadAttributesAsTypedArray??!1,h=e.loadIndicesForWireframe??!1,p=e.loadPrimitiveOutline??!0,g=e.enablePick??!1;i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=Ib.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(Xb.prototype=Object.create(Qi.prototype),Xb.prototype.constructor=Xb);Object.defineProperties(Xb.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Xb.prototype.load=function(){if(l(this._promise))return this._promise;let e=iP.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new ch(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new ce("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(c)&&(this._transform=F.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:o};let d={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let h=Xl(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});d.gltfResource=p,d.baseResource=p}else d.gltfResource=this._i3dmResource,d.typedArray=e.gltf;let u=new ah(d);return this._gltfLoader=u,this._state=Ib.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=Ib.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw bKe(this,h)}),this._promise};function bKe(e,t){return e.unload(),e._state=Ib.FAILED,e.getError("Failed to load i3dm",t)}Xb.prototype.process=function(e){if(this._state===Ib.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Ib.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),xKe(this,i,e),gKe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Ib.READY,!0};function gKe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=Eb({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new sl({name:th.BATCH_TABLE_CLASS_NAME,count:i});o=new $s({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var Kk=new m,_J=new Array(4),yKe=new F;function xKe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",Q.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=TKe(o,r),h;c&&(h=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let g=new Float32Array(r),f=m.unpackArray(u),y=new m,x=new m,S=new m,C=new m,V=new $,L=new we,Z=new Array(4),E=new m,P=new Array(3),W=new F;if(!l(s)||m.equals(m.unpack(s),m.ZERO)){let k=de.fromPoints(f);for(i=0;i<f.length;i++)m.subtract(f[i],k.center,Kk),u[3*i+0]=Kk.x,u[3*i+1]=Kk.y,u[3*i+2]=Kk.z;let B=F.fromTranslation(k.center,yKe);t.transform=F.multiplyTransformation(B,t.transform,t.transform)}for(i=0;i<r;i++){y=m.clone(f[i]),l(s)&&m.add(y,m.unpack(s),y),c&&(SKe(o,a,i,L,y,S,x,C,V,W),we.pack(L,Z,0),h[4*i+0]=Z[0],h[4*i+1]=Z[1],h[4*i+2]=Z[2],h[4*i+3]=Z[3]),d&&(CKe(o,i,E),m.pack(E,P,0),p[3*i+0]=P[0],p[3*i+1]=P[1],p[3*i+2]=P[2]);let k=o.getProperty("BATCH_ID",Q.UNSIGNED_SHORT,1,i);l(k)||(k=i),g[i]=k}let v=new Hde;v.transformInWorldSpace=!0;let A=e._buffers,b=new Hk;if(b.name="Instance Translation",b.semantic=ss.TRANSLATION,b.componentDatatype=Q.FLOAT,b.type=an.VEC3,b.count=r,b.typedArray=u,!c){let k=Ct.createVertexBuffer({context:n.context,typedArray:u,usage:ke.STATIC_DRAW});k.vertexArrayDestroyable=!1,A.push(k),b.buffer=k}if(v.attributes.push(b),c){let k=new Hk;k.name="Instance Rotation",k.semantic=ss.ROTATION,k.componentDatatype=Q.FLOAT,k.type=an.VEC4,k.count=r,k.typedArray=h,v.attributes.push(k)}if(d){let k=new Hk;if(k.name="Instance Scale",k.semantic=ss.SCALE,k.componentDatatype=Q.FLOAT,k.type=an.VEC3,k.count=r,c)k.typedArray=p;else{let B=Ct.createVertexBuffer({context:n.context,typedArray:p,usage:ke.STATIC_DRAW});B.vertexArrayDestroyable=!1,A.push(B),k.buffer=B}v.attributes.push(k)}let R=new Hk;R.name="Instance Feature ID",R.setIndex=0,R.semantic=ss.FEATURE_ID,R.componentDatatype=Q.FLOAT,R.type=an.SCALAR,R.count=r;let G=Ct.createVertexBuffer({context:n.context,typedArray:g,usage:ke.STATIC_DRAW});G.vertexArrayDestroyable=!1,A.push(G),R.buffer=G,v.attributes.push(R);let I=new pKe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",v.featureIds.push(I);let w=t.nodes,M=w.length,O=!1;for(i=0;i<M;i++){let k=w[i];k.primitives.length>0&&(k.instances=O?_Ke(v):v,O=!0)}}function _Ke(e){let t=new Hde;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Be(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function TKe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Q.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(i))throw new ce("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(o))throw new ce("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new ce("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var zde=new Array(4);function SKe(e,t,n,i,o,r,s,a,c,d){let u=e.getProperty("NORMAL_UP",Q.FLOAT,3,n,_J),h=e.getProperty("NORMAL_RIGHT",Q.FLOAT,3,n,zde),p=!1;if(l(u)){if(!l(h))throw new ce("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");m.unpack(u,0,r),m.unpack(h,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Q.UNSIGNED_SHORT,2,n,_J),f=e.getProperty("NORMAL_RIGHT_OCT32P",Q.UNSIGNED_SHORT,2,n,zde);if(l(g)){if(!l(f))throw new ce("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Fn.octDecodeInRange(g[0],g[1],65535,r),Fn.octDecodeInRange(f[0],f[1],65535,s),p=!0}else t?(Ft.eastNorthUpToFixedFrame(o,ne.WGS84,d),F.getMatrix3(d,c)):$.clone($.IDENTITY,c)}p&&(m.cross(s,r,a),m.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,r,c),$.setColumn(c,2,a,c)),we.fromRotationMatrix(c,i)}function CKe(e,t,n){n=m.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Q.FLOAT,1,t);l(i)&&m.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",Q.FLOAT,3,t,_J);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function VKe(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}Xb.prototype.isUnloaded=function(){return this._state===Ib.UNLOADED};Xb.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),VKe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Ib.UNLOADED};var oP=Xb;var H5n=_(T(),1);var A5n=_(T(),1);var b5n=_(T(),1),LKe={STOPPED:0,ANIMATING:1},lh=Object.freeze(LKe);var E5n=_(T(),1);var A1=Vn.AnimatedPropertyType;function TJ(e){e=e??Y.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,IKe(this)}Object.defineProperties(TJ.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 RKe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new j0({times:e,points:n,inTangents:i,outTangents:o})}function Kde(e,t,n,i){if(e.length===1&&t.length===1)return new ZE(t[0]);switch(n){case Om.STEP:return new PI({times:e,points:t});case Om.CUBICSPLINE:return RKe(e,t);case Om.LINEAR:return i===A1.ROTATION?new ZI({times:e,points:t}):new Q0({times:e,points:t})}}function ZKe(e,t,n,i,o){let r=[];if(i===A1.WEIGHTS){let a=t.length/o,c,d;for(c=0;c<o;c++){let u=new Array(a),h=c;if(n===Om.CUBICSPLINE)for(d=0;d<a;d+=3)u[d]=t[h],u[d+1]=t[h+o],u[d+2]=t[h+2*o],h+=o*3;else for(d=0;d<a;d++)u[d]=t[h],h+=o;r.push(Kde(e,u,n,i))}}else r.push(Kde(e,t,n,i));return r}var GKe=new m,EKe=new we;function IKe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,d=l(c.morphWeights)?c.morphWeights.length:1,u=ZKe(i,o,r,a,d);e._splines=u,e._path=a}TJ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===A1.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],d=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(d)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===A1.TRANSLATION||n===A1.SCALE?o[n]=r.evaluate(s,GKe):n===A1.ROTATION&&(o[n]=r.evaluate(s,EKe))}}};var rP=TJ;function SJ(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=q.clone(n.startTime),this._delay=n.delay??0,this._stopTime=q.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??Dl.NONE,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=lh.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,XKe(this)}Object.defineProperties(SJ.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 XKe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let d=r[c],u=d.target;if(!l(u))continue;let h=u.node.index,p=i._runtimeNodes[h],g=new rP({channel:d,runtimeAnimation:e,runtimeNode:p}),f=d.sampler.input;t=Math.min(t,f[0]),n=Math.max(n,f[f.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}SJ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var sP=SJ;function Wb(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Wb.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function CJ(e,t,n){let i=e._model,o=new sP(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}Wb.prototype.add=function(e){e=e??Y.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return CJ(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 CJ(this,n[i],e)};Wb.prototype.addAll=function(e){e=e??Y.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=CJ(this,n[r],e);i.push(s)}return i};Wb.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};Wb.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])};Wb.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Wb.prototype.get=function(e){return this._runtimeAnimations[e]};var Jk=[];function WKe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Wb.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&q.equals(e.time,this._previousTime))return!1;this._previousTime=q.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=q.addSeconds(a.startTime??o,a.delay,new q)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,d=a._duration,u=a.stopTime,h=q.lessThanOrEquals(c,o),p=l(u)&&q.greaterThan(o,u),g=0;if(d!==0){let x=q.secondsDifference(p?u:o,c);g=l(a._animationTime)?a._animationTime(d,x):x/d}let f=a.loop===Dl.REPEAT||a.loop===Dl.MIRRORED_REPEAT,y=(h||f&&!l(a.startTime))&&(g<=1||f)&&!p;if(g===a._prevAnimationDelta){let x=a._state===lh.STOPPED;if(y!==x)continue}if(a._prevAnimationDelta=g,y||a._state===lh.ANIMATING){if(y&&a._state===lh.STOPPED&&(a._state=lh.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Dl.REPEAT)g=g-Math.floor(g);else if(a.loop===Dl.MIRRORED_REPEAT){let S=Math.floor(g),C=g-S;g=S%2===1?1-C:C}a.reverse&&(g=1-g);let x=g*d*a.multiplier;x=X.clamp(x,a.localStartTime,a.localStopTime),a.animate(x),a.update.numberOfListeners>0&&(a._updateEventTime=x,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=lh.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&Jk.push(a))}}n=Jk.length;for(let s=0;s<n;++s){let a=Jk[s];t.splice(t.indexOf(a),1),e.afterRender.push(WKe(this,r,a))}return Jk.length=0,i};var aP=Wb;var ukn=_(T(),1);var j5n=_(T(),1);function uT(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(uT.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new D),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});uT.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};uT.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};uT.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};uT.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};uT.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var cP=uT;var $5n=_(T(),1),lP={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};lP.getStyleCommandsNeeded=function(e,t){return t===0?lP.ALL_OPAQUE:t===e?lP.ALL_TRANSLUCENT:lP.OPAQUE_AND_TRANSLUCENT};var dh=Object.freeze(lP);var tkn=_(T(),1);var zg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};zg.is3DTiles=function(e){switch(e){case zg.TILE_GLTF:case zg.TILE_B3DM:case zg.TILE_I3DM:case zg.TILE_PNTS:case zg.TILE_GEOJSON:return!0;case zg.GLTF:return!1}};var hr=Object.freeze(zg);function zr(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=dh.ALL_OPAQUE,PKe(this)}Object.defineProperties(zr.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 PKe(e){let t=e._model,n=hr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new js(s,o)}else for(o=0;o<i;o++)r[o]=new cP({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new ol({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}zr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=dh.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};zr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};zr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};zr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};zr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};zr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};zr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};zr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};zr.prototype.getFeature=function(e){return this._features[e]};zr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};zr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};zr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};zr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};zr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};zr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};zr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};zr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};zr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var vKe=new D;zr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(ol.DEFAULT_COLOR_VALUE),this.setAllShow(ol.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,vKe)??ol.DEFAULT_COLOR_VALUE:ol.DEFAULT_COLOR_VALUE,o=l(e.show)?e.show.evaluate(n)??ol.DEFAULT_SHOW_VALUE:ol.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};zr.prototype.isDestroyed=function(){return!1};zr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var dP=zr;var QKn=_(T(),1);var gkn=_(T(),1);var Jde={name:"TilesetPipelineStage"};Jde.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,ge.FRAGMENT);let r={u_polygonOffset:function(){return U.ZERO}};e.uniformMap=Rt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK};var uP=Jde;var Gkn=_(T(),1);var xkn=_(T(),1),mP=`// 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 Tkn=_(T(),1),hP=`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 Qde={name:"AtmospherePipelineStage"};Qde.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,ge.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([hP]),i.addFragmentLines([mP]),i.addUniform("bool","u_isInFog",ge.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=m.distance(n.camera.positionWC,t.boundingSphere.center);return X.fog(o,n.fog.density)>X.EPSILON3}};var fP=Qde;var Mkn=_(T(),1);var Ikn=_(T(),1),pP=`#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 jde={name:"ImageBasedLightingPipelineStage"},wKe=new U;jde.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,ge.FRAGMENT),r.addUniform("vec2","model_iblFactor",ge.FRAGMENT),qm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",ge.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ge.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ge.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,ge.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",ge.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ge.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT)),r.addFragmentLines(pP);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,wKe)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=Rt(c,e.uniformMap)};var bP=jde;var qkn=_(T(),1);var zkn=_(T(),1);var FKe=X.EPSILON16;function LJ(e){e=e??Y.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(LJ.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=X.clamp(e,this.minimumValue,this.maximumValue),X.equalsEpsilon(this._currentValue,e,FKe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var AKe=new m,VJ=new $;LJ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=AKe,o;switch(t){case dc.XROTATE:o=$.fromRotationX(X.toRadians(n),VJ),e=F.multiplyByMatrix3(e,o,e);break;case dc.YROTATE:o=$.fromRotationY(X.toRadians(n),VJ),e=F.multiplyByMatrix3(e,o,e);break;case dc.ZROTATE:o=$.fromRotationZ(X.toRadians(n),VJ),e=F.multiplyByMatrix3(e,o,e);break;case dc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case dc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case dc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case dc.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case dc.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case dc.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case dc.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var gP=LJ;function Qk(e){e=e??Y.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,MKe(this)}Object.defineProperties(Qk.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 MKe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new gP({stage:a,runtimeArticulation:e});o.push(c);let d=a.name;r[d]=c}}Qk.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var NKe=new F,kKe=new F;Qk.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,NKe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=F.multiplyTransformation(s.originalTransform,e,kKe);s.transform=a}};var yP=Qk;var aUn=_(T(),1);var eUn=_(T(),1),xP=`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 M1={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};M1.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,ge.FRAGMENT),i.addFragmentLines(xP);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=Ge.TRANSLUCENT),i.addUniform("vec4",M1.COLOR_UNIFORM_NAME,ge.FRAGMENT),o[M1.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",M1.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),o[M1.COLOR_BLEND_UNIFORM_NAME]=function(){return Cc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Rt(o,e.uniformMap)};var Hg=M1;var gUn=_(T(),1);var lUn=_(T(),1),_P=`#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 qde={name:"ModelClippingPlanesPipelineStage"},UKe=new U;qde.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ge.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ge.FRAGMENT),ys.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ge.FRAGMENT);let s=ys.getTextureResolution(i,o,UKe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ge.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ge.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ge.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ge.FRAGMENT),r.addFragmentLines(_P);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=D.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=Rt(a,e.uniformMap)};var TP=qde;var ZUn=_(T(),1);var xUn=_(T(),1),SP=`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 TUn=_(T(),1),CP=`void modelClippingPolygonsStage()
|
|
|
{
|
|
|
vec2 clippingPosition = v_clippingPosition;
|
|
|
int regionIndex = v_regionIndex;
|
|
|
czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
|
|
|
}
|
|
|
`;var $de={name:"ModelClippingPolygonsPipelineStage"};$de.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ge.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ge.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ge.BOTH),o.addUniform("sampler2D","model_clippingDistance",ge.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ge.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(SP),o.addFragmentLines(CP);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=Rt(r,e.uniformMap)};var VP=$de;var IUn=_(T(),1);function eue(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(eue.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 LP=eue;var CDn=_(T(),1);var oDn=_(T(),1);var WUn=_(T(),1),RP=`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 vUn=_(T(),1),ZP=`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 FUn=_(T(),1),GP=`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 jk=new F,DKe=new F,OKe=new F,nue={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:aue,_transformsToTypedArray:ZJ};nue.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(RP);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,h=[];oJe(e,n,i,h,d,u),aJe(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ge.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ge.VERTEX),p.u_instance_modifiedModelView=function(){let g=F.multiplyTransformation(s.modelMatrix,a.components.transform,jk);return d?F.multiplyTransformation(n.context.uniformState.view3D,g,jk):(n.mode!==oe.SCENE3D&&(g=Ft.basisTo2D(n.mapProjection,g,jk)),F.multiplyTransformation(n.context.uniformState.view,g,jk))},p.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,DKe)},r.addVertexLines(GP)):r.addVertexLines(ZP),d){r.addDefine("USE_2D_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_modelView2D",ge.VERTEX);let g=n.context,f=F.fromTranslation(c.instancingReferencePoint2D,new F);p.u_modelView2D=function(){return F.multiplyTransformation(g.uniformState.view,f,OKe)}}e.uniformMap=Rt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,h)};var EP=new F,BKe=new m;function YKe(e,t,n,i,o){let r=F.multiplyTransformation(t,e,EP);return r=F.multiplyTransformation(r,n,EP),o=Ft.basisTo2D(i.mapProjection,r,o),o}function zKe(e,t,n,i,o){let r=F.fromTranslation(e,EP),s=F.multiplyTransformation(t,r,EP);s=F.multiplyTransformation(s,n,EP);let a=F.getTranslation(s,BKe);return o=Oi.computeActualEllipsoidPosition(i,a,o),o}function iue(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=F.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(o.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var oue=new F,rue=new F,HKe=new F,KKe=new m;function JKe(e,t,n,i){let o=oue,r=rue;iue(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],h=YKe(u,o,r,n,HKe),p=F.getTranslation(h,KKe),g=m.subtract(p,a,p);i[d]=F.setTranslation(h,g,i[d])}return i}function QKe(e,t,n,i){let o=oue,r=rue;iue(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],h=zKe(u,o,r,n,u);i[d]=m.subtract(h,a,i[d])}return i}var jKe=new m,qKe=new m;function sue(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=F.multiplyByPoint(i,n.instancingTranslationMin,jKe),r=Oi.computeActualEllipsoidPosition(t,o,o),s=F.multiplyByPoint(i,n.instancingTranslationMax,qKe),a=Oi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=m.lerp(r,a,.5,new m)}function ZJ(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function $Ke(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var eJe=new m,tJe=new we,nJe=new m;function aue(e,t,n){let i=new Array(t),o=qt.getAttributeBySemantic(e,ss.TRANSLATION),r=qt.getAttributeBySemantic(e,ss.ROTATION),s=qt.getAttributeBySemantic(e,ss.SCALE),a=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=l(o),u=l(r),h=l(s),p=d?o.typedArray:new Float32Array(t*3),g=u?r.typedArray:new Float32Array(t*4);u&&r.normalized&&(g=Fn.dequantize(g,r.componentDatatype,r.type,t));let f;h?f=s.typedArray:(f=new Float32Array(t*3),f.fill(1));for(let x=0;x<t;x++){let S=new m(p[x*3],p[x*3+1],p[x*3+2],eJe);m.maximumByComponent(a,S,a),m.minimumByComponent(c,S,c);let C=new we(g[x*4],g[x*4+1],g[x*4+2],u?g[x*4+3]:1,tJe),V=new m(f[x*3],f[x*3+1],f[x*3+2],nJe),L=F.fromTranslationQuaternionRotationScale(S,C,V,new F);i[x]=L}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=a,d&&(o.typedArray=void 0),u&&(r.typedArray=void 0),h&&(s.typedArray=void 0),i}function iJe(e,t,n){let i=new Array(t),o=e.typedArray,r=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let d=new m(o[c*3],o[c*3+1],o[c*3+2]);i[c]=d,m.minimumByComponent(r,d,r),m.maximumByComponent(s,d,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function GJ(e,t){let n=Ct.createVertexBuffer({context:t.context,typedArray:e,usage:ke.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function oJe(e,t,n,i,o,r){let s=qt.getAttributeBySemantic(n,ss.ROTATION);l(s)?rJe(e,n,i,t,o,r):sJe(e,n,i,t,o)}function rJe(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,d=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let u="Transform",h,p=d.instancingTransformsBuffer;if(!l(p)){h=aue(t,a,e);let x=ZJ(h);p=GJ(x,i),c._modelResources.push(p),r&&(d.transformsTypedArray=x),d.instancingTransformsBuffer=p}if(tue(e,p,n,u),!o)return;let g=Be(i);g.mode=oe.COLUMBUS_VIEW,sue(e,g);let f=d.instancingTransformsBuffer2D;if(!l(f)){let x=JKe(h,e,g,h),S=ZJ(x);f=GJ(S,i),c._modelResources.push(f),d.instancingTransformsBuffer2D=f}tue(e,f,n,"Transform2D")}function sJe(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=qt.getAttributeBySemantic(t,ss.TRANSLATION),d=qt.getAttributeBySemantic(t,ss.SCALE);if(l(d)&&(s.addDefine("HAS_INSTANCE_SCALE"),RJ(e,d.buffer,d.byteOffset,d.byteStride,n,"Scale")),!l(c))return;let u,h=c.typedArray;if(l(h)?u=iJe(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),RJ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let g=Be(i);g.mode=oe.COLUMBUS_VIEW,sue(e,g);let f=a.instancingTranslationBuffer2D;if(!l(f)){let C=QKe(u,e,g,u),V=$Ke(C);r&&(a.transformsTypedArray=V),f=GJ(V,i),e.model._modelResources.push(f),a.instancingTranslationBuffer2D=f}if(!o)return;RJ(e,f,0,void 0,n,"Translation2D")}function tue(e,t,n,i){let r=Q.getSizeInBytes(Q.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function RJ(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function aJe(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===ss.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:an.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var IP=nue;var lDn=_(T(),1);var EJ={};EJ.name="ModelMatrixUpdateStage";EJ.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;cue(e,t,o,e.transformToRoot),e._transformDirty=!1}};function cJe(e,t,n){e.modelMatrix=F.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=qt.getCullFace(e.modelMatrix,e.primitiveType)}function cue(e,t,n,i){let o;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];cJe(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=F.clone(i,a._transformToRoot),cue(a,t,n,i),a._transformDirty=!1}}var XP=EJ;var mDn=_(T(),1);var lue={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:due,_countGeneratedBuffers:uue};lue.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;due(i,o),uue(i,r)};function due(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 uue(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 WP=lue;function N1(e){e=e??Y.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,lJe(this)}Object.defineProperties(N1.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=F.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;m.equals(n,e)||(t.translation=m.clone(e,t.translation),IJ(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;we.equals(n,e)||(t.rotation=we.clone(e,t.rotation),IJ(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;m.equals(n,e)||(t.scale=m.clone(e,t.scale),IJ(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 lJe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new Vg(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 IJ(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}N1.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};N1.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(IP),t.push(WP),n.push(XP)};N1.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};N1.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new F);let r=F.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=F.inverseTransformation(r,t[o]);t[o]=F.multiplyTransformation(s,n[o],t[o])}};var PP=N1;var Ezn=_(T(),1);var EDn=_(T(),1);var mue={name:"AlphaPipelineStage"};mue.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===Ge.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=fn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,ge.FRAGMENT),s.addUniform("float","u_alphaCutoff",ge.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var vP=mue;var WDn=_(T(),1);var hue={name:"BatchTexturePipelineStage"};hue.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Rt(o,e.uniformMap)};var wP=hue;var NDn=_(T(),1);var fue={name:"ClassificationPipelineStage"};fue.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ge.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||dJe(t,o)};function dJe(e,t){let n=qt.getAttributeBySemantic(e,yt.POSITION);if(!l(n))throw new ce("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=qt.getAttributeBySemantic(e,yt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let d=[],u=[0],h=r?i[0]:0,p=c[h],g=0;for(let y=1;y<s;y++){let x=r?i[y]:y,S=c[x];if(S!==p){let C=y-g,V=y;d.push(C),u.push(V),g=V,p=S}}let f=s-g;d.push(f),t.batchLengths=d,t.batchOffsets=u}var FP=fue;var qDn=_(T(),1);var UDn=_(T(),1),AP=`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 ODn=_(T(),1),MP=`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 pue={name:"CPUStylingPipelineStage"};pue.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(AP),o.addFragmentLines(MP),o.addDefine("USE_CPU_STYLING",void 0,ge.BOTH),l(i.color)||(o.addUniform("float",Hg.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),e.uniformMap[Hg.COLOR_BLEND_UNIFORM_NAME]=function(){return Cc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",ge.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ge.TRANSLUCENT}};var NP=pue;var eOn=_(T(),1),bue={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};bue.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var Pb=Object.freeze(bue);var jOn=_(T(),1);var nOn=_(T(),1),kP=`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 oOn=_(T(),1),UP=`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 TOn=_(T(),1);var sOn=_(T(),1),DP=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
|
|
|
initializeFeatureIds(featureIds, attributes);
|
|
|
initializeFeatureIdAliases(featureIds);
|
|
|
}
|
|
|
`;var cOn=_(T(),1),OP=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
|
|
|
{
|
|
|
initializeFeatureIds(featureIds, attributes);
|
|
|
initializeFeatureIdAliases(featureIds);
|
|
|
setFeatureIdVaryings();
|
|
|
}
|
|
|
`;var Bi={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()"};Bi.process=function(e,t,n){let i=e.shaderBuilder;uJe(i);let o=e.runtimeNode.node.instances;l(o)&&mJe(e,o,n),hJe(e,t,n),i.addVertexLines(OP),i.addFragmentLines(DP)};function uJe(e){e.addStruct(Bi.STRUCT_ID_FEATURE_IDS_VS,Bi.STRUCT_NAME_FEATURE_IDS,ge.VERTEX),e.addStruct(Bi.STRUCT_ID_FEATURE_IDS_FS,Bi.STRUCT_NAME_FEATURE_IDS,ge.FRAGMENT),e.addFunction(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Bi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.VERTEX),e.addFunction(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Bi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.FRAGMENT),e.addFunction(Bi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Bi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.VERTEX),e.addFunction(Bi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Bi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.FRAGMENT),e.addFunction(Bi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Bi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,ge.VERTEX)}function mJe(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof Vn.FeatureIdAttribute?fJe(e,s,a):gue(e,s,a,o,1,n);let c=s.label;l(c)&&yue(e,a,c,ge.BOTH)}}function hJe(e,t,n){let i=t.featureIds,r=qt.getAttributeBySemantic(t,yt.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,d=ge.BOTH;a instanceof Vn.FeatureIdAttribute?pJe(e,a,c):a instanceof Vn.FeatureIdImplicitRange?gue(e,a,c,r,void 0,n):(bJe(e,a,c,s,n),d=ge.FRAGMENT);let u=a.label;l(u)&&yue(e,c,u,d)}}function fJe(e,t,n){let i=e.shaderBuilder;i.addStructField(Bi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Bi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,d=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[d]),i.addVarying("float",a),i.addFunctionLines(Bi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function pJe(e,t,n){let i=e.shaderBuilder;i.addStructField(Bi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Bi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function gue(e,t,n,i,o,r){gJe(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Bi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Bi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Bi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function bJe(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return a.texture??o.context.defaultTexture};let c=a.channels,d=e.shaderBuilder;d.addStructField(Bi.STRUCT_ID_FEATURE_IDS_FS,"int",n),d.addUniform("sampler2D",r,ge.FRAGMENT);let h=`v_texCoord_${a.texCoord}`,p=h,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let x=`${r}Transform`;d.addUniform("mat3",x,ge.FRAGMENT),s[x]=function(){return g},p=`vec2(${x} * vec3(${h}, 1.0))`}let f=`texture(${r}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${f});`;d.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function yue(e,t,n,i){let o=e.shaderBuilder,r=ge.includesVertexShader(i);r&&o.addStructField(Bi.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Bi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Bi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function gJe(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let d=yJe(t,n);s=Ct.createVertexBuffer({context:o.context,typedArray:d,usage:ke.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Q.FLOAT,strideInBytes:Q.getSizeInBytes(Q.FLOAT),offsetInBytes:0};e.attributes.push(c)}function yJe(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 Kg=Bi;var vOn=_(T(),1);var COn=_(T(),1),BP=`void metadataStage(
|
|
|
out Metadata metadata,
|
|
|
out MetadataClass metadataClass,
|
|
|
out MetadataStatistics metadataStatistics,
|
|
|
ProcessedAttributes attributes
|
|
|
)
|
|
|
{
|
|
|
initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
|
|
|
}
|
|
|
`;var LOn=_(T(),1),YP=`void metadataStage(
|
|
|
out Metadata metadata,
|
|
|
out MetadataClass metadataClass,
|
|
|
out MetadataStatistics metadataStatistics,
|
|
|
ProcessedAttributes attributes
|
|
|
)
|
|
|
{
|
|
|
initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
|
|
|
setMetadataVaryings();
|
|
|
}
|
|
|
`;var Ri={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Ri.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=xJe(r.propertyAttributes,t,a),d=TJe(r.propertyTextures,a),u=c.concat(d);CJe(i,u),RJe(i),i.addVertexLines(YP),i.addFragmentLines(BP);for(let h=0;h<c.length;h++){let p=c[h];ZJe(e,p)}for(let h=0;h<d.length;h++){let p=d[h];EJe(e,p)}};function xJe(e,t,n){return l(e)?e.flatMap(i=>_Je(i,t,n)):[]}function _Je(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=qt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),d=new Array(c.length);for(let u=0;u<c.length;u++){let[h,p]=c[u],g=i(t,p.attribute),{glslType:f,variableName:y}=o(g);d[u]={metadataVariable:r(h),property:p,type:p.classProperty.type,glslType:f,variableName:y,propertyStatistics:a?.properties[h],shaderDestination:ge.BOTH}}return d}function TJe(e,t){return l(e)?e.flatMap(n=>SJe(n,t)):[]}function SJe(e,t){let{sanitizeGlslIdentifier:n}=qt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,d]=r[a];s[a]={metadataVariable:n(c),property:d,type:d.classProperty.type,glslType:d.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:ge.FRAGMENT}}return s}function CJe(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:d,propertyStatistics:u}=t[a];n.add(d),l(u)&&c!==mt.ENUM&&i.add(d)}let o=Ri.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Ri.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,d){e.addStruct(a,a,ge.BOTH);for(let u=0;u<d.length;u++){let{shaderName:h}=d[u],p=d[u].type==="float"?LJe(c):c;e.addStructField(a,p,h)}}}var VJe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function LJe(e){let t=VJe[e];return l(t)?t:e}function RJe(e){e.addStruct(Ri.STRUCT_ID_METADATA_VS,Ri.STRUCT_NAME_METADATA,ge.VERTEX),e.addStruct(Ri.STRUCT_ID_METADATA_FS,Ri.STRUCT_NAME_METADATA,ge.FRAGMENT),e.addStruct(Ri.STRUCT_ID_METADATA_CLASS_VS,Ri.STRUCT_NAME_METADATA_CLASS,ge.VERTEX),e.addStruct(Ri.STRUCT_ID_METADATA_CLASS_FS,Ri.STRUCT_NAME_METADATA_CLASS,ge.FRAGMENT),e.addStruct(Ri.STRUCT_ID_METADATA_STATISTICS_VS,Ri.STRUCT_NAME_METADATA_STATISTICS,ge.VERTEX),e.addStruct(Ri.STRUCT_ID_METADATA_STATISTICS_FS,Ri.STRUCT_NAME_METADATA_STATISTICS,ge.FRAGMENT),e.addFunction(Ri.FUNCTION_ID_INITIALIZE_METADATA_VS,Ri.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.VERTEX),e.addFunction(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,Ri.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.FRAGMENT),e.addFunction(Ri.FUNCTION_ID_SET_METADATA_VARYINGS,Ri.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,ge.VERTEX)}function ZJe(e,t){GJe(e,t),xue(e.shaderBuilder,t),_ue(e.shaderBuilder,t)}function GJe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=Sue({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:ge.BOTH,property:o});n.addStructField(Ri.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Ri.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function EJe(e,t){IJe(e,t),xue(e.shaderBuilder,t),_ue(e.shaderBuilder,t)}function IJe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:d,texture:u,transform:h}=s.textureReader,p=`u_propertyTexture_${d}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,ge.FRAGMENT),i[p]=()=>u),n.addStructField(Ri.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,f=g;if(l(h)&&!$.equals(h,$.IDENTITY)){let V=`${p}Transform`;n.addUniform("mat3",V,ge.FRAGMENT),i[V]=function(){return h},f=`vec2(${V} * vec3(${g}, 1.0))`}let y=`texture(${p}, ${f}).${c}`,x=s.unpackInShader(y),S=Sue({valueExpression:x,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ge.FRAGMENT,property:s}),C=`metadata.${o} = ${S};`;n.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,[C])}function xue(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Tue(Ri.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Ri.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,s),ge.includesVertexShader(r)&&(e.addStructField(Ri.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function _ue(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===mt.ENUM)return;let s=Ri.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Tue(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(Ri.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,c),ge.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ri.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Tue(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function Sue(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:d}=e;s.addUniform(c,o,d),s.addUniform(c,r,d);let{offset:u,scale:h}=n;return a[o]=()=>u,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var Uu=Ri;var FOn=_(T(),1),XJe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Jg=Object.freeze(XJe);var xs={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:Vt};xs.process=function(e,t,n){let i=e.model.customShader;if(i&&xs.process_original(e,t,n,i),l(e.model._marsOptions)&&l(e.model._marsOptions.customShaders)){let o=Ep.getCache(e.model._marsOptions.customShaders);for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&xs.process_original(e,t,n,o[r])}};xs.process_original=function(e,t,n,i){let{shaderBuilder:o,alphaOptions:r}=e,{lightingModel:s,translucencyMode:a}=i;l(s)&&(e.lightingOptions.lightingModel=s),a===Jg.TRANSLUCENT?r.pass=Ge.TRANSLUCENT:a===Jg.OPAQUE&&(r.pass=void 0);let c=NJe(i,t);if(!c.customShaderEnabled)return;if(OJe(o,i,c),c.shouldComputePositionWC&&o.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ge.BOTH),l(i.vertexShaderText)&&o.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ge.VERTEX),l(i.fragmentShaderText)){o.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ge.FRAGMENT);let h=Pb.getDefineName(i.mode);o.addDefine(h,void 0,ge.FRAGMENT)}let d=i.uniforms;for(let h in d)if(d.hasOwnProperty(h)){let p=d[h];o.addUniform(p.type,h)}let u=i.varyings;for(let h in u)if(u.hasOwnProperty(h)){let p=u[h];o.addVarying(p,h)}e.uniformMap=Rt(e.uniformMap,i.uniformMap)};function WJe(e){let t={};for(let n=0;n<e.length;n++){let i=qt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var PJe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},vJe={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 Cue(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=PJe[t],i=vJe[t];if(l(n))return{attributeField:[n,e],value:i}}function wJe(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=Vue(t,n,!1),o=Lue(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let u=[i[c].glslType,c];s.push(u),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let d=o[c],u=Cue(d);if(!l(u))return xs._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};s.push(u.attributeField),r=`vsInput.attributes.${d} = ${u.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function FJe(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 AJe(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=Vue(t,n,!0),o=Lue(t,n,!0),r,s=[],a=[];for(let d in i){if(!i.hasOwnProperty(d))continue;let h=[i[d].glslType,d];s.push(h),r=`fsInput.attributes.${d} = attributes.${d};`,a.push(r)}for(let d=0;d<o.length;d++){let u=o[d],h=Cue(u);if(!l(h))return xs._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${u}, disabling custom fragment shader.`),{enabled:!1};s.push(h.attributeField),r=`fsInput.attributes.${u} = ${h.value};`,a.push(r)}let c=FJe(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var MJe={positionWC:!0,positionEC:!0};function Vue(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function Lue(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||MJe.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 NJe(e,t){let n=WJe(t.attributes),i=wJe(e,n),o=AJe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function kJe(e,t){let n=xs.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,xs.STRUCT_NAME_ATTRIBUTES,ge.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=xs.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,xs.STRUCT_NAME_VERTEX_INPUT,ge.VERTEX),e.addStructField(n,xs.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Kg.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Uu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Uu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Uu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=xs.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,xs.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,ge.VERTEX),e.addFunctionLines(r,o)}function UJe(e,t){let n=xs.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,xs.STRUCT_NAME_ATTRIBUTES,ge.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=xs.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,xs.STRUCT_NAME_FRAGMENT_INPUT,ge.FRAGMENT),e.addStructField(n,xs.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Kg.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Uu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Uu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Uu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=xs.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,xs.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,ge.FRAGMENT),e.addFunctionLines(r,o)}var DJe=[];function OJe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=DJe;i.enabled&&(kJe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,kP),e.addVertexLines(r)),o.enabled&&(UJe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,UP),e.addFragmentLines(r))}var zP=xs;var o3n=_(T(),1);var HP={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};HP.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,ge.VERTEX),i.addFunction(HP.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,HP.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,ge.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],d=c.quantization;if(!l(d))continue;let u=c.semantic===yt.POSITION,h=c.semantic===yt.TEXCOORD;if(r&&!u&&!h)continue;let p=qt.getAttributeInfo(c);YJe(i,p),BJe(e,p)}};function BJe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,ge.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,ge.VERTEX),n.addUniform(c,a,ge.VERTEX);let d=r.quantizedVolumeOffset,u=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(d=Rue(d,0),u=Rue(u,1)),i[s]=function(){return d},i[a]=function(){return u}}}function Rue(e,t){return e instanceof re?e:new re(e.x,e.y,e.z,t)}function YJe(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=zJe(n,i):o=HJe(n),e.addFunctionLines(HP.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function zJe(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 HJe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var KP=HP;var X3n=_(T(),1);var s3n=_(T(),1),JP=`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 c3n=_(T(),1),QP=`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 g3n=_(T(),1);var d3n=_(T(),1),k1=`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 jP={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};jP.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=KJe(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),JJe(i);let c=s.featureIds.nullFeatureId,d=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return c}),s.shaderDestination===ge.BOTH&&i.addVertexLines(k1),i.addFragmentLines(k1)};function Zue(e){return e instanceof Vn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Gue(e){return e instanceof Vn.FeatureIdTexture?ge.FRAGMENT:ge.BOTH}function KJe(e,t,n){let i,o;return l(t.instances)&&(o=qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Gue(o),featureIdDefine:Zue(o)}):(o=qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Gue(o),featureIdDefine:Zue(o)})}function JJe(e){e.addStructField(jP.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(jP.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(jP.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Qg=jP;var ea={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)"};ea.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(ea.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",ge.VERTEX),i.addStruct(ea.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",ge.FRAGMENT),i.addStruct(Qg.STRUCT_ID_SELECTED_FEATURE,Qg.STRUCT_NAME_SELECTED_FEATURE,ge.BOTH),i.addFunction(ea.FUNCTION_ID_INITIALIZE_ATTRIBUTES,ea.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,ge.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(ea.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(ea.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(ea.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,ea.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.VERTEX),i.addFunction(ea.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,ea.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.FRAGMENT),o.type===hr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,ge.FRAGMENT);let r=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let d=0;d<c;d++){let u=t.attributes[d],h=an.getAttributeLocationCount(u.type),p=u.semantic===yt.POSITION,g;h>1?(g=e.attributeIndex,e.attributeIndex+=h):p&&!a?g=0:g=e.attributeIndex++,QJe(e,u,g,h,r,s)}rQe(i,t.attributes),t.primitiveType===Ae.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(QP),i.addFragmentLines(JP)};function QJe(e,t,n,i,o,r){let s=e.shaderBuilder,a=qt.getAttributeInfo(t),c=o&&!r;i>1?$Je(e,t,n,i):qJe(e,t,n,c),tQe(s,a,c),eQe(s,a),l(t.semantic)&&jJe(s,t),nQe(s,a,o),iQe(s,a,c),oQe(s,a)}function jJe(e,t){let{semantic:n,setIndex:i}=t;switch(n){case yt.NORMAL:e.addDefine("HAS_NORMALS");break;case yt.TANGENT:e.addDefine("HAS_TANGENTS");break;case yt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case yt.TEXCOORD:case yt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function qJe(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===yt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===yt.POSITION,u=d?0:n,h=an.getNumberOfComponents(a),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let g=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:h,componentDatatype:Q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function $Je(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,d=an.getNumberOfComponents(s)/i,u=Q.getSizeInBytes(a),h=d*u,p=t.byteStride;for(let g=0;g<i;g++){let f=t.byteOffset+g*h,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:d,componentDatatype:a,offsetInBytes:f,strideInBytes:p,normalize:r};e.attributes.push(y)}}function eQe(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function tQe(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===yt.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function nQe(e,t,n){let i=ea.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=ea.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function iQe(e,t,n){let i=ea.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function oQe(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=ea.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=ea.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function rQe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===yt.NORMAL?n=!0:r.semantic===yt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(ea.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(ea.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var qP=ea;var U3n=_(T(),1);var P3n=_(T(),1),$P=`#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 w3n=_(T(),1),sQe={UNLIT:0,PBR:1},If=Object.freeze(sQe);var Eue={name:"LightingPipelineStage"};Eue.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,ge.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",ge.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===If.PBR?o.addDefine("LIGHTING_PBR",void 0,ge.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,ge.FRAGMENT),o.addFragmentLines($P)};var e2=Eue;var iBn=_(T(),1);var O3n=_(T(),1),t2=`// If the style color is white, it implies the feature has not been styled.
|
|
|
bool isDefaultStyleColor(vec3 color)
|
|
|
{
|
|
|
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
|
|
|
}
|
|
|
|
|
|
vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
|
|
|
{
|
|
|
vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
|
|
|
vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
|
|
|
return color;
|
|
|
}
|
|
|
|
|
|
vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)
|
|
|
{
|
|
|
return vec2(textureTransform * vec3(texCoord, 1.0));
|
|
|
}
|
|
|
|
|
|
#ifdef HAS_NORMAL_TEXTURE
|
|
|
vec2 getNormalTexCoords()
|
|
|
{
|
|
|
vec2 texCoord = TEXCOORD_NORMAL;
|
|
|
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
|
|
|
texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0));
|
|
|
#endif
|
|
|
return texCoord;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE)
|
|
|
vec3 computeTangent(in vec3 position, in vec2 normalTexCoords)
|
|
|
{
|
|
|
vec2 tex_dx = dFdx(normalTexCoords);
|
|
|
vec2 tex_dy = dFdy(normalTexCoords);
|
|
|
float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y;
|
|
|
vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position);
|
|
|
return tangent / determinant;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#ifdef USE_ANISOTROPY
|
|
|
struct NormalInfo {
|
|
|
vec3 tangent;
|
|
|
vec3 bitangent;
|
|
|
vec3 normal;
|
|
|
vec3 geometryNormal;
|
|
|
};
|
|
|
|
|
|
NormalInfo getNormalInfo(ProcessedAttributes attributes)
|
|
|
{
|
|
|
vec3 geometryNormal = attributes.normalEC;
|
|
|
#ifdef HAS_NORMAL_TEXTURE
|
|
|
vec2 normalTexCoords = getNormalTexCoords();
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_BITANGENTS
|
|
|
vec3 tangent = attributes.tangentEC;
|
|
|
vec3 bitangent = attributes.bitangentEC;
|
|
|
#else // Assume HAS_NORMAL_TEXTURE
|
|
|
vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords);
|
|
|
tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent));
|
|
|
vec3 bitangent = normalize(cross(geometryNormal, tangent));
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_NORMAL_TEXTURE
|
|
|
mat3 tbn = mat3(tangent, bitangent, geometryNormal);
|
|
|
vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
|
|
|
normalSample = 2.0 * normalSample - 1.0;
|
|
|
#ifdef HAS_NORMAL_TEXTURE_SCALE
|
|
|
normalSample.xy *= u_normalTextureScale;
|
|
|
#endif
|
|
|
vec3 normal = normalize(tbn * normalSample);
|
|
|
#else
|
|
|
vec3 normal = geometryNormal;
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_DOUBLE_SIDED_MATERIAL
|
|
|
if (czm_backFacing()) {
|
|
|
tangent *= -1.0;
|
|
|
bitangent *= -1.0;
|
|
|
normal *= -1.0;
|
|
|
geometryNormal *= -1.0;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
NormalInfo normalInfo;
|
|
|
normalInfo.tangent = tangent;
|
|
|
normalInfo.bitangent = bitangent;
|
|
|
normalInfo.normal = normal;
|
|
|
normalInfo.geometryNormal = geometryNormal;
|
|
|
|
|
|
return normalInfo;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
|
|
|
vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
|
|
|
{
|
|
|
vec2 normalTexCoords = getNormalTexCoords();
|
|
|
|
|
|
// If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
|
|
|
#ifdef HAS_BITANGENTS
|
|
|
vec3 t = attributes.tangentEC;
|
|
|
vec3 b = attributes.bitangentEC;
|
|
|
#else
|
|
|
vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
|
|
|
t = normalize(t - geometryNormal * dot(geometryNormal, t));
|
|
|
vec3 b = normalize(cross(geometryNormal, t));
|
|
|
#endif
|
|
|
|
|
|
mat3 tbn = mat3(t, b, geometryNormal);
|
|
|
vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
|
|
|
normalSample = 2.0 * normalSample - 1.0;
|
|
|
#ifdef HAS_NORMAL_TEXTURE_SCALE
|
|
|
normalSample.xy *= u_normalTextureScale;
|
|
|
#endif
|
|
|
return normalize(tbn * normalSample);
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
|
|
|
vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
|
|
|
{
|
|
|
vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL;
|
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM
|
|
|
normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0));
|
|
|
#endif
|
|
|
|
|
|
// If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
|
|
|
#ifdef HAS_BITANGENTS
|
|
|
vec3 t = attributes.tangentEC;
|
|
|
vec3 b = attributes.bitangentEC;
|
|
|
#else
|
|
|
vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
|
|
|
t = normalize(t - geometryNormal * dot(geometryNormal, t));
|
|
|
vec3 b = normalize(cross(geometryNormal, t));
|
|
|
#endif
|
|
|
|
|
|
mat3 tbn = mat3(t, b, geometryNormal);
|
|
|
vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb;
|
|
|
normalSample = 2.0 * normalSample - 1.0;
|
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE
|
|
|
normalSample.xy *= u_clearcoatNormalTextureScale;
|
|
|
#endif
|
|
|
return normalize(tbn * normalSample);
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_NORMALS
|
|
|
vec3 computeNormal(ProcessedAttributes attributes)
|
|
|
{
|
|
|
// Geometry normal. This is already normalized
|
|
|
vec3 normal = attributes.normalEC;
|
|
|
|
|
|
#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
|
|
|
normal = getNormalFromTexture(attributes, normal);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_DOUBLE_SIDED_MATERIAL
|
|
|
if (czm_backFacing()) {
|
|
|
normal = -normal;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
return normal;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_BASE_COLOR_TEXTURE
|
|
|
vec4 getBaseColorFromTexture()
|
|
|
{
|
|
|
vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
|
|
|
#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
|
|
|
baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
|
|
|
#endif
|
|
|
|
|
|
vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));
|
|
|
|
|
|
#ifdef HAS_BASE_COLOR_FACTOR
|
|
|
baseColorWithAlpha *= u_baseColorFactor;
|
|
|
#endif
|
|
|
|
|
|
return baseColorWithAlpha;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_EMISSIVE_TEXTURE
|
|
|
vec3 getEmissiveFromTexture()
|
|
|
{
|
|
|
vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;
|
|
|
#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM
|
|
|
emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
|
|
|
#endif
|
|
|
|
|
|
vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);
|
|
|
#ifdef HAS_EMISSIVE_FACTOR
|
|
|
emissive *= u_emissiveFactor;
|
|
|
#endif
|
|
|
|
|
|
return emissive;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
|
|
|
void setSpecularGlossiness(inout czm_modelMaterial material)
|
|
|
{
|
|
|
#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE
|
|
|
vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;
|
|
|
#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM
|
|
|
specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
|
|
|
#endif
|
|
|
|
|
|
vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));
|
|
|
vec3 specular = specularGlossiness.rgb;
|
|
|
float glossiness = specularGlossiness.a;
|
|
|
#ifdef HAS_LEGACY_SPECULAR_FACTOR
|
|
|
specular *= u_legacySpecularFactor;
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_GLOSSINESS_FACTOR
|
|
|
glossiness *= u_glossinessFactor;
|
|
|
#endif
|
|
|
#else
|
|
|
#ifdef HAS_LEGACY_SPECULAR_FACTOR
|
|
|
vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0));
|
|
|
#else
|
|
|
vec3 specular = vec3(1.0);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_GLOSSINESS_FACTOR
|
|
|
float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
|
|
|
#else
|
|
|
float glossiness = 1.0;
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_DIFFUSE_TEXTURE
|
|
|
vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;
|
|
|
#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM
|
|
|
diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
|
|
|
#endif
|
|
|
|
|
|
vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
|
|
|
#ifdef HAS_DIFFUSE_FACTOR
|
|
|
diffuse *= u_diffuseFactor;
|
|
|
#endif
|
|
|
#elif defined(HAS_DIFFUSE_FACTOR)
|
|
|
vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
|
|
|
#else
|
|
|
vec4 diffuse = vec4(1.0);
|
|
|
#endif
|
|
|
|
|
|
material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular));
|
|
|
// the specular glossiness extension's alpha overrides anything set
|
|
|
// by the base material.
|
|
|
material.alpha = diffuse.a;
|
|
|
|
|
|
material.specular = specular;
|
|
|
|
|
|
// glossiness is the opposite of roughness, but easier for artists to use.
|
|
|
material.roughness = 1.0 - glossiness;
|
|
|
}
|
|
|
#elif defined(LIGHTING_PBR)
|
|
|
float setMetallicRoughness(inout czm_modelMaterial material)
|
|
|
{
|
|
|
#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
|
|
|
vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
|
|
|
#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
|
|
|
metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
|
|
|
#endif
|
|
|
|
|
|
vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
|
|
|
float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
|
|
|
float roughness = clamp(metallicRoughness.g, 0.0, 1.0);
|
|
|
#ifdef HAS_METALLIC_FACTOR
|
|
|
metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_ROUGHNESS_FACTOR
|
|
|
roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0);
|
|
|
#endif
|
|
|
#else
|
|
|
#ifdef HAS_METALLIC_FACTOR
|
|
|
float metalness = clamp(u_metallicFactor, 0.0, 1.0);
|
|
|
#else
|
|
|
float metalness = 1.0;
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_ROUGHNESS_FACTOR
|
|
|
float roughness = clamp(u_roughnessFactor, 0.0, 1.0);
|
|
|
#else
|
|
|
float roughness = 1.0;
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
// dielectrics use f0 = 0.04, metals use albedo as f0
|
|
|
const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
|
|
|
vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness);
|
|
|
|
|
|
material.specular = f0;
|
|
|
|
|
|
// diffuse only applies to dielectrics.
|
|
|
material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);
|
|
|
|
|
|
// This is perceptual roughness. The square of this value is used for direct lighting
|
|
|
material.roughness = roughness;
|
|
|
|
|
|
return metalness;
|
|
|
}
|
|
|
#ifdef USE_SPECULAR
|
|
|
void setSpecular(inout czm_modelMaterial material, in float metalness)
|
|
|
{
|
|
|
#ifdef HAS_SPECULAR_TEXTURE
|
|
|
vec2 specularTexCoords = TEXCOORD_SPECULAR;
|
|
|
#ifdef HAS_SPECULAR_TEXTURE_TRANSFORM
|
|
|
specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform);
|
|
|
#endif
|
|
|
float specularWeight = texture(u_specularTexture, specularTexCoords).a;
|
|
|
#ifdef HAS_SPECULAR_FACTOR
|
|
|
specularWeight *= u_specularFactor;
|
|
|
#endif
|
|
|
#else
|
|
|
#ifdef HAS_SPECULAR_FACTOR
|
|
|
float specularWeight = u_specularFactor;
|
|
|
#else
|
|
|
float specularWeight = 1.0;
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_SPECULAR_COLOR_TEXTURE
|
|
|
vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR;
|
|
|
#ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM
|
|
|
specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform);
|
|
|
#endif
|
|
|
vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb;
|
|
|
vec3 specularColorFactor = czm_srgbToLinear(specularColorSample);
|
|
|
#ifdef HAS_SPECULAR_COLOR_FACTOR
|
|
|
specularColorFactor *= u_specularColorFactor;
|
|
|
#endif
|
|
|
#else
|
|
|
#ifdef HAS_SPECULAR_COLOR_FACTOR
|
|
|
vec3 specularColorFactor = u_specularColorFactor;
|
|
|
#else
|
|
|
vec3 specularColorFactor = vec3(1.0);
|
|
|
#endif
|
|
|
#endif
|
|
|
material.specularWeight = specularWeight;
|
|
|
vec3 f0 = material.specular;
|
|
|
vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0));
|
|
|
material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness);
|
|
|
}
|
|
|
#endif
|
|
|
#ifdef USE_ANISOTROPY
|
|
|
void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo)
|
|
|
{
|
|
|
mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x);
|
|
|
float anisotropyStrength = u_anisotropy.z;
|
|
|
|
|
|
vec2 direction = vec2(1.0, 0.0);
|
|
|
#ifdef HAS_ANISOTROPY_TEXTURE
|
|
|
vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY;
|
|
|
#ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM
|
|
|
anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform);
|
|
|
#endif
|
|
|
vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb;
|
|
|
direction = anisotropySample.rg * 2.0 - vec2(1.0);
|
|
|
anisotropyStrength *= anisotropySample.b;
|
|
|
#endif
|
|
|
|
|
|
direction = rotation * direction;
|
|
|
mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal);
|
|
|
vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0));
|
|
|
vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT);
|
|
|
|
|
|
material.anisotropicT = anisotropicT;
|
|
|
material.anisotropicB = anisotropicB;
|
|
|
material.anisotropyStrength = anisotropyStrength;
|
|
|
}
|
|
|
#endif
|
|
|
#ifdef USE_CLEARCOAT
|
|
|
void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes)
|
|
|
{
|
|
|
#ifdef HAS_CLEARCOAT_TEXTURE
|
|
|
vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT;
|
|
|
#ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM
|
|
|
clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform);
|
|
|
#endif
|
|
|
float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r;
|
|
|
#ifdef HAS_CLEARCOAT_FACTOR
|
|
|
clearcoatFactor *= u_clearcoatFactor;
|
|
|
#endif
|
|
|
#else
|
|
|
#ifdef HAS_CLEARCOAT_FACTOR
|
|
|
float clearcoatFactor = u_clearcoatFactor;
|
|
|
#else
|
|
|
// PERFORMANCE_IDEA: this case should turn the whole extension off
|
|
|
float clearcoatFactor = 0.0;
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE
|
|
|
vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS;
|
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM
|
|
|
clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform);
|
|
|
#endif
|
|
|
float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g;
|
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
|
|
|
clearcoatRoughness *= u_clearcoatRoughnessFactor;
|
|
|
#endif
|
|
|
#else
|
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
|
|
|
float clearcoatRoughness = u_clearcoatRoughnessFactor;
|
|
|
#else
|
|
|
float clearcoatRoughness = 0.0;
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
material.clearcoatFactor = clearcoatFactor;
|
|
|
// This is perceptual roughness. The square of this value is used for direct lighting
|
|
|
material.clearcoatRoughness = clearcoatRoughness;
|
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
|
|
|
material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);
|
|
|
#else
|
|
|
material.clearcoatNormal = attributes.normalEC;
|
|
|
#endif
|
|
|
}
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
|
|
|
{
|
|
|
#ifdef USE_ANISOTROPY
|
|
|
NormalInfo normalInfo = getNormalInfo(attributes);
|
|
|
material.normalEC = normalInfo.normal;
|
|
|
#elif defined(HAS_NORMALS)
|
|
|
material.normalEC = computeNormal(attributes);
|
|
|
#endif
|
|
|
|
|
|
vec4 baseColorWithAlpha = vec4(1.0);
|
|
|
// Regardless of whether we use PBR, set a base color
|
|
|
#ifdef HAS_BASE_COLOR_TEXTURE
|
|
|
baseColorWithAlpha = getBaseColorFromTexture();
|
|
|
#elif defined(HAS_BASE_COLOR_FACTOR)
|
|
|
baseColorWithAlpha = u_baseColorFactor;
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
|
|
|
baseColorWithAlpha = v_pointCloudColor;
|
|
|
#elif defined(HAS_COLOR_0)
|
|
|
vec4 color = attributes.color_0;
|
|
|
// .pnts files store colors in the sRGB color space
|
|
|
#ifdef HAS_SRGB_COLOR
|
|
|
color = czm_srgbToLinear(color);
|
|
|
#endif
|
|
|
baseColorWithAlpha *= color;
|
|
|
#endif
|
|
|
|
|
|
#ifdef USE_CPU_STYLING
|
|
|
baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);
|
|
|
#endif
|
|
|
material.baseColor = baseColorWithAlpha;
|
|
|
material.diffuse = baseColorWithAlpha.rgb;
|
|
|
material.alpha = baseColorWithAlpha.a;
|
|
|
|
|
|
#ifdef HAS_OCCLUSION_TEXTURE
|
|
|
vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
|
|
|
#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
|
|
|
occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
|
|
|
#endif
|
|
|
material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_EMISSIVE_TEXTURE
|
|
|
material.emissive = getEmissiveFromTexture();
|
|
|
#elif defined(HAS_EMISSIVE_FACTOR)
|
|
|
material.emissive = u_emissiveFactor;
|
|
|
#endif
|
|
|
|
|
|
#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
|
|
|
setSpecularGlossiness(material);
|
|
|
#elif defined(LIGHTING_PBR)
|
|
|
float metalness = setMetallicRoughness(material);
|
|
|
#ifdef USE_SPECULAR
|
|
|
setSpecular(material, metalness);
|
|
|
#endif
|
|
|
#ifdef USE_ANISOTROPY
|
|
|
setAnisotropy(material, normalInfo);
|
|
|
#endif
|
|
|
#ifdef USE_CLEARCOAT
|
|
|
setClearcoat(material, attributes);
|
|
|
#endif
|
|
|
#endif
|
|
|
}
|
|
|
`;var{Material:aQe,MetallicRoughness:XJ,SpecularGlossiness:WJ,Specular:Iue,Clearcoat:Xue}=Vn,Wue={name:"MaterialPipelineStage",_processTexture:Ol,_processTextureTransform:Pue};Wue.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:d,defaultNormalTexture:u,defaultEmissiveTexture:h}=n.context;lQe(i,r,s,d,u,h,c),l(i.specularGlossiness)?dQe(i.specularGlossiness,r,s,d,c):(l(i.specular)&&qt.supportedExtensions.KHR_materials_specular&&uQe(i.specular,r,s,d,c),l(i.anisotropy)&&qt.supportedExtensions.KHR_materials_anisotropy&&hQe(i.anisotropy,r,s,d,c),l(i.clearcoat)&&qt.supportedExtensions.KHR_materials_clearcoat&&fQe(i.clearcoat,r,s,d,c),pQe(i.metallicRoughness,r,s,d,c));let p=qt.getAttributeBySemantic(t,yt.NORMAL),g=e.lightingOptions;i.unlit||!p||a?g.lightingModel=If.UNLIT:g.lightingModel=If.PBR;let f=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=f;let y=e.alphaOptions;i.alphaMode===Gf.BLEND?y.pass=Ge.TRANSLUCENT:i.alphaMode===Gf.MASK&&(y.alphaCutoff=i.alphaCutoff),s.addFragmentLines(t2),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,ge.BOTH)};function Pue(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,ge.FRAGMENT),t[s]=function(){return n.transform}}function cQe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,ge.FRAGMENT),t[s]=function(){return n.scale}}function Ol(e,t,n,i,o,r){e.addUniform("sampler2D",i,ge.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,ge.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,d=`TEXCOORD_${o}`;e.addDefine(d,c,ge.FRAGMENT);let u=n.transform;l(u)&&!$.equals(u,$.IDENTITY)&&Pue(e,t,n,i,o);let{scale:h}=n;l(h)&&h!==1&&cQe(e,t,n,i,o)}function lQe(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:d,occlusionTexture:u}=e;l(a)&&!m.equals(a,aQe.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",ge.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,ge.FRAGMENT),l(c)&&!s&&Ol(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(d)&&!s&&Ol(n,t,d,"u_normalTexture","NORMAL",o),l(u)&&!s&&Ol(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function dQe(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:d}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,ge.FRAGMENT),l(r)&&!o&&Ol(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!re.equals(s,WJ.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",ge.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,ge.FRAGMENT)),l(a)&&!o&&Ol(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!m.equals(c,WJ.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",ge.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),l(d)&&d!==WJ.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",ge.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,ge.FRAGMENT))}function uQe(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,ge.FRAGMENT),l(r)&&!o&&Ol(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==Iue.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",ge.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),l(a)&&!o&&Ol(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!m.equals(c,Iue.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",ge.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,ge.FRAGMENT))}var mQe=new m;function hQe(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,ge.FRAGMENT),l(a)&&!o&&Ol(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),d=Math.sin(s);n.addUniform("vec3","u_anisotropy",ge.FRAGMENT),t.u_anisotropy=function(){return m.fromElements(c,d,r,mQe)}}function fQe(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:d}=e;n.addDefine("USE_CLEARCOAT",void 0,ge.FRAGMENT),l(r)&&r!==Xue.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",ge.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,ge.FRAGMENT)),l(s)&&!o&&Ol(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==Xue.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",ge.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT)),l(c)&&!o&&Ol(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(d)&&!o&&Ol(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function pQe(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,ge.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&Ol(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!re.equals(s,XJ.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",ge.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,ge.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&Ol(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==XJ.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",ge.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,ge.FRAGMENT));let d=e.roughnessFactor;l(d)&&d!==XJ.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",ge.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT))}var n2=Wue;var sBn=_(T(),1);var cl={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"};cl.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(cl.METADATA_PICKING_VALUE_TYPE,"float",ge.FRAGMENT),i.addDefine(cl.METADATA_PICKING_VALUE_STRING,"0.0",ge.FRAGMENT),i.addDefine(cl.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",ge.FRAGMENT),i.addDefine(cl.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",ge.FRAGMENT),i.addDefine(cl.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",ge.FRAGMENT),i.addDefine(cl.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",ge.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",ge.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${cl.METADATA_PICKING_VALUE_TYPE} value = ${cl.METADATA_PICKING_VALUE_TYPE}(${cl.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${cl.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${cl.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${cl.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${cl.METADATA_PICKING_VALUE_COMPONENT_W};`],ge.FRAGMENT)};var Xd=cl;var bBn=_(T(),1);var cBn=_(T(),1),i2=`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 Ba={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)"};Ba.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,ge.VERTEX),TQe(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,d=c.length;for(let u=0;u<d;u++){let h=c[u],p=h.semantic;p!==yt.POSITION&&p!==yt.NORMAL&&p!==yt.TANGENT||(gQe(e,h,e.attributeIndex,a),e.attributeIndex++)}}SQe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,ge.VERTEX),n.addVertexLines(i2);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Rt(s,e.uniformMap)};var bQe={attributeString:void 0,functionId:void 0};function gQe(e,t,n,i){let o=e.shaderBuilder;yQe(e,t,n);let r=xQe(t,bQe);_Qe(o,r,i)}function yQe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:an.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function xQe(e,t){switch(e.semantic){case yt.POSITION:t.attributeString="Position",t.functionId=Ba.FUNCTION_ID_GET_MORPHED_POSITION;break;case yt.NORMAL:t.attributeString="Normal",t.functionId=Ba.FUNCTION_ID_GET_MORPHED_NORMAL;break;case yt.TANGENT:t.attributeString="Tangent",t.functionId=Ba.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function _Qe(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 TQe(e){e.addFunction(Ba.FUNCTION_ID_GET_MORPHED_POSITION,Ba.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,ge.VERTEX),e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Ba.FUNCTION_ID_GET_MORPHED_NORMAL,Ba.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,ge.VERTEX),e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Ba.FUNCTION_ID_GET_MORPHED_TANGENT,Ba.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,ge.VERTEX),e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function SQe(e){e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var o2=Ba;var RBn=_(T(),1);var vue={name:"PickingPipelineStage"};vue.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)CQe(e,t,a,i);else if(l(a))VQe(e,i);else{let c=wue(e),d=i.createPickId(c);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",ge.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor"}};function wue(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(hr.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 CQe(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=qt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=qt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",ge.FRAGMENT);let u=c.batchTexture;e.uniformMap.model_pickTexture=function(){return u.pickTexture??u.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function VQe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let h=0;h<n;h++){let p=wue(e,h),g=t.createPickId(p);s.push(g),i[h]=g;let f=g.color;o[h*4+0]=D.floatToByte(f.red),o[h*4+1]=D.floatToByte(f.green),o[h*4+2]=D.floatToByte(f.blue),o[h*4+3]=D.floatToByte(f.alpha)}r._pickIds=i;let a=Ct.createVertexBuffer({context:t,typedArray:o,usage:ke.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let d={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(d);let u=e.shaderBuilder;u.addDefine("USE_PICKING",void 0,ge.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var r2=vue;var KBn=_(T(),1);var GBn=_(T(),1),LQe={ADD:0,REPLACE:1},Do=Object.freeze(LQe);var IBn=_(T(),1),s2=`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 RQe=new re,Aue={name:"PointCloudStylingPipelineStage"};Aue.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,d=!l(a)&&c;if(l(r)&&!d){let y=IQe(a),x=XQe(r,y);WQe(i,x);let C=PQe(x).indexOf("normalMC")>=0,V=qt.getAttributeBySemantic(t,yt.NORMAL);if(C&&!V)throw new ce("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ge.VERTEX),x.styleTranslucent&&(e.alphaOptions.pass=Ge.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ge.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ge.VERTEX);let h,p,g;hr.is3DTiles(o.type)&&(p=!0,h=o.content,g=h.tile.refine===Do.ADD),i.addUniform("vec4","model_pointCloudParameters",ge.VERTEX),i.addVertexLines(s2);let f=e.uniformMap;f.model_pointCloudParameters=function(){let y=RQe,x=1;p&&(x=g?5:h.tileset.memoryAdjustedScreenSpaceError),y.x=u.maximumAttenuation??x,y.x*=n.pixelRatio;let S=ZQe(e,t,u,h);y.y=S*u.geometricErrorScale;let C=n.context,V=n.camera.frustum,L;return n.mode===oe.SCENE2D||V instanceof un?L=Number.POSITIVE_INFINITY:L=C.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=L,p&&(y.w=h.tileset.timeSinceLoad),y}};var Fue=new m;function ZQe(e,t,n,i){if(l(i)){let u=i.tile.geometricError;if(u>0)return u}if(l(n.baseResolution))return n.baseResolution;let o=qt.getAttributeBySemantic(t,yt.POSITION),r=o.count,s=e.runtimeNode.transform,a=m.subtract(o.max,o.min,Fue);a=F.multiplyByPointAsVector(s,a,Fue);let c=a.x*a.y*a.z;return X.cbrt(c/r)}var GQe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},EQe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function IQe(e){let t=Be(EQe);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 PJ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function XQe(e,t){let n=GQe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${PJ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${PJ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${PJ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function WQe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,ge.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,ge.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,ge.VERTEX),e.addVertexLines(o))}function vJ(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 PQe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&vJ(t,o),l(n)&&vJ(n,o),l(i)&&vJ(i,o),o}var a2=Aue;var rYn=_(T(),1);var QBn=_(T(),1),c2=`void primitiveOutlineStage() {
|
|
|
v_outlineCoordinates = a_outlineCoordinates;
|
|
|
}
|
|
|
`;var qBn=_(T(),1),l2=`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 Mue={name:"PrimitiveOutlinePipelineStage"};Mue.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,ge.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:an.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",ge.FRAGMENT);let a=cT.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",ge.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",ge.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(c2),i.addFragmentLines(l2)};var d2=Mue;var uYn=_(T(),1);var Nue={name:"PrimitiveStatisticsPipelineStage",_countGeometry:kue,_count2DPositions:Uue,_countMorphTargetAttributes:Due,_countMaterialTextures:Oue,_countFeatureIdTextures:Bue,_countBinaryMetadata:Yue};Nue.process=function(e,t,n){let i=e.model,o=i.statistics;kue(o,t),Uue(o,e.runtimePrimitive),Due(o,t),Oue(o,t.material),Bue(o,t.featureIds),Yue(o,i)};function kue(e,t){let n=l(t.indices)?t.indices.count:qt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Ae.POINTS?e.pointsLength+=n:Ae.isTriangles(i)&&(e.trianglesLength+=vQe(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let d=o[c];if(l(d.buffer)){let u=l(d.typedArray);e.addBuffer(d.buffer,u)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function vQe(e,t){switch(e){case Ae.TRIANGLES:return t/3;case Ae.TRIANGLE_STRIP:case Ae.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Uue(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Due(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let d=s[c];l(d.buffer)&&e.addBuffer(d.buffer,i)}}}function Oue(e,t){let n=wQe(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 wQe(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 Bue(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Vn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Yue(e,t){let n=t.structuralMetadata;l(n)&&(FQe(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function FQe(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].textureReader;l(d.texture)&&e.addTexture(d.texture)}}}var u2=Nue;var RYn=_(T(),1);var AQe=new F,MQe=new F,zue={name:"SceneMode2DPipelineStage"};zue.process=function(e,t,n){let i=qt.getAttributeBySemantic(t,yt.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=F.multiplyTransformation(s,a,AQe),d=UQe(e,c,n),u=e.runtimePrimitive;u.boundingSphere2D=d;let h=e.runtimeNode.node.instances;if(l(h))return;if(l(i.typedArray)){let y=BQe(i,c,d,n);u.positionBuffer2D=y,r._modelResources.push(y),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,ge.VERTEX),o.addUniform("mat4","u_modelView2D",ge.VERTEX);let p=F.fromTranslation(d.center,new F),g=n.context,f={u_modelView2D:function(){return F.multiplyTransformation(g.uniformState.view,p,MQe)}};e.uniformMap=Rt(f,e.uniformMap)};var NQe=new m,kQe=new m;function UQe(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,NQe),o=Oi.computeActualEllipsoidPosition(n,i,i),r=F.multiplyByPoint(t,e.positionMax,kQe),s=Oi.computeActualEllipsoidPosition(n,r,r);return de.fromCornerPoints(o,s,new de)}var Hue=new m;function DQe(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=m.fromArray(e,s,Hue),c=m.multiplyComponents(a,r,a),d=m.add(c,o,c);i[s]=d.x,i[s+1]=d.y,i[s+2]=d.z}return i}function OQe(e,t,n,i){let o;l(e.quantization)?o=DQe(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let d=m.fromArray(o,c,Hue);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=F.multiplyByPoint(t,d,d),h=Oi.computeActualEllipsoidPosition(i,u,u),p=m.subtract(h,n,h);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function BQe(e,t,n,i){let o=Be(i);o.mode=oe.COLUMBUS_VIEW;let r=n.center,s=OQe(e,t,r,o),a=Ct.createVertexBuffer({context:i.context,typedArray:s,usage:ke.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var m2=zue;var vYn=_(T(),1);var GYn=_(T(),1),h2=`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 mT={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};mT.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,ge.VERTEX),zQe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,ge.VERTEX),n.addVertexLines(h2);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Rt(r,e.uniformMap)};function YQe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===yt.JOINTS||r.semantic===yt.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function zQe(e,t){e.addFunction(mT.FUNCTION_ID_GET_SKINNING_MATRIX,mT.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,ge.VERTEX),e.addFunctionLines(mT.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=YQe(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],d=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(mT.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(mT.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var f2=mT;var UYn=_(T(),1);var FYn=_(T(),1),p2=`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 Kue={name:"VerticalExaggerationPipelineStage"},HQe=new U;Kue.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(p2),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,ge.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",ge.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return U.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,HQe)}};var b2=Kue;var qYn=_(T(),1);var Jue={name:"WireframePipelineStage"};Jue.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,ge.FRAGMENT);let o=e.model,r=KQe(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Ae.LINES,e.count=i1.getWireframeIndicesCount(a,c)};function KQe(e,t,n){let o=qt.getAttributeBySemantic(e,yt.POSITION).count,r=n.context.webgl2,s;if(l(t)){let u=t.buffer,h=t.count;l(u)&&r?(s=u.sizeInBytes===h?new Uint8Array(h):Ne.createTypedArray(o,h),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=i1.createWireframeIndices(a,o,s),d=Ne.fromSizeInBytes(c.BYTES_PER_ELEMENT);return Ct.createIndexBuffer({context:n.context,typedArray:c,usage:ke.STATIC_DRAW,indexDatatype:d})}var g2=Jue;function Que(e){e=e??Y.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=[]}Que.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 v=Ep.getCache(o._marsOptions.customShaders);for(let A in v)if(Object.prototype.hasOwnProperty.call(v,A)){r=v[A];break}}let s=o.style,a=e.context.webgl2,d=e.mode!==oe.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r),y=!(g&&l(r.fragmentShaderText))||r.mode!==Pb.REPLACE_MATERIAL,x=qt.hasQuantizedAttributes(n.attributes),S=o.debugWireframe&&Ae.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),C=o.pointCloudShading,V=l(C)&&C.attenuation,L=l(C)&&C.backFaceCulling,Z=n.primitiveType===Ae.POINTS&&(l(s)||V||L),E=o._enableShowOutline&&l(n.outlineCoordinates),P=JQe(o,i,n),W=l(o.classificationType);d&&t.push(m2),t.push(qP),S&&t.push(g2),W&&t.push(FP),h&&t.push(o2),p&&t.push(f2),Z&&t.push(a2),x&&t.push(KP),y&&t.push(n2),t.push(Kg),t.push(Uu),t.push(Xd),P.hasPropertyTable&&(t.push(Qg),t.push(wP),t.push(NP)),u&&t.push(b2),g&&t.push(zP),t.push(e2),o.allowPicking&&t.push(r2),E&&t.push(d2),t.push(vP),t.push(u2)};function JQe(e,t,n){let i;return l(t.instances)&&(i=qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var y2=Que;var Pzn=_(T(),1);function wJ(e){e=e??Y.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],QQe(this)}Object.defineProperties(wJ.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 QQe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let d=i[c].index,u=r[d];s.push(u);let h=n[c],p=jue(u,h,new F);a.push(p)}}function jue(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}wJ.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]=jue(i,o,e[n])}};var x2=wJ;var Uzn=_(T(),1);var wzn=_(T(),1);function jQe(){this.pass=void 0,this.alphaCutoff=void 0}var _2=jQe;function qQe(e){this.shaderBuilder=new Cx,this.model=e,this.uniformMap={},this.alphaOptions=new _2,this.renderStateOptions=Ue.getState(Ue.fromCache({depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var T2=qQe;var qzn=_(T(),1);var Ozn=_(T(),1),S2=`void silhouetteStage(inout vec4 color) {
|
|
|
if(model_silhouettePass) {
|
|
|
color = czm_gammaCorrect(model_silhouetteColor);
|
|
|
}
|
|
|
}`;var Yzn=_(T(),1),C2=`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 qk={name:"ModelSilhouettePipelineStage"};qk.silhouettesLength=0;qk.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++qk.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,ge.BOTH),i.addVertexLines(C2),i.addFragmentLines(S2),i.addUniform("vec4","model_silhouetteColor",ge.FRAGMENT),i.addUniform("float","model_silhouetteSize",ge.VERTEX),i.addUniform("bool","model_silhouettePass",ge.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Rt(o,e.uniformMap),e.hasSilhouette=!0};var V2=qk;var rHn=_(T(),1);var eHn=_(T(),1),L2=`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 $k={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};$k.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ge.FRAGMENT),i.addFragmentLines(L2);let o={};i.addUniform("float",$k.SPLIT_DIRECTION_UNIFORM_NAME,ge.FRAGMENT),o[$k.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Rt(o,e.uniformMap)};var R2=$k;var cHn=_(T(),1);function $Qe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Be(e.uniformMap),this.alphaOptions=Be(e.alphaOptions),this.renderStateOptions=Be(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var Z2=$Qe;var _Hn=_(T(),1);var mHn=_(T(),1);function e4e(e){e=e??Y.EMPTY_OBJECT,this.lightingModel=e.lightingModel??If.UNLIT}var G2=e4e;function t4e(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=Be(e.uniformMap),this.alphaOptions=Be(e.alphaOptions),this.renderStateOptions=Be(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:qt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=qt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=de.fromCornerPoints(this.positionMin,this.positionMax,new de),this.lightingOptions=new G2,this.pickId=void 0}var E2=t4e;var TKn=_(T(),1);var vHn=_(T(),1);function AJ(e){e=e??Y.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!==On.CESIUM_3D_TILE,this._classifies3DTiles=o!==On.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],r4e(this)}function n4e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:e,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL},depthMask:!1}}var i4e={stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND},o4e={stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:Bn.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},eme=[];function r4e(e){let t=e._command,n=eme;if(e._useDebugWireframe){t.pass=Ge.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=I2(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Ge.TERRAIN_CLASSIFICATION,s=FJ(t,r),a=que(t,r);n.length=0,n.push(s,a),e._commandListTerrain=I2(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=$ue(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Ge.CESIUM_3D_TILE_CLASSIFICATION,s=FJ(t,r),a=que(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=I2(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=$ue(e,n,e._commandList3DTilesPicking))}}function I2(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let d=o[c],u=r[c];for(let h=0;h<a;h++){let p=t[h],g=$e.shallowClone(p);g.count=d,g.offset=u,n.push(g)}}return n}function FJ(e,t){let n=$e.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ge.TERRAIN_CLASSIFICATION?Bn.ALWAYS:Bn.EQUAL,o=n4e(i);return n.renderState=Ue.fromCache(o),n}function que(e,t){let n=$e.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ue.fromCache(i4e),n}var s4e=[];function $ue(e,t,n){let i=Ue.fromCache(o4e),o=t[0],r=t[1],s=$e.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=$e.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=s4e;return c.length=0,c.push(s,a),I2(e,c,n)}Object.defineProperties(AJ.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=de.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});AJ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Ge.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=FJ(this._command,o),s=eme;s.length=0,s.push(r),this._commandListIgnoreShow=I2(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var X2=AJ;var tKn=_(T(),1);function eU(e){e=e??Y.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===Ge.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,d=!r&&!c,u=n.hasSkipLevelOfDetail&&!r,h=c;this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=de.clone(t.boundingVolume),this._modelMatrix2D=new F,this._boundingVolume2D=new de,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=d,this._needsSkipLevelOfDetailCommands=u,this._needsSilhouetteCommands=h,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,a4e(this)}function vb(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}vb.clone=function(e){return new vb({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function a4e(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new vb({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new vb({command:f4e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new vb({command:_4e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new vb({command:T4e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new vb({command:p4e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new vb({command:b4e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(eU.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=de.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,l4e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,d4e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,u4e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,m4e(this))}}});function c4e(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=X.sign(n[13])*2*X.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=de.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function l4e(e){let t=e.shadows,n=Cn.castShadows(t),i=Cn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function d4e(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=Be(r.renderState,!0);s.cull.enabled=t,r.renderState=Ue.fromCache(s)}}}function u4e(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=Be(r.renderState,!0);s.cull.face=t,r.renderState=Ue.fromCache(s)}}}function m4e(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}}}eU.prototype.pushCommands=function(e,t){let n=tme(this,e);n&&!this._has2DCommands&&(h4e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(c4e(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==dh.ALL_OPAQUE&&D1(t,this._translucentCommand,n),i===dh.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||D1(o._backfaceCommands,this._skipLodBackfaceCommand,n),g4e(this,r,n),D1(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){D1(t,this._silhouetteModelCommand,n);return}return D1(t,this._originalCommand,n),t}};eU.prototype.pushSilhouetteCommands=function(e,t){let n=tme(this,e);return D1(t,this._silhouetteColorCommand,n),t};function D1(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function tme(e,t){if(t.mode!==oe.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*X.PI;return o<s&&r>s||o<-s&&r>-s}function U1(e,t){if(!l(t))return;let n=vb.clone(t),i=$e.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 h4e(e){U1(e,e._originalCommand),U1(e,e._translucentCommand),U1(e,e._skipLodBackfaceCommand),U1(e,e._skipLodStencilCommand),U1(e,e._silhouetteModelCommand),U1(e,e._silhouetteColorCommand)}function f4e(e){let t=$e.shallowClone(e);t.pass=Ge.TRANSLUCENT;let n=Be(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=fn.ALPHA_BLEND,t.renderState=Ue.fromCache(n),t}function p4e(e,t){let n=t._silhouetteId%255,i=$e.shallowClone(e),o=Be(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ie.ALWAYS,backFunction:ie.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ue.fromCache(o),i}function b4e(e,t){let n=t._silhouetteId%255,i=$e.shallowClone(e),o=Be(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ge.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ge.TRANSLUCENT,o.depthMask=!1,o.blending=fn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ie.NOTEQUAL,backFunction:ie.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP}};let s=Be(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ue.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function g4e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=y4e(o);if(r!==s){let a=x4e(r),c=Be(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ue.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function y4e(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function x4e(e){return Yt.CESIUM_3D_TILE_MASK|e<<Yt.SKIP_LOD_BIT_SHIFT}function _4e(e){let t=$e.shallowClone(e),n=Be(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Ti.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Be(t.uniformMap),o=new U(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ue.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function T4e(e){let t=$e.shallowClone(e),n=Be(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=Bn.GREATER_OR_EQUAL,i.frontOperation.zPass=pt.REPLACE,i.backFunction=Bn.GREATER_OR_EQUAL,i.backOperation.zPass=pt.REPLACE,n.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,t.renderState=Ue.fromCache(n),t}var W2=eU;var iKn=_(T(),1),P2=`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);
|
|
|
|
|
|
// Dequantize the quantized ones and add them to the
|
|
|
// attributes struct.
|
|
|
#ifdef USE_DEQUANTIZATION
|
|
|
dequantizationStage(attributes);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_MORPH_TARGETS
|
|
|
morphTargetsStage(attributes);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_SKINNING
|
|
|
skinningStage(attributes);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_PRIMITIVE_OUTLINE
|
|
|
primitiveOutlineStage();
|
|
|
#endif
|
|
|
|
|
|
// Compute the bitangent according to the formula in the glTF spec.
|
|
|
// Normal and tangents can be affected by morphing and skinning, so
|
|
|
// the bitangent should not be computed until their values are finalized.
|
|
|
#ifdef HAS_BITANGENTS
|
|
|
attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
|
|
|
#endif
|
|
|
|
|
|
FeatureIds featureIds;
|
|
|
featureIdStage(featureIds, attributes);
|
|
|
|
|
|
#ifdef HAS_SELECTED_FEATURE_ID
|
|
|
SelectedFeature feature;
|
|
|
selectedFeatureIdStage(feature, featureIds);
|
|
|
// Handle any show properties that come from the style.
|
|
|
cpuStylingStage(attributes.positionMC, feature);
|
|
|
#endif
|
|
|
|
|
|
#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
|
|
|
// The scene mode 2D pipeline stage and instancing stage add a different
|
|
|
// model view matrix to accurately project the model to 2D. However, the
|
|
|
// output positions and normals should be transformed by the 3D matrices
|
|
|
// to keep the data the same for the fragment shader.
|
|
|
mat4 modelView = czm_modelView3D;
|
|
|
mat3 normal = czm_normal3D;
|
|
|
#else
|
|
|
// These are used for individual model projection because they will
|
|
|
// automatically change based on the scene mode.
|
|
|
mat4 modelView = czm_modelView;
|
|
|
mat3 normal = czm_normal;
|
|
|
#endif
|
|
|
|
|
|
// Update the position for this instance in place
|
|
|
#ifdef HAS_INSTANCING
|
|
|
|
|
|
// The legacy instance stage is used when rendering i3dm models that
|
|
|
// encode instances transforms in world space, as opposed to glTF models
|
|
|
// that use EXT_mesh_gpu_instancing, where instance transforms are encoded
|
|
|
// in object space.
|
|
|
#ifdef USE_LEGACY_INSTANCING
|
|
|
mat4 instanceModelView;
|
|
|
mat3 instanceModelViewInverseTranspose;
|
|
|
|
|
|
legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);
|
|
|
|
|
|
modelView = instanceModelView;
|
|
|
normal = instanceModelViewInverseTranspose;
|
|
|
#else
|
|
|
instancingStage(attributes);
|
|
|
#endif
|
|
|
|
|
|
#ifdef USE_PICKING
|
|
|
v_pickColor = a_pickColor;
|
|
|
#endif
|
|
|
|
|
|
#endif
|
|
|
|
|
|
Metadata metadata;
|
|
|
MetadataClass metadataClass;
|
|
|
MetadataStatistics metadataStatistics;
|
|
|
metadataStage(metadata, metadataClass, metadataStatistics, attributes);
|
|
|
|
|
|
#ifdef HAS_VERTICAL_EXAGGERATION
|
|
|
verticalExaggerationStage(attributes);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_CUSTOM_VERTEX_SHADER
|
|
|
czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
|
|
|
customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);
|
|
|
#endif
|
|
|
|
|
|
// Compute the final position in each coordinate system needed.
|
|
|
// This returns the value that will be assigned to gl_Position.
|
|
|
vec4 positionClip = geometryStage(attributes, modelView, normal);
|
|
|
|
|
|
// This must go after the geometry stage as it needs v_positionWC
|
|
|
#ifdef HAS_ATMOSPHERE
|
|
|
atmosphereStage(attributes);
|
|
|
#endif
|
|
|
|
|
|
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
|
modelClippingPolygonsStage(attributes);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_SILHOUETTE
|
|
|
silhouetteStage(attributes, positionClip);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
|
float show = pointCloudShowStylingStage(attributes, metadata);
|
|
|
#else
|
|
|
float show = 1.0;
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
|
|
|
show *= pointCloudBackFaceCullingStage();
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
|
|
|
v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
|
|
|
#endif
|
|
|
|
|
|
#ifdef PRIMITIVE_TYPE_POINTS
|
|
|
#ifdef HAS_CUSTOM_VERTEX_SHADER
|
|
|
gl_PointSize = vsOutput.pointSize;
|
|
|
#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
|
|
|
gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
|
|
|
#else
|
|
|
gl_PointSize = 1.0;
|
|
|
#endif
|
|
|
|
|
|
gl_PointSize *= show;
|
|
|
#endif
|
|
|
|
|
|
// Important NOT to compute gl_Position = show * positionClip or we hit:
|
|
|
// https://github.com/CesiumGS/cesium/issues/11270
|
|
|
//
|
|
|
// We will discard points with v_pointCloudShow == 0 in the fragment shader.
|
|
|
gl_Position = positionClip;
|
|
|
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
|
v_pointCloudShow = show;
|
|
|
#endif
|
|
|
}
|
|
|
`;var rKn=_(T(),1),v2=`
|
|
|
precision highp float;
|
|
|
czm_modelMaterial defaultModelMaterial()
|
|
|
{
|
|
|
czm_modelMaterial material;
|
|
|
material.diffuse = vec3(0.0);
|
|
|
material.specular = vec3(1.0);
|
|
|
material.roughness = 1.0;
|
|
|
material.occlusion = 1.0;
|
|
|
material.normalEC = vec3(0.0, 0.0, 1.0);
|
|
|
material.emissive = vec3(0.0);
|
|
|
material.alpha = 1.0;
|
|
|
return material;
|
|
|
}
|
|
|
|
|
|
vec4 handleAlpha(vec3 color, float alpha)
|
|
|
{
|
|
|
#ifdef ALPHA_MODE_MASK
|
|
|
if (alpha < u_alphaCutoff) {
|
|
|
discard;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
return vec4(color, alpha);
|
|
|
}
|
|
|
|
|
|
SelectedFeature selectedFeature;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
|
if (v_pointCloudShow == 0.0)
|
|
|
{
|
|
|
discard;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_MODEL_SPLITTER
|
|
|
modelSplitterStage();
|
|
|
#endif
|
|
|
|
|
|
czm_modelMaterial material = defaultModelMaterial();
|
|
|
|
|
|
ProcessedAttributes attributes;
|
|
|
geometryStage(attributes);
|
|
|
|
|
|
FeatureIds featureIds;
|
|
|
featureIdStage(featureIds, attributes);
|
|
|
|
|
|
Metadata metadata;
|
|
|
MetadataClass metadataClass;
|
|
|
MetadataStatistics metadataStatistics;
|
|
|
metadataStage(metadata, metadataClass, metadataStatistics, attributes);
|
|
|
|
|
|
//========================================================================
|
|
|
// When not picking metadata START
|
|
|
#ifndef METADATA_PICKING_ENABLED
|
|
|
|
|
|
#ifdef HAS_SELECTED_FEATURE_ID
|
|
|
selectedFeatureIdStage(selectedFeature, featureIds);
|
|
|
#endif
|
|
|
|
|
|
#ifndef CUSTOM_SHADER_REPLACE_MATERIAL
|
|
|
materialStage(material, attributes, selectedFeature);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_CUSTOM_FRAGMENT_SHADER
|
|
|
customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);
|
|
|
#endif
|
|
|
|
|
|
lightingStage(material, attributes);
|
|
|
|
|
|
#ifdef HAS_SELECTED_FEATURE_ID
|
|
|
cpuStylingStage(material, selectedFeature);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_MODEL_COLOR
|
|
|
modelColorStage(material);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_PRIMITIVE_OUTLINE
|
|
|
primitiveOutlineStage(material);
|
|
|
#endif
|
|
|
|
|
|
vec4 color = handleAlpha(material.diffuse, material.alpha);
|
|
|
|
|
|
// When not picking metadata END
|
|
|
//========================================================================
|
|
|
#else
|
|
|
//========================================================================
|
|
|
// When picking metadata START
|
|
|
|
|
|
vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0);
|
|
|
metadataPickingStage(metadata, metadataClass, metadataValues);
|
|
|
vec4 color = metadataValues;
|
|
|
|
|
|
#endif
|
|
|
// When picking metadata END
|
|
|
//========================================================================
|
|
|
|
|
|
#ifdef HAS_CLIPPING_PLANES
|
|
|
modelClippingPlanesStage(color);
|
|
|
#endif
|
|
|
|
|
|
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
|
modelClippingPolygonsStage();
|
|
|
#endif
|
|
|
|
|
|
//========================================================================
|
|
|
// When not picking metadata START
|
|
|
#ifndef METADATA_PICKING_ENABLED
|
|
|
|
|
|
#if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
|
|
|
silhouetteStage(color);
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAS_ATMOSPHERE
|
|
|
atmosphereStage(color, attributes);
|
|
|
#endif
|
|
|
|
|
|
#endif
|
|
|
// When not picking metadata END
|
|
|
//========================================================================
|
|
|
|
|
|
out_FragColor = color;
|
|
|
}
|
|
|
`;function nme(){}nme.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=S4e(e,n,t),o=C4e(e,i,t),r=e.model;return l(r.classificationType)?new X2({primitiveRenderResources:e,command:o}):new W2({primitiveRenderResources:e,command:o})};function S4e(e,t,n){t.addVertexLines(P2),t.addFragmentLines(v2);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function C4e(e,t,n){let i=V4e(e),o=new oi({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,c=n.mode===oe.SCENE3D,d,u;if(!c&&!n.scene3DOnly&&r._projectTo2D)d=F.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new F),u=e.runtimePrimitive.boundingSphere2D;else{let S=c?a._computedModelMatrix:a._computedModelMatrix2D;d=F.multiplyTransformation(S,e.runtimeNode.computedTransform,new F),u=de.transform(e.boundingSphere,d)}let h=Be(Ue.fromCache(e.renderStateOptions),!0);h.cull.face=qt.getCullFace(d,e.primitiveType),h=Ue.fromCache(h);let p=l(r.classificationType),g=p?!1:Cn.castShadows(r.shadows),f=p?!1:Cn.receiveShadows(r.shadows),y=p?void 0:e.pickId;return new $e({boundingVolume:u,modelMatrix:d,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:y,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:f})}function V4e(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var w2=nme;function Wd(e){e=e??Y.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=qt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},L4e(this)}Object.defineProperties(Wd.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 L4e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;ime(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let C=0;C<s;C++){let V=r[C],L=new yP({articulation:V,sceneGraph:e}),Z=L.name;a[Z]=L}let c=t.nodes,d=c.length;e._runtimeNodes=new Array(d);let h=n.nodes.length,p=F.IDENTITY;for(let C=0;C<h;C++){let V=n.nodes[C],L=ome(e,V,p);e._rootNodes.push(L)}let g=t.skins,f=e._runtimeSkins,y=g.length;for(let C=0;C<y;C++){let V=g[C];f.push(new x2({skin:V,sceneGraph:e}))}let x=e._skinnedNodes,S=x.length;for(let C=0;C<S;C++){let V=x[C],L=e._runtimeNodes[V],E=c[V].skin.index;L._runtimeSkin=f[E],L.updateJointMatrices()}e.applyArticulations()}function ime(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var R4e=new m;function Z4e(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,R4e);if(!m.equals(i,m.ZERO))e._computedModelMatrix2D=Ft.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Ft.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=de.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function ome(e,t,n){let i=[],o=qt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let h=t.children[u],p=F.multiplyTransformation(n,o,new F),g=ome(e,h,p);i.push(g)}let s=new PP({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let u=0;u<a;u++)s.runtimePrimitives.push(new y2({primitive:t.primitives[u],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let d=t.name;if(l(d)){let u=e._model,h=new LP(u,s);u._nodesByName[d]=h}return c}var G4e=new m,E4e=new m,I4e=new m,X4e=new m;Wd.prototype.buildDrawCommands=function(e){let t=this._model,n=new T2(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,G4e),c=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,E4e);for(o=0;o<this._runtimeNodes.length;o++){let d=this._runtimeNodes[o];if(!l(d))continue;d.configurePipeline();let u=d.pipelineStages,h=new Z2(n,d);for(r=0;r<u.length;r++)u[r].process(h,d.node,e);let p=d.computedTransform;for(r=0;r<d.runtimePrimitives.length;r++){let g=d.runtimePrimitives[r];g.configurePipeline(e);let f=g.pipelineStages,y=new E2(h,g);for(s=0;s<f.length;s++)f[s].process(y,g.primitive,e);g.boundingSphere=de.clone(y.boundingSphere,new de);let x=F.multiplyByPoint(p,y.positionMin,I4e),S=F.multiplyByPoint(p,y.positionMax,X4e);m.minimumByComponent(a,x,a),m.maximumByComponent(c,S,c);let C=w2.buildModelDrawCommand(y,e);g.drawCommand=C}}this._boundingSphere=de.fromCornerPoints(a,c,new de),this._boundingSphere=de.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=de.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=de.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Wd.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(Hg),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(bP),n.isClippingEnabled()&&t.push(TP),n.isClippingPolygonsEnabled()&&t.push(VP),n.hasSilhouette(e)&&t.push(V2),l(n.splitDirection)&&n.splitDirection!==Br.NONE&&t.push(R2),hr.is3DTiles(n.type)&&t.push(uP),i&&t.push(fP))};Wd.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==oe.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};Wd.prototype.updateModelMatrix=function(e,t){ime(this,e),t.mode!==oe.SCENE3D&&Z4e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Wd.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 rme(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let d=t.getChild(c);rme(e,d,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let d=s[c];i(d,o)}}function tU(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];rme(e,c,t,n,i)}}var W4e={backFaceCulling:void 0};Wd.prototype.updateBackFaceCulling=function(e){let t=W4e;t.backFaceCulling=e,tU(this,!1,P4e,t)};function P4e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var v4e={shadowMode:void 0};Wd.prototype.updateShadows=function(e){let t=v4e;t.shadowMode=e,tU(this,!1,w4e,t)};function w4e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var F4e={debugShowBoundingVolume:void 0};Wd.prototype.updateShowBoundingVolume=function(e){let t=F4e;t.debugShowBoundingVolume=e,tU(this,!1,A4e,t)};function A4e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var sme=[],M4e={frameState:void 0,hasSilhouette:void 0};Wd.prototype.pushDrawCommands=function(e){let t=sme;t.length=0;let n=M4e;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,tU(this,!0,N4e,n),e.commandList.push.apply(e.commandList,t)};function N4e(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=sme,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}Wd.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)};Wd.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var F2=Wd;var $Kn=_(T(),1);function jg(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new It}Object.defineProperties(jg.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}}});jg.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()};jg.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};jg.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};jg.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};jg.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};jg.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var A2=jg;var wJn=_(T(),1);var dme=_(tN(),1);var uJn=_(T(),1);var ame={},hT=Uint32Array.BYTES_PER_ELEMENT;ame.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=hT;let o=i.getUint32(t,!0);if(o!==1)throw new ce(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=hT,t+=hT;let r=i.getUint32(t,!0);if(r===0)throw new ce("Feature table must have a byte length greater than zero");t+=hT;let s=i.getUint32(t,!0);t+=hT;let a=i.getUint32(t,!0);t+=hT;let c=i.getUint32(t,!0);t+=hT;let d=Qo(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let h,p;a>0&&(h=Qo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new ch(d,u),f=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=f,!l(f))throw new ce("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(y)&&(y=m.unpack(y));let x=k4e(g,h);if(x.rtcCenter=y,x.pointsLength=f,!x.hasPositions){let S=U4e(g);x.positions=S,x.hasPositions=x.hasPositions||l(S)}if(!x.hasPositions)throw new ce("Either POSITION or POSITION_QUANTIZED must be defined.");if(!x.hasNormals){let S=O4e(g);x.normals=S,x.hasNormals=x.hasNormals||l(S)}if(!x.hasColors){let S=D4e(g);x.colors=S,x.hasColors=x.hasColors||l(S),x.hasConstantColor=l(x.constantColor),x.isTranslucent=l(S)&&S.isTranslucent}if(!x.hasBatchIds){let S=B4e(g);x.batchIds=S,x.hasBatchIds=x.hasBatchIds||l(S)}if(x.hasBatchIds){let S=g.getGlobalProperty("BATCH_LENGTH");if(!l(S))throw new ce("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");x.batchLength=S}return l(p)&&(p=new Uint8Array(p),x.batchTableJson=h,x.batchTableBinary=p),x};function k4e(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,d,u,h,p;if(l(s)){o=s.properties;let f=s.byteOffset,y=s.byteLength;if(!l(o)||!l(f)||!l(y))throw new ce("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+y),c=l(o.POSITION),d=l(o.RGB)||l(o.RGBA),u=l(o.NORMAL),h=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:Rt(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:h}}function U4e(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Q.FLOAT,3),{name:yt.POSITION,semantic:yt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Q.FLOAT,type:an.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(i))throw new ce("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(r))throw new ce("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:yt.POSITION,semantic:yt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Q.FLOAT,type:an.VEC3,quantizedRange:o,quantizedVolumeOffset:m.unpack(r),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:Q.UNSIGNED_SHORT,quantizedType:an.VEC3}}}function D4e(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Q.UNSIGNED_BYTE,4),{name:yt.COLOR,semantic:yt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:an.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:yt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:an.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:yt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.FLOAT,type:an.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Q.UNSIGNED_BYTE,4),o=i[3],r=D.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:yt.COLOR,semantic:yt.COLOR,setIndex:0,constantColor:r,componentDatatype:Q.FLOAT,type:an.VEC4,isQuantized:!1,isTranslucent:s}}}function O4e(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Q.FLOAT,3),{name:yt.NORMAL,semantic:yt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Q.FLOAT,type:an.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Q.UNSIGNED_BYTE,2),{name:yt.NORMAL,semantic:yt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:an.VEC2,quantizedComponentDatatype:Q.UNSIGNED_BYTE,componentDatatype:Q.FLOAT,type:an.VEC3}}function B4e(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Q.UNSIGNED_SHORT,1);return{name:yt.FEATURE_ID,semantic:yt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Q.fromTypedArray(n),type:an.SCALAR}}}var fT=ame;var Y4e=Vn.Components,z4e=Vn.Scene,H4e=Vn.Node,K4e=Vn.Primitive,J4e=Vn.Attribute,cme=Vn.Quantization,Q4e=Vn.FeatureIdAttribute,j4e=Vn.Material,q4e=Vn.MetallicRoughness;function qg(e){e=e??Y.EMPTY_OBJECT;let t=e.arrayBuffer,n=e.byteOffset??0;this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=e.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=_t.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(qg.prototype=Object.create(Qi.prototype),qg.prototype.constructor=qg);Object.defineProperties(qg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});qg.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=fT.parse(this._arrayBuffer,this._byteOffset),this._state=_t.PROCESSING,this._promise=Promise.resolve(this)};qg.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===_t.READY)return!0;if(this._state===_t.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=$4e(this,e.context)}return!1};function $4e(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=xb.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&eje(e,i,r),uje(e,t),e._state=_t.READY,e}).catch(function(r){e.unload(),e._state=_t.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function eje(e,t,n){e._state=_t.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:yt.POSITION,typedArray:n.POSITION.array,componentDatatype:Q.FLOAT,type:an.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,d=m.fromElements(c,c,c),u=m.unpack(a.minValues),h=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=d,o.quantizedComponentDatatype=h<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT,o.quantizedType=an.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:yt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Q.FLOAT,type:an.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=Q.UNSIGNED_BYTE,o.quantizedType=an.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:yt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Q.UNSIGNED_BYTE,type:an.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:yt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Q.UNSIGNED_BYTE,type:an.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:yt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Q.fromTypedArray(a),type:an.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let d=c.data;r[a]={byteOffset:d.byteOffset,type:tje(d.componentsPerAttribute),componentType:nje(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function tje(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function nje(e){switch(e){case ie.BYTE:return"BYTE";case ie.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ie.SHORT:return"SHORT";case ie.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ie.INT:return"INT";case ie.UNSIGNED_INT:return"UNSIGNED_INT";case ie.DOUBLE:return"DOUBLE";case ie.FLOAT:return"FLOAT"}}function M2(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new cme,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new cme;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=m.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=m.divideByScalar(c,a,new m),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new J4e;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Fn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=D.pack(t.constantColor,a)}else{let a=Ct.createVertexBuffer({typedArray:i,context:n,usage:ke.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===yt.POSITION&&s&&(r.typedArray=i),r}var lme,nU;function ije(e){if(!l(nU)){lme=new dme.default(0),nU=new Array(e);for(let t=0;t<e;++t)nU[t]=lme.random()}return nU}var oje=new m,rje=new m,sje=new m;function aje(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=ije(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=m.fromElements(s,s,s,oje),d=m.fromElements(a,a,a,rje),u,h,p;if(e.isQuantized)c=m.ZERO,d=e.quantizedVolumeScale;else for(u=0;u<o;++u)h=Math.floor(r[u]*i),p=m.unpack(t,h*3,sje),m.minimumByComponent(c,p,c),m.maximumByComponent(d,p,d);e.min=m.clone(c),e.max=m.clone(d)}var cje={name:yt.COLOR,semantic:yt.COLOR,setIndex:0,constantColor:D.DARKGRAY,componentDatatype:Q.FLOAT,type:an.VEC4,isQuantized:!1,isTranslucent:!1};function lje(e,t,n){let i=[],o,r=t.positions;return l(r)&&(aje(r),o=M2(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=M2(e,t.normals,n),i.push(o)),l(t.colors)?(o=M2(e,t.colors,n),i.push(o)):(o=M2(e,cje,n),i.push(o)),l(t.batchIds)&&(o=M2(e,t.batchIds,n),i.push(o)),i}function dje(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);return l(o)||e.hasDracoBatchTable?Eb({count:n??i,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t}):new $s({schema:{},propertyTables:[]})}function uje(e,t){let n=e._parsedContent,i=new q4e;i.metallicFactor=0,i.roughnessFactor=.9;let o=new j4e;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=Gf.BLEND);let s=!l(n.normals);o.unlit=s;let a=new K4e;if(a.attributes=lje(e,n,t),a.primitiveType=Ae.POINTS,a.material=o,l(n.batchIds)){let g=new Q4e;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new H4e;c.index=0,c.primitives=[a];let d=new z4e;d.nodes=[c],d.upAxis=vo.Z,d.forwardAxis=vo.X;let u=new Y4e;u.scene=d,u.nodes=[c];let h=[];u.structuralMetadata=dje(n,h),h.length>0&&mje(e,a,h,t),l(n.rtcCenter)&&(u.transform=F.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=F.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function mje(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=Ct.createVertexBuffer({typedArray:a.typedArray,context:i,usage:ke.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}qg.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var N2=qg;var eQn=_(T(),1);var hje=new m,fje=new m,pje=new m,bje=new F,gje=new F,yje=new F,xje=new he,_je=new de;function O1(e,t,n,i,o,r,s){if(!e._ready||n.mode===oe.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,d=c._runtimeNodes;for(let u=0;u<d.length;u++){let h=d[u],p=h.node,g=F.clone(h.computedTransform,bje),f=F.clone(c.computedModelMatrix,gje),y=p.instances;l(y)&&y.transformInWorldSpace&&(f=F.multiplyTransformation(e.modelMatrix,c.components.transform,f),g=F.multiplyTransformation(c.axisCorrectionMatrix,h.computedTransform,g));let x=F.multiplyTransformation(f,g,yje);n.mode!==oe.SCENE3D&&(x=Ft.basisTo2D(n.mapProjection,x,x));let S=[];if(l(y)){let V=y.attributes[0].count,L=y.attributes[0].componentDatatype,Z=12,E=h.transformsTypedArray;if(!l(E)){let P=h.instancingTransformsBuffer;l(P)&&n.context.webgl2&&(E=Q.createTypedArray(L,V*Z),P.getBufferData(E))}if(l(E))for(let P=0;P<V;P++){let W=P*Z,v=new F(E[W],E[W+1],E[W+2],E[W+3],E[W+4],E[W+5],E[W+6],E[W+7],E[W+8],E[W+9],E[W+10],E[W+11],0,0,0,1);y.transformInWorldSpace?(F.multiplyTransformation(v,g,v),F.multiplyTransformation(f,v,v)):F.multiplyTransformation(v,x,v),S.push(v)}}S.length===0&&S.push(x);let C=h.runtimePrimitives.length;for(let V=0;V<C;V++){let L=h.runtimePrimitives[V],Z=L.primitive;if(l(L.boundingSphere)&&!l(y)){let K=de.transform(L.boundingSphere,x,_je),te=ei.raySphere(t,K);if(!l(te))continue}let E=qt.getAttributeBySemantic(Z,yt.POSITION),P=E.byteOffset,W=E.byteStride,v=E.count;if(!l(Z.indices))continue;let A=Z.indices.typedArray;if(!l(A)){let K=Z.indices.buffer,te=Z.indices.count,H=Z.indices.indexDatatype;l(K)&&n.context.webgl2&&(H===Ne.UNSIGNED_BYTE?A=new Uint8Array(te):H===Ne.UNSIGNED_SHORT?A=new Uint16Array(te):H===Ne.UNSIGNED_INT&&(A=new Uint32Array(te)),K.getBufferData(A))}let b=E.typedArray,R=E.componentDatatype,G=E.type,I=E.quantization;l(I)&&(R=E.quantization.componentDatatype,G=E.quantization.type);let w=an.getNumberOfComponents(G),M=Q.getSizeInBytes(R),O=!l(b)&&l(W)&&W!==w*M,k=w,B=0;O&&(k=W/M,B=P/M);let N=v*k;if(!l(b)){let K=E.buffer;l(K)&&n.context.webgl2&&(b=Q.createTypedArray(R,N),K.getBufferData(b,O?0:P,0,N)),I&&E.normalized&&(b=Fn.dequantize(b,R,G,v))}if(!l(A)||!l(b))return;r=r??ne.default,i=i??1,o=o??0;let z=A.length;for(let K=0;K<z;K+=3){let te=A[K],H=A[K+1],j=A[K+2];for(let ee of S){let pe=MJ(b,te,B,k,I,ee,i,o,r,hje),_e=MJ(b,H,B,k,I,ee,i,o,r,fje),ae=MJ(b,j,B,k,I,ee,i,o,r,pje),ye=ei.rayTriangleParametric(t,pe,_e,ae,e.backFaceCulling??!0);l(ye)&&ye<a&&ye>=0&&(a=ye)}}}}if(a!==Number.MAX_VALUE){if(s=yn.getPoint(t,a,s),n.mode!==oe.SCENE3D){m.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,h=u.ellipsoid,p=u.unproject(s,xje);h.cartographicToCartesian(p,s)}return s}}function MJ(e,t,n,i,o,r,s,a,c,d){let u=n+t*i;if(d.x=e[u],d.y=e[u+1],d.z=e[u+2],l(o))if(o.octEncoded){if(d=Fn.octDecodeInRange(d,o.normalizationRange,d),o.octEncodedZXY){let h=d.x;d.x=d.z,d.z=d.y,d.y=h}}else d=m.multiplyComponents(d,o.quantizedVolumeStepSize,d),d=m.add(d,o.quantizedVolumeOffset,d);return d=F.multiplyByPoint(r,d,d),s!==1&&Zr.getPosition(d,c,s,a,d),d}function ho(e){e=e??Y.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??hr.GLTF,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new aP(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=D.clone(e.color),this._colorBlendMode=e.colorBlendMode??Cc.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??D.RED;this._silhouetteColor=D.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Ge.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 de,this._initialRadius=void 0,this._heightReference=e.heightReference??Ke.NONE,this._heightDirty=this._heightReference!==Ke.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 Ef(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?ys.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?oh.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new N_,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Cb(e.environmentMapOptions);Cb.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Cn.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===hr.GLTF&&Vt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let d=e.credit;typeof d=="string"&&(d=new Gt(d)),this._credits=[],this._credit=d,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Br.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??D.BLACK,this._classificationType=e.classificationType,this._statistics=new A2,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new be,this._readyEvent=new be,this._texturesReadyEvent=new be,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject,this._marsOptions=e.marsOptions??{}}function NJ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Tje(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new dP({model:e,propertyTable:s});n.push(a)}return n}function Sje(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=qt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],d=qt.getFeatureIdsByLabel(c.featureIds,n);if(l(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function DJ(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(ho.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=At.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){DJ(e,this._color)&&this.resetDrawCommands(),this._color=D.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!D.equals(e,this._silhouetteColor)){let t=DJ(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=D.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return hme(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===hr.GLTF&&Vt("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&&(ys.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(oh.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(Cb.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}}});ho.prototype.getNode=function(e){return this._nodesByName[e]};ho.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};ho.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};ho.prototype.getExtension=function(e){return this._loader.components.extensions[e]};ho.prototype.makeStyleDirty=function(){this._styleDirty=!0};ho.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var Cje=new F,Vje=new $,Lje=new F;ho.prototype.update=function(e){let t=!1;try{t=Rje(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")NJ(this,n);else{let i=qt.getError("model",this._resource,n);NJ(this,i)}}if(Eje(this,e),Zje(this,e),Gje(this,e),Ije(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=qt.getError("model",this._resource,new ce("Failed to load model."));NJ(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&Tje(this,i);let o=new F2({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(Xje(this),Wje(this),Pje(this,e),vje(this),wje(this,e),Fje(this,e),Aje(this,e),Mje(this,e),Nje(this,e),kje(this,e),Uje(this,e),this._defaultTexture=e.context.defaultTexture,Dje(this,e),Oje(this,e),Bje(this),Yje(this,e),Jje(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)),Hje(this),Qje(this,e),jje(this),qje(this,e)}};function Rje(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function Zje(e,t){l(e._customShader)&&e._customShader.update(t)}function Gje(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 Eje(e,t){if(l(e._marsOptions)&&l(e._marsOptions.customShaders)){let n=Ep.getCache(e._marsOptions.customShaders);for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&n[i].update(t)}}function Ije(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function Xje(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=Sje(t,e),e._styleDirty=!0,e.resetDrawCommands())}function Wje(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function Pje(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&&mme(e)}function mme(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=dh.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function vje(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 wje(e,t){e._silhouetteDirty&&(fme(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function Fje(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function Aje(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 Mje(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 Nje(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function kje(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function Uje(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 Dje(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function Oje(e,t){F.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix))}var $g=new m,kJ=new he;function Bje(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===Ke.NONE){e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??ne.default,i=e.modelMatrix;$g.x=i[12],$g.y=i[13],$g.z=i[14];let o=n.cartesianToCartographic($g);if(!l(o)){e._clampedModelMatrix=void 0;return}l(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(i,new F)),e._removeUpdateHeightCallback=t.updateHeight(o,ume(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=ume(e,n,o);he.clone(o,kJ),kJ.height=r,s(kJ)}e._heightDirty=!1,e._updateModelMatrix=!0}function Yje(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;hme(e,n),zje(e,n,t)}function hme(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=m.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=de.transform(e._boundingSphere,t,e._boundingSphere)}function zje(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);F.getTranslation(t,$g),e._sceneMode!==oe.SCENE3D&&Oi.computeActualEllipsoidPosition(n,$g,$g);let s=e._boundingSphere.radius,a=$je($g,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function Hje(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 Kje=new $(1,0,0,0,0,1,0,-1,0);function Jje(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=Vje,s=Cje;if(s=F.multiply(o.uniformState.view3D,i,s),r=F.getRotation(s,r),r=$.transpose(r,r),e._iblReferenceFrameMatrix=$.multiply(Kje,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=Lje;a=F.multiply(o.uniformState.view3D,i,a),a=F.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=F.inverseTranspose(a,e._clippingPlanesMatrix)}}function Qje(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 jje(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=Gt.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=Gt.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=Gt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function qje(e,t){let n=t8e(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(n8e(e,t),e._sceneGraph.pushDrawCommands(t))}var UJ=new de;function $je(e,t,n){return UJ.center=e,UJ.radius=t,n.camera.getPixelSize(UJ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var iU=new m;function ume(e,t,n){return function(i){o1(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,iU);let o=e._clampedModelMatrix;F.clone(e.modelMatrix,o),o[12]=iU.x,o[13]=iU.y,o[14]=iU.z,e._heightDirty=!0}}var e8e=new m;function t8e(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===oe.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=F.getTranslation(e.modelMatrix,e8e);Oi.computeActualEllipsoidPosition(t,s,s),r=m.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function n8e(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}ho.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};ho.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function fme(e){return e.context.stencilBuffer}ho.prototype.hasSilhouette=function(e){return fme(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};ho.prototype.hasSkipLevelOfDetail=function(e){if(!hr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};ho.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};ho.prototype.pick=function(e,t,n,i,o){return O1(this,e,t,n,i,o)};ho.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};ho.prototype.isDestroyed=function(){return!1};ho.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,me(this)};ho.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};ho.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};ho.fromGltfAsync=async function(e){e=e??Y.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=Re.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=Re.createIfNeeded(t);let r=new ah(n),a=l(e.content)?hr.TILE_GLTF:hr.GLTF,c=n.gltfResource,d=k2(r,a,e);d.resource=c,d.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),qt.getError("model",c,g)}let u=e.gltfCallback;l(u)&&u(r.gltfJson);let h=new ho(d),p=h._resource.credits;if(l(p)){let g=p.length;for(let f=0;f<g;f++)h._resourceCredits.push(Gt.clone(p[f]))}return h};ho.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 tP(t);try{await n.load();let i=k2(n,hr.TILE_B3DM,e);return new ho(i)}catch(i){throw n.destroy(),i}};ho.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new N2(t);try{await n.load();let i=k2(n,hr.TILE_PNTS,e);return new ho(i)}catch(i){throw n.destroy(),i}};ho.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 oP(t);try{await n.load();let i=k2(n,hr.TILE_I3DM,e);return new ho(i)}catch(i){throw n.destroy(),i}};ho.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new nP(t),i=k2(n,hr.TILE_GEOJSON,e);return new ho(i)};var i8e=new D;ho.prototype.applyColorAndShow=function(e){let t=D.clone(this._color,i8e),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):D.clone(D.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,DJ(t,this._color)&&this.resetDrawCommands()};ho.prototype.applyStyle=function(e){let t=this.type===hr.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),mme(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function k2(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,marsOptions:n.marsOptions}}var uh=ho;function Hr(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(Hr.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}}});Hr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Hr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Hr.prototype.getExtension=function(e){return this._model.getExtension(e)};Hr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Hr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Hr.prototype.applyDebugSettings=function(e,t){t=e?t:D.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Hr.prototype.applyStyle=function(e){this._model.style=e};Hr.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;l(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),l(s)&&l(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Dl.REPEAT}),this._ready=!0)};Hr.prototype.isDestroyed=function(){return!1};Hr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),me(this)};Hr.fromGltf=async function(e,t,n,i){let o=new Hr(e,t,n),s=U2(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await uh.fromGltfAsync(s);return o._model=c,o};Hr.fromB3dm=async function(e,t,n,i,o){let r=new Hr(e,t,n),a=U2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let d=await uh.fromB3dm(a);return r._model=d,r};Hr.fromI3dm=async function(e,t,n,i,o){let r=new Hr(e,t,n),a=U2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await uh.fromI3dm(a);return r._model=c,r};Hr.fromPnts=async function(e,t,n,i,o){let r=new Hr(e,t,n),a=U2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await uh.fromPnts(a);return r._model=c,r};Hr.fromGeoJson=async function(e,t,n,i){let o=new Hr(e,t,n),s=U2(e,t,o,{geoJson:i,resource:n}),a=await uh.fromGeoJson(s);return o._model=a,o};Hr.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,ne.WGS84,n)};function U2(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ge.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 Rt(i,o)}var Pd=Hr;var i4n=_(T(),1);function Du(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(Du.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}}});Du.fromJson=function(e,t,n,i){let o=new Du(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Du.prototype.hasProperty=function(e,t){return!1};Du.prototype.getFeature=function(e){};Du.prototype.applyDebugSettings=function(e,t){};Du.prototype.applyStyle=function(e){};Du.prototype.update=function(e,t){};Du.prototype.pick=function(e,t,n){};Du.prototype.isDestroyed=function(){return!1};Du.prototype.destroy=function(){return me(this)};var D2=Du;var Eqn=_(T(),1);var M7n=_(T(),1);var Cjn=_(T(),1);var r4n=_(T(),1),O2=`uniform sampler2D u_atlas;
|
|
|
|
|
|
#ifdef VECTOR_TILE
|
|
|
uniform vec4 u_highlightColor;
|
|
|
#endif
|
|
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
in vec4 v_pickColor;
|
|
|
in vec4 v_color;
|
|
|
in float v_splitDirection;
|
|
|
|
|
|
#ifdef SDF
|
|
|
in vec4 v_outlineColor;
|
|
|
in float v_outlineWidth;
|
|
|
#endif
|
|
|
|
|
|
#ifdef FRAGMENT_DEPTH_CHECK
|
|
|
in vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates
|
|
|
in vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs)
|
|
|
in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
|
|
|
in mat2 v_rotationMatrix;
|
|
|
|
|
|
const float SHIFT_LEFT12 = 4096.0;
|
|
|
const float SHIFT_LEFT1 = 2.0;
|
|
|
|
|
|
const float SHIFT_RIGHT12 = 1.0 / 4096.0;
|
|
|
const float SHIFT_RIGHT1 = 1.0 / 2.0;
|
|
|
|
|
|
float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)
|
|
|
{
|
|
|
vec2 lookupVector = imageSize * (depthLookupST - adjustedST);
|
|
|
lookupVector = v_rotationMatrix * lookupVector;
|
|
|
vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal
|
|
|
|
|
|
vec2 translation = v_originTextureCoordinateAndTranslate.zw;
|
|
|
|
|
|
if (applyTranslate)
|
|
|
{
|
|
|
// this is only needed for labels where the horizontal origin is not LEFT
|
|
|
// it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT
|
|
|
translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));
|
|
|
}
|
|
|
|
|
|
vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;
|
|
|
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;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
|
|
|
#ifdef SDF
|
|
|
|
|
|
// Get the distance from the edge of a glyph at a given position sampling an SDF texture.
|
|
|
float getDistance(vec2 position)
|
|
|
{
|
|
|
return texture(u_atlas, position).r;
|
|
|
}
|
|
|
|
|
|
// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.
|
|
|
vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
|
|
|
{
|
|
|
float distance = getDistance(position);
|
|
|
|
|
|
if (outlineWidth > 0.0)
|
|
|
{
|
|
|
// Don't get the outline edge exceed the SDF_EDGE
|
|
|
float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
|
|
|
float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
|
|
|
vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
|
|
|
float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
|
|
|
return vec4(sdfColor.rgb, sdfColor.a * alpha);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
|
|
|
return vec4(v_color.rgb, v_color.a * alpha);
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
|
|
|
if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
|
|
|
|
|
|
vec4 color = texture(u_atlas, v_textureCoordinates);
|
|
|
|
|
|
#ifdef SDF
|
|
|
float outlineWidth = v_outlineWidth;
|
|
|
vec4 outlineColor = v_outlineColor;
|
|
|
|
|
|
// Get the current distance
|
|
|
float distance = getDistance(v_textureCoordinates);
|
|
|
|
|
|
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
|
float smoothing = fwidth(distance);
|
|
|
// Get an offset that is approximately half the distance to the neighbor pixels
|
|
|
// 0.354 is approximately half of 1/sqrt(2)
|
|
|
vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));
|
|
|
|
|
|
// Sample the center point
|
|
|
vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
|
|
|
|
|
|
// Sample the 4 neighbors
|
|
|
vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
|
|
|
vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
|
|
|
vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
|
|
|
vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
|
|
|
|
|
|
// Equally weight the center sample and the 4 neighboring samples
|
|
|
color = (center + color1 + color2 + color3 + color4)/5.0;
|
|
|
#else
|
|
|
// If no derivatives available (IE 10?), just do a single sample
|
|
|
float smoothing = 1.0/32.0;
|
|
|
color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
|
|
|
#endif
|
|
|
|
|
|
color = czm_gammaCorrect(color);
|
|
|
#else
|
|
|
color = czm_gammaCorrect(color);
|
|
|
color *= czm_gammaCorrect(v_color);
|
|
|
#endif
|
|
|
|
|
|
// Fully transparent parts of the billboard are not pickable.
|
|
|
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
|
|
|
if (color.a < 0.005) // matches 0/255 and 1/255
|
|
|
{
|
|
|
discard;
|
|
|
}
|
|
|
#else
|
|
|
// The billboard is rendered twice. The opaque pass discards translucent fragments
|
|
|
// and the translucent pass discards opaque fragments.
|
|
|
#ifdef OPAQUE
|
|
|
if (color.a < 0.995) // matches < 254/255
|
|
|
{
|
|
|
discard;
|
|
|
}
|
|
|
#else
|
|
|
if (color.a >= 0.995) // matches 254/255 and 255/255
|
|
|
{
|
|
|
discard;
|
|
|
}
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
#ifdef VECTOR_TILE
|
|
|
color *= u_highlightColor;
|
|
|
#endif
|
|
|
out_FragColor = color;
|
|
|
|
|
|
#ifdef LOG_DEPTH
|
|
|
czm_writeLogDepth();
|
|
|
#endif
|
|
|
|
|
|
#ifdef FRAGMENT_DEPTH_CHECK
|
|
|
float temp = v_compressed.y;
|
|
|
|
|
|
temp = temp * SHIFT_RIGHT1;
|
|
|
|
|
|
float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
|
|
|
bool enableDepthTest = temp2 != 0.0;
|
|
|
bool applyTranslate = floor(temp) != 0.0;
|
|
|
|
|
|
if (enableDepthTest) {
|
|
|
temp = v_compressed.z;
|
|
|
temp = temp * SHIFT_RIGHT12;
|
|
|
|
|
|
vec2 dimensions;
|
|
|
dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
|
|
|
dimensions.x = floor(temp);
|
|
|
|
|
|
temp = v_compressed.w;
|
|
|
temp = temp * SHIFT_RIGHT12;
|
|
|
|
|
|
vec2 imageSize;
|
|
|
imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;
|
|
|
imageSize.x = floor(temp);
|
|
|
|
|
|
vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;
|
|
|
adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);
|
|
|
|
|
|
float epsilonEyeDepth = v_compressed.x + czm_epsilon1;
|
|
|
float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);
|
|
|
|
|
|
// negative values go into the screen
|
|
|
if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
|
|
|
{
|
|
|
float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner
|
|
|
if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
|
|
|
{
|
|
|
float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner
|
|
|
if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
|
|
|
{
|
|
|
discard;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
`;var a4n=_(T(),1),B2=`#ifdef INSTANCED
|
|
|
in vec2 direction;
|
|
|
#endif
|
|
|
in vec4 positionHighAndScale;
|
|
|
in vec4 positionLowAndRotation;
|
|
|
in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)
|
|
|
in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width
|
|
|
in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free
|
|
|
in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range)
|
|
|
in vec4 scaleByDistance; // near, nearScale, far, farScale
|
|
|
in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale
|
|
|
in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions
|
|
|
in vec2 sdf; // sdf outline color (rgb) and width (w)
|
|
|
in float splitDirection; // splitDirection
|
|
|
#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
|
|
|
in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates
|
|
|
#endif
|
|
|
#ifdef VECTOR_TILE
|
|
|
in float a_batchId;
|
|
|
#endif
|
|
|
|
|
|
out vec2 v_textureCoordinates;
|
|
|
#ifdef FRAGMENT_DEPTH_CHECK
|
|
|
out vec4 v_textureCoordinateBounds;
|
|
|
out vec4 v_originTextureCoordinateAndTranslate;
|
|
|
out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
|
|
|
out mat2 v_rotationMatrix;
|
|
|
#endif
|
|
|
|
|
|
out vec4 v_pickColor;
|
|
|
out vec4 v_color;
|
|
|
out float v_splitDirection;
|
|
|
#ifdef SDF
|
|
|
out vec4 v_outlineColor;
|
|
|
out float v_outlineWidth;
|
|
|
#endif
|
|
|
|
|
|
const float UPPER_BOUND = 32768.0;
|
|
|
|
|
|
const float SHIFT_LEFT16 = 65536.0;
|
|
|
const float SHIFT_LEFT12 = 4096.0;
|
|
|
const float SHIFT_LEFT8 = 256.0;
|
|
|
const float SHIFT_LEFT7 = 128.0;
|
|
|
const float SHIFT_LEFT5 = 32.0;
|
|
|
const float SHIFT_LEFT3 = 8.0;
|
|
|
const float SHIFT_LEFT2 = 4.0;
|
|
|
const float SHIFT_LEFT1 = 2.0;
|
|
|
|
|
|
const float SHIFT_RIGHT12 = 1.0 / 4096.0;
|
|
|
const float SHIFT_RIGHT8 = 1.0 / 256.0;
|
|
|
const float SHIFT_RIGHT7 = 1.0 / 128.0;
|
|
|
const float SHIFT_RIGHT5 = 1.0 / 32.0;
|
|
|
const float SHIFT_RIGHT3 = 1.0 / 8.0;
|
|
|
const float SHIFT_RIGHT2 = 1.0 / 4.0;
|
|
|
const float SHIFT_RIGHT1 = 1.0 / 2.0;
|
|
|
|
|
|
vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)
|
|
|
{
|
|
|
// 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 VERTEX_DEPTH_CHECK
|
|
|
float getGlobeDepth(vec4 positionEC)
|
|
|
{
|
|
|
vec4 posWC = czm_eyeToWindowCoordinates(positionEC);
|
|
|
|
|
|
float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));
|
|
|
|
|
|
if (globeDepth == 0.0)
|
|
|
{
|
|
|
return 0.0; // not on the globe
|
|
|
}
|
|
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
|
|
|
return eyeCoordinate.z / eyeCoordinate.w;
|
|
|
}
|
|
|
#endif
|
|
|
void main()
|
|
|
{
|
|
|
// Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition
|
|
|
|
|
|
// unpack attributes
|
|
|
vec3 positionHigh = positionHighAndScale.xyz;
|
|
|
vec3 positionLow = positionLowAndRotation.xyz;
|
|
|
float scale = positionHighAndScale.w;
|
|
|
|
|
|
#if defined(ROTATION) || defined(ALIGNED_AXIS)
|
|
|
float rotation = positionLowAndRotation.w;
|
|
|
#else
|
|
|
float rotation = 0.0;
|
|
|
#endif
|
|
|
|
|
|
float compressed = compressedAttribute0.x;
|
|
|
|
|
|
vec2 pixelOffset;
|
|
|
pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
|
|
|
compressed -= pixelOffset.x * SHIFT_LEFT7;
|
|
|
pixelOffset.x -= UPPER_BOUND;
|
|
|
|
|
|
vec2 origin;
|
|
|
origin.x = floor(compressed * SHIFT_RIGHT5);
|
|
|
compressed -= origin.x * SHIFT_LEFT5;
|
|
|
|
|
|
origin.y = floor(compressed * SHIFT_RIGHT3);
|
|
|
compressed -= origin.y * SHIFT_LEFT3;
|
|
|
|
|
|
#ifdef FRAGMENT_DEPTH_CHECK
|
|
|
vec2 depthOrigin = origin.xy;
|
|
|
#endif
|
|
|
origin -= vec2(1.0);
|
|
|
|
|
|
float show = floor(compressed * SHIFT_RIGHT2);
|
|
|
compressed -= show * SHIFT_LEFT2;
|
|
|
|
|
|
#ifdef INSTANCED
|
|
|
vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
|
|
|
vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
|
|
|
vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
|
|
|
#else
|
|
|
vec2 direction;
|
|
|
direction.x = floor(compressed * SHIFT_RIGHT1);
|
|
|
direction.y = compressed - direction.x * SHIFT_LEFT1;
|
|
|
|
|
|
vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);
|
|
|
#endif
|
|
|
|
|
|
float temp = compressedAttribute0.y * SHIFT_RIGHT8;
|
|
|
pixelOffset.y = -(floor(temp) - UPPER_BOUND);
|
|
|
|
|
|
vec2 translate;
|
|
|
translate.y = (temp - floor(temp)) * SHIFT_LEFT16;
|
|
|
|
|
|
temp = compressedAttribute0.z * SHIFT_RIGHT8;
|
|
|
translate.x = floor(temp) - UPPER_BOUND;
|
|
|
|
|
|
translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
translate.y -= UPPER_BOUND;
|
|
|
|
|
|
temp = compressedAttribute1.x * SHIFT_RIGHT8;
|
|
|
float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
|
|
|
|
|
|
vec2 imageSize = vec2(floor(temp), temp2);
|
|
|
|
|
|
#ifdef FRAGMENT_DEPTH_CHECK
|
|
|
float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
|
|
|
float applyTranslate = 0.0;
|
|
|
if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false
|
|
|
{
|
|
|
applyTranslate = 1.0;
|
|
|
labelHorizontalOrigin -= 2.0;
|
|
|
depthOrigin.x = labelHorizontalOrigin + 1.0;
|
|
|
}
|
|
|
|
|
|
depthOrigin = vec2(1.0) - (depthOrigin * 0.5);
|
|
|
#endif
|
|
|
|
|
|
#ifdef EYE_DISTANCE_TRANSLUCENCY
|
|
|
vec4 translucencyByDistance;
|
|
|
translucencyByDistance.x = compressedAttribute1.z;
|
|
|
translucencyByDistance.z = compressedAttribute1.w;
|
|
|
|
|
|
translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
|
|
|
|
|
|
temp = compressedAttribute1.y * SHIFT_RIGHT8;
|
|
|
translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
|
|
|
#endif
|
|
|
|
|
|
#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
|
|
|
temp = compressedAttribute3.w;
|
|
|
temp = temp * SHIFT_RIGHT12;
|
|
|
|
|
|
vec2 dimensions;
|
|
|
dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
|
|
|
dimensions.x = floor(temp);
|
|
|
#endif
|
|
|
|
|
|
#ifdef ALIGNED_AXIS
|
|
|
vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
|
|
|
temp = compressedAttribute2.z * SHIFT_RIGHT5;
|
|
|
bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
|
|
|
#else
|
|
|
vec3 alignedAxis = vec3(0.0);
|
|
|
bool validAlignedAxis = false;
|
|
|
#endif
|
|
|
|
|
|
vec4 pickColor;
|
|
|
vec4 color;
|
|
|
|
|
|
temp = compressedAttribute2.y;
|
|
|
temp = temp * SHIFT_RIGHT8;
|
|
|
pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
temp = floor(temp) * SHIFT_RIGHT8;
|
|
|
pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
pickColor.r = floor(temp);
|
|
|
|
|
|
temp = compressedAttribute2.x;
|
|
|
temp = temp * SHIFT_RIGHT8;
|
|
|
color.b = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
temp = floor(temp) * SHIFT_RIGHT8;
|
|
|
color.g = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
color.r = floor(temp);
|
|
|
|
|
|
temp = compressedAttribute2.z * SHIFT_RIGHT8;
|
|
|
bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;
|
|
|
temp = floor(temp) * SHIFT_RIGHT8;
|
|
|
|
|
|
pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
pickColor /= 255.0;
|
|
|
|
|
|
color.a = floor(temp);
|
|
|
color /= 255.0;
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
|
vec4 positionEC = czm_modelViewRelativeToEye * p;
|
|
|
|
|
|
#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)
|
|
|
float eyeDepth = positionEC.z;
|
|
|
#endif
|
|
|
|
|
|
positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
|
|
|
positionEC.xyz *= show;
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
|
|
|
float lengthSq;
|
|
|
if (czm_sceneMode == czm_sceneMode2D)
|
|
|
{
|
|
|
// 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;
|
|
|
|
|
|
#ifdef DISABLE_DEPTH_DISTANCE
|
|
|
float disableDepthTestDistance = compressedAttribute3.z;
|
|
|
#endif
|
|
|
|
|
|
#ifdef VERTEX_DEPTH_CHECK
|
|
|
if (lengthSq < disableDepthTestDistance) {
|
|
|
float depthsilon = 10.0;
|
|
|
|
|
|
vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;
|
|
|
vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
|
|
|
float globeDepth1 = getGlobeDepth(pEC1);
|
|
|
|
|
|
if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
|
|
|
{
|
|
|
vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
|
|
|
float globeDepth2 = getGlobeDepth(pEC2);
|
|
|
|
|
|
if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
|
|
|
{
|
|
|
vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
|
|
|
float globeDepth3 = getGlobeDepth(pEC3);
|
|
|
if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
|
|
|
{
|
|
|
positionEC.xyz = vec3(0.0);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
|
|
|
gl_Position = czm_projection * positionEC;
|
|
|
v_textureCoordinates = textureCoordinates;
|
|
|
|
|
|
#ifdef LOG_DEPTH
|
|
|
czm_vertexLogDepth();
|
|
|
#endif
|
|
|
|
|
|
#ifdef DISABLE_DEPTH_DISTANCE
|
|
|
if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
|
|
|
{
|
|
|
disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
|
|
|
}
|
|
|
|
|
|
if (disableDepthTestDistance != 0.0)
|
|
|
{
|
|
|
// 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
|
|
|
v_depthFromNearPlusOne = 1.0;
|
|
|
#endif
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#ifdef FRAGMENT_DEPTH_CHECK
|
|
|
if (sizeInMeters) {
|
|
|
translate /= mpp;
|
|
|
dimensions /= mpp;
|
|
|
imageSize /= mpp;
|
|
|
}
|
|
|
|
|
|
#if defined(ROTATION) || defined(ALIGNED_AXIS)
|
|
|
v_rotationMatrix = rotationMatrix;
|
|
|
#else
|
|
|
v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
|
|
|
#endif
|
|
|
|
|
|
float enableDepthCheck = 0.0;
|
|
|
if (lengthSq < disableDepthTestDistance)
|
|
|
{
|
|
|
enableDepthCheck = 1.0;
|
|
|
}
|
|
|
|
|
|
float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));
|
|
|
float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));
|
|
|
|
|
|
float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));
|
|
|
float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));
|
|
|
|
|
|
v_compressed.x = eyeDepth;
|
|
|
v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;
|
|
|
v_compressed.z = dw * SHIFT_LEFT12 + dh;
|
|
|
v_compressed.w = iw * SHIFT_LEFT12 + ih;
|
|
|
v_originTextureCoordinateAndTranslate.xy = depthOrigin;
|
|
|
v_originTextureCoordinateAndTranslate.zw = translate;
|
|
|
v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SDF
|
|
|
vec4 outlineColor;
|
|
|
float outlineWidth;
|
|
|
|
|
|
temp = sdf.x;
|
|
|
temp = temp * SHIFT_RIGHT8;
|
|
|
outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
temp = floor(temp) * SHIFT_RIGHT8;
|
|
|
outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
outlineColor.r = floor(temp);
|
|
|
|
|
|
temp = sdf.y;
|
|
|
temp = temp * SHIFT_RIGHT8;
|
|
|
float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
temp = floor(temp) * SHIFT_RIGHT8;
|
|
|
outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
outlineColor.a = floor(temp);
|
|
|
outlineColor /= 255.0;
|
|
|
|
|
|
v_outlineWidth = outlineWidth / 255.0;
|
|
|
v_outlineColor = outlineColor;
|
|
|
v_outlineColor.a *= translucency;
|
|
|
#endif
|
|
|
|
|
|
v_pickColor = pickColor;
|
|
|
|
|
|
v_color = color;
|
|
|
v_color.a *= translucency;
|
|
|
v_splitDirection = splitDirection;
|
|
|
}
|
|
|
`;var F4n=_(T(),1);var h4n=_(T(),1);var l4n=_(T(),1),o8e=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),as=o8e;function wb(e){this._billboardCollection=e,this._id=void 0,this._loadState=as.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(wb.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===as.LOADED}},hasImage:{get:function(){return this._loadState!==as.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});wb.prototype.unload=async function(){this._loadState!==as.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=as.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};wb.prototype.loadImage=async function(e,t){if(this._id===e)return;let n=this._billboardCollection,i=n.billboardTextureCache,o=i.get(e);if(l(o)&&t.loadState===as.LOADING||t.loadState===as.LOADED){wb.clone(o,this);return}l(o)||(o=new wb(n),i.set(e,o)),o._id=this._id=e,o._loadState=this._loadState=as.LOADING,o._loadError=this._loadError=void 0;let r,s=this._billboardCollection.textureAtlas;try{r=await s.addImage(e,t)}catch(c){if(o._loadState=as.ERROR,o._loadError=c,this._id!==e)return;this._loadState=as.ERROR,this._loadError=c;return}if(!l(r)||r===-1){if(o._loadState=as.FAILED,o._index=-1,this._id!==e)return;this._loadState=as.FAILED,this._index=-1;return}o._index=r,o._loadState=as.LOADED;let a=s.rectangles[r];o._width=a.width,o._height=a.height,this._id===e&&(this._index=r,this._loadState=as.LOADED,this._width=a.width,this._height=a.height,this.dirty=!0)};wb.prototype.addImageSubRegion=async function(e,t){this._id=e,this._loadState=as.LOADING,this._loadError=void 0,this._hasSubregion=!0;let n,i=this._billboardCollection.textureAtlas;try{n=await i.addImageSubRegion(e,t)}catch(o){this._loadState=as.ERROR,this._loadError=o;return}if(!l(n)||n===-1){this._loadState=as.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=n,this._loadState=as.LOADED,this.dirty=!0};wb.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};wb.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 Fb=wb;function bi(e,t){e=e??Y.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ot.clone(n)),l(i)&&(i=Ot.clone(i)),l(o)&&(o=Ot.clone(o)),l(r)&&(r=At.clone(r)),this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),this._actualPosition=m.clone(this._position),this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._translate=new U(0,0),this._eyeOffset=m.clone(e.eyeOffset??m.ZERO),this._heightReference=e.heightReference??Ke.NONE,this._verticalOrigin=e.verticalOrigin??Mn.CENTER,this._horizontalOrigin=e.horizontalOrigin??_i.CENTER,this._scale=e.scale??1,this._color=D.clone(e.color??D.WHITE),this._rotation=e.rotation??0,this._alignedAxis=m.clone(e.alignedAxis??m.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new Fb(t),this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=Hn()),this._imageTexture.loadImage(a,s)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(a,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=D.clone(e.outlineColor??D.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Br.NONE}var pme=bi.SHOW_INDEX=0,rU=bi.POSITION_INDEX=1,_me=bi.PIXEL_OFFSET_INDEX=2,r8e=bi.EYE_OFFSET_INDEX=3,s8e=bi.HORIZONTAL_ORIGIN_INDEX=4,a8e=bi.VERTICAL_ORIGIN_INDEX=5,c8e=bi.SCALE_INDEX=6,bme=bi.IMAGE_INDEX_INDEX=7,gme=bi.COLOR_INDEX=8,l8e=bi.ROTATION_INDEX=9,d8e=bi.ALIGNED_AXIS_INDEX=10,u8e=bi.SCALE_BY_DISTANCE_INDEX=11,m8e=bi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,h8e=bi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,f8e=bi.DISTANCE_DISPLAY_CONDITION=14,p8e=bi.DISABLE_DEPTH_DISTANCE=15;bi.TEXTURE_COORDINATE_BOUNDS=16;var yme=bi.SDF_INDEX=17,b8e=bi.SPLIT_DIRECTION_INDEX=18;bi.NUMBER_OF_PROPERTIES=19;function tr(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,tr(this,pme))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),tr(this,rU))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),tr(this,rU))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),tr(this,_me))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ot.equals(t,e)||(this._scaleByDistance=Ot.clone(e,t),tr(this,u8e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ot.equals(t,e)||(this._translucencyByDistance=Ot.clone(e,t),tr(this,m8e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Ot.equals(t,e)||(this._pixelOffsetScaleByDistance=Ot.clone(e,t),tr(this,h8e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),tr(this,r8e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,tr(this,s8e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,tr(this,a8e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,tr(this,c8e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;D.equals(t,e)||(D.clone(e,t),tr(this,gme))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,tr(this,l8e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),tr(this,d8e))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,tr(this,bme))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,tr(this,bme))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,tr(this,gme))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){At.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=At.clone(e,this._distanceDisplayCondition),tr(this,f8e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,tr(this,p8e))}},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}let t;typeof e=="string"?t=e:e instanceof Re?t=e._url:l(e.src)?t=e.src:t=Hn(),this._imageTexture.loadImage(t,e)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),tr(this,rU)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,tr(this,pme))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;D.equals(t,e)||(D.clone(e,t),tr(this,yme))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,tr(this,yme))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,tr(this,b8e))}}});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 sU=new he;bi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ne.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===Ke.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Ke.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(d){let u=i.cartographicToCartesian(d,t._clampedPosition);o1(t._heightReference)&&(t._mode===oe.SCENE3D?(d.height+=s.height,i.cartographicToCartesian(d,u)):u.x+=s.height),t._clampedPosition=u}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,sU);let c=n.getHeight(s,t._heightReference);l(c)&&(sU.height=c),a(sU)};bi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};bi.prototype.setImage=function(e,t){this._imageTexture.loadImage(e,t)};bi.prototype.setImageTexture=function(e){Fb.clone(e,this._imageTexture)};bi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};bi.prototype._setTranslate=function(e){let t=this._translate;U.equals(t,e)||(U.clone(e,t),tr(this,_me))};bi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};bi.prototype._setActualPosition=function(e){l(this._clampedPosition)||m.clone(e,this._actualPosition),tr(this,rU)};var xme=new re;bi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(F.multiplyByPoint(i,t,xme),Oi.computeActualEllipsoidPosition(n,xme))};var Tme=new m;bi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=F.multiplyByPoint(e,t,Tme),a=Oi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return U.add(a,i,a),a};var oU=new U(0,0);bi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,oU),U.add(oU,this._translate,oU);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,sU);o=a.cartographicToCartesian(c,Tme),i=F.IDENTITY}return bi._computeScreenSpacePosition(i,o,this._eyeOffset,oU,e,t)};bi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===_i.RIGHT?s-=i:e.horizontalOrigin===_i.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?a-=o:e.verticalOrigin===Mn.CENTER&&(a-=o*.5),l(n)||(n=new ze),n.x=s,n.y=a,n.width=i,n.height=o,n};bi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&D.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&Ot.equals(this._scaleByDistance,e._scaleByDistance)&&Ot.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ot.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&At.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 fo=bi;var M4n=_(T(),1),g8e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Go=Object.freeze(g8e);var k4n=_(T(),1),y8e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},ta=Object.freeze(y8e);var x8e=fo.SHOW_INDEX,Y2=fo.POSITION_INDEX,Sme=fo.PIXEL_OFFSET_INDEX,Cme=fo.EYE_OFFSET_INDEX,_8e=fo.HORIZONTAL_ORIGIN_INDEX,T8e=fo.VERTICAL_ORIGIN_INDEX,S8e=fo.SCALE_INDEX,pT=fo.IMAGE_INDEX_INDEX,Vme=fo.COLOR_INDEX,C8e=fo.ROTATION_INDEX,V8e=fo.ALIGNED_AXIS_INDEX,Lme=fo.SCALE_BY_DISTANCE_INDEX,Rme=fo.TRANSLUCENCY_BY_DISTANCE_INDEX,Zme=fo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Gme=fo.DISTANCE_DISPLAY_CONDITION,L8e=fo.DISABLE_DEPTH_DISTANCE,R8e=fo.TEXTURE_COORDINATE_BOUNDS,Eme=fo.SDF_INDEX,Ime=fo.SPLIT_DIRECTION_INDEX,JJ=fo.NUMBER_OF_PROPERTIES,po,Z8e={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},G8e={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 Bu(e){e=e??Y.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new Vx),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(JJ),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new de,this._baseVolumeWC=new de,this._baseVolume2D=new de,this._boundingVolume=new de,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Go.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW],this._highlightColor=D.clone(D.WHITE),this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor};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(Bu.prototype,{length:{get:function(){return QJ(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}}});function Xme(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Bu.prototype.add=function(e){let t=new fo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Bu.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Bu.prototype.removeAll=function(){Xme(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function QJ(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Bu.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Bu.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Bu.prototype.get=function(e){return QJ(this),this._billboards[e]};var OJ;function E8e(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=Ct.createIndexBuffer({context:e,typedArray:o,usage:ke.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function I8e(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=Ct.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:ke.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function X8e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=Ct.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:ke.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Bu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<JJ;++i){let o=n[i]===0?ke.STATIC_DRAW:ke.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function W8e(e,t,n,i,o,r){let s=[{index:po.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Y2]},{index:po.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Y2]},{index:po.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Sme]},{index:po.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Rme]},{index:po.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Vme]},{index:po.eyeOffset,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Cme]},{index:po.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Lme]},{index:po.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Zme]},{index:po.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Gme]},{index:po.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[R8e]},{index:po.splitDirection,componentsPerAttribute:1,componentDatatype:Q.FLOAT,usage:n[Ime]}];i&&s.push({index:po.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:X8e(e)}),l(o)&&s.push({index:po.a_batchId,componentsPerAttribute:1,componentDatatype:Q.FLOAT,bufferUsage:ke.STATIC_DRAW}),r&&s.push({index:po.sdf,componentsPerAttribute:2,componentDatatype:Q.FLOAT,usage:n[Eme]});let a=i?t:4*t;return new Gp(e,s,a,i)}var BJ=new Yn;function Wme(e,t,n,i){let o,r=n[po.positionHighAndScale],s=n[po.positionLowAndRotation],a=i._getActualPosition();e._mode===oe.SCENE3D&&(de.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Yn.fromCartesian(a,BJ);let c=i.scale,d=i.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);let u=BJ.high,h=BJ.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c),s(o,h.x,h.y,h.z,d)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c),r(o+1,u.x,u.y,u.z,c),r(o+2,u.x,u.y,u.z,c),r(o+3,u.x,u.y,u.z,c),s(o+0,h.x,h.y,h.z,d),s(o+1,h.x,h.y,h.z,d),s(o+2,h.x,h.y,h.z,d),s(o+3,h.x,h.y,h.z,d))}var Bl=new U,Ou=32768,B1=65536,YJ=4096,Xf=256,P8e=128,v8e=32,w8e=8,Pme=4,F8e=1/256,vme=0,wme=2,Fme=3,Ame=1,jJ=new ze;function Mme(e,t,n,i){let o,r=n[po.compressedAttribute0],s=i.pixelOffset,a=s.x,c=s.y,d=i._translate,u=d.x,h=d.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+u),Math.abs(-c+h));let p=i.horizontalOrigin,g=i._verticalOrigin,f=i.show&&i.clusterShow;i.color.alpha===0&&(f=!1),g===Mn.BASELINE&&(g=Mn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===_i.CENTER,e._allVerticalCenter=e._allVerticalCenter&&g===Mn.CENTER;let y=0,x=0,S=0,C=0;if(i.ready){let w=i.computeTextureCoordinates(jJ);y=w.x,x=w.y,S=w.width,C=w.height}let V=y+S,L=x+C,Z=Math.floor(X.clamp(a,-Ou,Ou)+Ou)*P8e;Z+=(p+1)*v8e,Z+=(g+1)*w8e,Z+=(f?1:0)*Pme;let E=Math.floor(X.clamp(c,-Ou,Ou)+Ou)*Xf,P=Math.floor(X.clamp(u,-Ou,Ou)+Ou)*Xf,W=(X.clamp(h,-Ou,Ou)+Ou)*F8e,v=Math.floor(W),A=Math.floor((W-v)*Xf);E+=v,P+=A,Bl.x=y,Bl.y=x;let b=Fn.compressTextureCoordinates(Bl);Bl.x=V;let R=Fn.compressTextureCoordinates(Bl);Bl.y=L;let G=Fn.compressTextureCoordinates(Bl);Bl.x=y;let I=Fn.compressTextureCoordinates(Bl);e._instanced?(o=i._index,r(o,Z,E,P,b)):(o=i._index*4,r(o+0,Z+vme,E,P,b),r(o+1,Z+wme,E,P,R),r(o+2,Z+Fme,E,P,G),r(o+3,Z+Ame,E,P,I))}function Nme(e,t,n,i){let o,r=n[po.compressedAttribute1],s=i.alignedAxis;m.equals(s,m.ZERO)||(e._shaderAlignedAxis=!0);let a=0,c=1,d=1,u=1,h=i.translucencyByDistance;l(h)&&(a=h.near,c=h.nearValue,d=h.far,u=h.farValue,(c!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let p=i.width??0;e._maxSize=Math.max(e._maxSize,p);let g=X.clamp(p,0,B1),f=0;Math.abs(m.magnitudeSquared(s)-1)<X.EPSILON6&&(f=Fn.octEncodeFloat(s)),c=X.clamp(c,0,1),c=c===1?255:c*255|0,g=g*Xf+c,u=X.clamp(u,0,1),u=u===1?255:u*255|0,f=f*Xf+u,e._instanced?(o=i._index,r(o,g,f,a,d)):(o=i._index*4,r(o+0,g,f,a,d),r(o+1,g,f,a,d),r(o+2,g,f,a,d),r(o+3,g,f,a,d))}function HJ(e,t,n,i){let o,r=n[po.compressedAttribute2],s=i.color,a=l(e._batchTable)?D.WHITE:i.getPickId(t.context).color,c=i.sizeInMeters?1:0,d=Math.abs(m.magnitudeSquared(i.alignedAxis)-1)<X.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&c===1;let u=i.height??0;e._maxSize=Math.max(e._maxSize,u);let h=i._labelHorizontalOrigin??-2;h+=2;let p=u*Pme+h,g=D.floatToByte(s.red),f=D.floatToByte(s.green),y=D.floatToByte(s.blue),x=g*B1+f*Xf+y;g=D.floatToByte(a.red),f=D.floatToByte(a.green),y=D.floatToByte(a.blue);let S=g*B1+f*Xf+y,C=D.floatToByte(s.alpha)*B1+D.floatToByte(a.alpha)*Xf;C+=c*2+d,e._instanced?(o=i._index,r(o,x,S,C,p)):(o=i._index*4,r(o+0,x,S,C,p),r(o+1,x,S,C,p),r(o+2,x,S,C,p),r(o+3,x,S,C,p))}function KJ(e,t,n,i){let o,r=n[po.eyeOffset],s=i.eyeOffset,a=s.z;if(i._heightReference!==Ke.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(a)),e._instanced){if(Bl.x=0,Bl.y=0,i.ready){let d=i.computeTextureCoordinates(jJ);Bl.x=d.width,Bl.y=d.height}let c=Fn.compressTextureCoordinates(Bl);o=i._index,r(o,s.x,s.y,a,c)}else o=i._index*4,r(o+0,s.x,s.y,a,0),r(o+1,s.x,s.y,a,0),r(o+2,s.x,s.y,a,0),r(o+3,s.x,s.y,a,0)}function kme(e,t,n,i){let o,r=n[po.scaleByDistance],s=0,a=1,c=1,d=1,u=i.scaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,d)):(o=i._index*4,r(o+0,s,a,c,d),r(o+1,s,a,c,d),r(o+2,s,a,c,d),r(o+3,s,a,c,d))}function Ume(e,t,n,i){let o,r=n[po.pixelOffsetScaleByDistance],s=0,a=1,c=1,d=1,u=i.pixelOffsetScaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,d)):(o=i._index*4,r(o+0,s,a,c,d),r(o+1,s,a,c,d),r(o+2,s,a,c,d),r(o+3,s,a,c,d))}function Dme(e,t,n,i){let o,r=n[po.compressedAttribute3],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance,u=Pu(i.heightReference)&&t.context.depthTexture;l(d)||(d=u?5e3:0),d*=d,(u||d>0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let h,p;l(i._labelDimensions)?(p=i._labelDimensions.x,h=i._labelDimensions.y):(p=i.width??0,h=i.height??0);let g=Math.floor(X.clamp(p,0,YJ)),f=Math.floor(X.clamp(h,0,YJ)),y=g*YJ+f;e._instanced?(o=i._index,r(o,s,a,d,y)):(o=i._index*4,r(o+0,s,a,d,y),r(o+1,s,a,d,y),r(o+2,s,a,d,y),r(o+3,s,a,d,y))}function Ome(e,t,n,i){if(Pu(i.heightReference)){let p=e._scene,g=t.context,f=t.globeTranslucencyState.translucent,y=l(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=g.depthTexture&&!f&&y}let o,r=n[po.textureCoordinateBoundsOrLabelTranslate];if(Dt.maximumVertexTextureImageUnits>0){let p=0,g=0;l(i._labelTranslate)&&(p=i._labelTranslate.x,g=i._labelTranslate.y),e._instanced?(o=i._index,r(o,p,g,0,0)):(o=i._index*4,r(o+0,p,g,0,0),r(o+1,p,g,0,0),r(o+2,p,g,0,0),r(o+3,p,g,0,0));return}let s=0,a=0,c=0,d=0;if(i.ready){let p=i.computeTextureCoordinates(jJ);s=p.x,a=p.y,c=p.width,d=p.height}let u=s+c,h=a+d;e._instanced?(o=i._index,r(o,s,a,u,h)):(o=i._index*4,r(o+0,s,a,u,h),r(o+1,s,a,u,h),r(o+2,s,a,u,h),r(o+3,s,a,u,h))}function A8e(e,t,n,i){if(!l(e._batchTable))return;let o=n[po.a_batchId],r=i._batchIndex,s;e._instanced?(s=i._index,o(s,r)):(s=i._index*4,o(s+0,r),o(s+1,r),o(s+2,r),o(s+3,r))}function Bme(e,t,n,i){if(!e._sdf)return;let o,r=n[po.sdf],s=i.outlineColor,a=i.outlineWidth,c=D.floatToByte(s.red),d=D.floatToByte(s.green),u=D.floatToByte(s.blue),h=c*B1+d*Xf+u,p=a/ta.RADIUS,g=D.floatToByte(s.alpha)*B1+D.floatToByte(p)*Xf;e._instanced?(o=i._index,r(o,h,g)):(o=i._index*4,r(o+0,h+vme,g),r(o+1,h+wme,g),r(o+2,h+Fme,g),r(o+3,h+Ame,g))}function Yme(e,t,n,i){let o=n[po.splitDirection],r=0,s=i.splitDirection;l(s)&&(r=s);let a;e._instanced?(a=i._index,o(a,r)):(a=i._index*4,o(a+0,r),o(a+1,r),o(a+2,r),o(a+3,r))}function M8e(e,t,n,i){Wme(e,t,n,i),Mme(e,t,n,i),Nme(e,t,n,i),HJ(e,t,n,i),KJ(e,t,n,i),kme(e,t,n,i),Ume(e,t,n,i),Dme(e,t,n,i),Ome(e,t,n,i),A8e(e,t,n,i),Bme(e,t,n,i),Yme(e,t,n,i)}function zJ(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,h=fo._computeActualPosition(d,u,i,o);l(h)&&(d._setActualPosition(h),r?a.push(h):de.expand(s,h,s))}r&&de.fromPoints(a,s)}function N8e(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&zJ(e,i,i.length,t,r,!0)):n===oe.MORPHING?zJ(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&zJ(e,o,e._billboardsToUpdateIndex,t,r,!1)}function k8e(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 U8e(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=Ge.OVERLAY,i}var D8e=[];Bu.prototype.update=function(e){if(QJ(this),!this.show)return;let t=e.context;this._instanced=t.instancedArrays,po=this._instanced?G8e:Z8e,OJ=this._instanced?I8e:E8e;let n=this._billboards,i=n.length,o=!0;for(let W=0;W<i;++W){let v=n[W];l(v.loadError)&&(console.error(`Error loading image for billboard: ${v.loadError}`),v.image=void 0),v.textureDirty&&this._updateBillboard(v,pT),v.show&&(o=o&&v.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;N8e(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,d=r.guid,u=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;let h,p=e.passes,g=p.pick;if(u||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let W=0;W<JJ;++W)c[W]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=W8e(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let W=0;W<i;++W){let v=this._billboards[W];v._dirty=!1,v.textureDirty=!1,M8e(this,e,h,v)}this._vaf.commit(OJ(t))}this._billboardsToUpdateIndex=0}else if(a>0){let W=D8e;W.length=0,(c[Y2]||c[C8e]||c[S8e])&&W.push(Wme),(c[pT]||c[Sme]||c[_8e]||c[T8e]||c[x8e])&&(W.push(Mme),this._instanced&&W.push(KJ)),(c[pT]||c[V8e]||c[Rme])&&(W.push(Nme),W.push(HJ)),(c[pT]||c[Vme])&&W.push(HJ),(c[pT]||c[Cme])&&W.push(KJ),c[Lme]&&W.push(kme),c[Zme]&&W.push(Ume),(c[Gme]||c[L8e]||c[pT]||c[Y2])&&W.push(Dme),(c[pT]||c[Y2])&&W.push(Ome),c[Eme]&&W.push(Bme),c[Ime]&&W.push(Yme);let v=W.length;if(h=this._vaf.writers,a/i>.1){for(let A=0;A<a;++A){let b=s[A];b._dirty=!1,b.textureDirty=!1;for(let R=0;R<v;++R)W[R](this,e,h,b)}this._vaf.commit(OJ(t))}else{for(let A=0;A<a;++A){let b=s[A];b._dirty=!1,b.textureDirty=!1;for(let R=0;R<v;++R)W[R](this,e,h,b);this._instanced?this._vaf.subCommit(b._index,1):this._vaf.subCommit(b._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,de.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,y=F.IDENTITY;e.mode===oe.SCENE3D?(y=this.modelMatrix,f=de.clone(this._baseVolumeWC,this._boundingVolume)):f=de.clone(this._baseVolume2D,this._boundingVolume),k8e(this,e,f);let x=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,x){this._blendOption===Go.OPAQUE||this._blendOption===Go.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!0}):this._rsOpaque=void 0;let W=this._blendOption===Go.TRANSLUCENT;this._blendOption===Go.TRANSLUCENT||this._blendOption===Go.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:W?ie.LEQUAL:ie.LESS},depthMask:W,blending:fn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let S,C,V,L,Z,E=Dt.maximumVertexTextureImageUnits>0;if(x||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){S=B2,C=O2,Z=[],l(this._batchTable)&&(Z.push("VECTOR_TILE"),S=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(S),C=this._batchTable.getFragmentShaderCallback(!1,void 0)(C)),V=new De({defines:Z,sources:[S]}),this._instanced&&V.defines.push("INSTANCED"),this._shaderRotation&&V.defines.push("ROTATION"),this._shaderAlignedAxis&&V.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&V.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&V.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&V.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&V.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&V.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(E?V.defines.push("VERTEX_DEPTH_CHECK"):V.defines.push("FRAGMENT_DEPTH_CHECK"));let W=1-ta.CUTOFF;this._sdf&&V.defines.push("SDF");let v=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Go.OPAQUE_AND_TRANSLUCENT&&(L=new De({defines:["OPAQUE",v],sources:[C]}),this._shaderClampToGround&&(E?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(L.defines.push("SDF"),L.defines.push(`SDF_EDGE ${W}`)),this._sp=nn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:po}),L=new De({defines:["TRANSLUCENT",v],sources:[C]}),this._shaderClampToGround&&(E?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(L.defines.push("SDF"),L.defines.push(`SDF_EDGE ${W}`)),this._spTranslucent=nn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:po})),this._blendOption===Go.OPAQUE&&(L=new De({defines:[v],sources:[C]}),this._shaderClampToGround&&(E?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(L.defines.push("SDF"),L.defines.push(`SDF_EDGE ${W}`)),this._sp=nn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:po})),this._blendOption===Go.TRANSLUCENT&&(L=new De({defines:[v],sources:[C]}),this._shaderClampToGround&&(E?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(L.defines.push("SDF"),L.defines.push(`SDF_EDGE ${W}`)),this._spTranslucent=nn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:po})),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 P=e.commandList;if(p.render||p.pick){let W=this._colorCommands,v=this._blendOption===Go.OPAQUE,A=this._blendOption===Go.OPAQUE_AND_TRANSLUCENT,b=this._vaf.va,R=b.length,G=this._uniforms,I;l(this._batchTable)?(G=this._batchTable.getUniformMapCallback()(G),I=this._batchTable.getPickId()):I="v_pickColor",W.length=R;let w=A?R*2:R;for(let M=0;M<w;++M){let O=W[M];l(O)||(O=W[M]=new $e);let k=v||A&&M%2===0;O.pass=k||!A?Ge.OPAQUE:Ge.TRANSLUCENT,O.owner=this;let B=A?Math.floor(M/2):M;O.boundingVolume=f,O.modelMatrix=y,O.count=b[B].indicesCount,O.shaderProgram=k?this._sp:this._spTranslucent,O.uniformMap=G,O.vertexArray=b[B].va,O.renderState=k?this._rsOpaque:this._rsTranslucent,O.debugShowBoundingVolume=this.debugShowBoundingVolume,O.pickId=I,this._instanced&&(O.count=6,O.instanceCount=i),P.push(O)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=U8e(this,e.context)),P.push(this.debugCommand))}this._allBillboardsReady=o};Bu.prototype.isDestroyed=function(){return!1};Bu.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(),Xme(this._billboards),me(this)};var vd=Bu;var Wjn=_(T(),1);var Ljn=_(T(),1);function O8e(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var bT=O8e;function Ta(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),Y1(this)}var B8e=new he;Object.defineProperties(Ta.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=D.clone(e,this._color),Y1(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,Y1(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=D.clone(e,this._pointOutlineColor),Y1(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,Y1(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=this._heightOffset??0,n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,B8e);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=D.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&Y1(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});Ta.defaultColor=D.WHITE;Ta.defaultPointOutlineColor=D.BLACK;Ta.defaultPointOutlineWidth=0;Ta.defaultPointSize=8;function Y1(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??Ta.defaultColor,i=e._pointOutlineColor??Ta.defaultPointOutlineColor,o=e._pointOutlineWidth??Ta.defaultPointOutlineWidth,r=e._pointSize??Ta.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(D.equals(n,s)&&D.equals(i,a)&&o===c&&r===d)return;e._billboardColor=D.clone(n,e._billboardColor),e._billboardOutlineColor=D.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([h,r,p,o]);t.setImage(g,bT(u,h,p,o,r))}Ta.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Ta.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Ta.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Ta.prototype.getPropertyInherited=function(e){return js.getPropertyInherited(this._content,this._batchId,e)};Ta.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Ta.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Ta.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Ta.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ab=Ta;var _8n=_(T(),1);var ihe=_(Jme(),1);var qjn=_(T(),1);var Fjn=_(T(),1),z8e={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Oo=Object.freeze(z8e);var Qme={},jme=0,H8e=256,K8e=new D(.165,.165,.165,.8),J8e=new U(7,5),_s=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function gT(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function H2(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function K2(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function $me(e){let t=Qme[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(K2(n,"line-height"));isNaN(i)&&(i=void 0),t={family:K2(n,"font-family"),size:K2(n,"font-size").replace("px",""),style:K2(n,"font-style"),weight:K2(n,"font-weight"),lineHeight:i},document.body.removeChild(n),jme<H8e&&(Qme[e._font]=t,jme++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function mh(e,t){e=e??Y.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ot.clone(n)),l(i)&&(i=Ot.clone(i)),l(o)&&(o=Ot.clone(o)),l(r)&&(r=At.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=D.clone(e.fillColor??D.WHITE),this._outlineColor=D.clone(e.outlineColor??D.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=D.clone(e.backgroundColor??K8e),this._backgroundPadding=U.clone(e.backgroundPadding??J8e),this._style=e.style??Oo.FILL,this._verticalOrigin=e.verticalOrigin??Mn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??_i.LEFT,this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._eyeOffset=m.clone(e.eyeOffset??m.ZERO),this._position=m.clone(e.position??m.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??Ke.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,$me(this),this._updateClamping()}Object.defineProperties(mh.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),H2(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=mh.filterUnsupportedCharacters(e);this._renderedText=mh.enableRightToLeftDetection?t7e(t):t,gT(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,gT(this),$me(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;D.equals(t,e)||(D.clone(e,t),gT(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;D.equals(t,e)||(D.clone(e,t),gT(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,gT(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,gT(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!D.equals(t,e)){D.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;U.equals(t,e)||(U.clone(e,t),H2(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,gT(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Ot.equals(t,e)){this._translucencyByDistance=Ot.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Ot.equals(t,e)){this._pixelOffsetScaleByDistance=Ot.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Ot.equals(t,e)){this._scaleByDistance=Ot.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,H2(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),H2(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),H2(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!At.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=At.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});mh.prototype._updateClamping=function(){fo._updateClamping(this._labelCollection,this)};mh.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return fo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};mh.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?o-=s:e.verticalOrigin===Mn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let d=0,u=0,h=e._glyphs,p=h.length;for(let g=0;g<p;++g){let f=h[g],y=f.billboard;if(!l(y))continue;let x=t.x+y._translate.x,S=t.y-y._translate.y,C=f.dimensions.width*a,V=f.dimensions.height*a;e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?S-=V:e.verticalOrigin===Mn.CENTER&&(S-=V*.5),e._verticalOrigin===Mn.TOP?S+=ta.PADDING*a:(e._verticalOrigin===Mn.BOTTOM||e._verticalOrigin===Mn.BASELINE)&&(S-=ta.PADDING*a),i=Math.min(i,x),o=Math.min(o,S),d=Math.max(d,x+C),u=Math.max(u,S+V)}r=d-i,s=u-o}return l(n)||(n=new ze),n.x=i,n.y=o,n.width=r,n.height=s,n};mh.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};mh.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&m.equals(this._position,e._position)&&D.equals(this._fillColor,e._fillColor)&&D.equals(this._outlineColor,e._outlineColor)&&D.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&m.equals(this._eyeOffset,e._eyeOffset)&&Ot.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ot.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ot.equals(this._scaleByDistance,e._scaleByDistance)&&At.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};mh.prototype.isDestroyed=function(){return!1};mh.enableRightToLeftDetection=!1;function Q8e(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=_s.LTR,a="",c=e.length;for(let d=0;d<c;++d){let u=e.charAt(d);t.test(u)?a=_s.RTL:n.test(u)?a=_s.LTR:i.test(u)?a=_s.BRACKETS:a=_s.WEAK,d===0&&(s=a),s===a&&a!==_s.BRACKETS?r+=u:(r!==""&&o.push({Type:s,Word:r}),s=a,r=u)}return o.push({Type:a,Word:r}),o}function j8e(e){return e.split("").reverse().join("")}function J2(e,t,n){return e.slice(0,t)+n+e.slice(t)}function q8e(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var $8e="\u05D0-\u05EA",e7e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",qme=new RegExp(`[${$8e}${e7e}]`);function t7e(e){let t=e.split(`
|
|
|
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=qme.test(o.charAt(0)),s=Q8e(o,qme),a=0,c="";for(let d=0;d<s.length;++d){let u=s[d],h=u.Type===_s.BRACKETS?q8e(u.Word):j8e(u.Word);r?u.Type===_s.RTL?(c=h+c,a=0):u.Type===_s.LTR?(c=J2(c,a,u.Word),a+=u.Word.length):(u.Type===_s.WEAK||u.Type===_s.BRACKETS)&&(u.Type===_s.WEAK&&s[d-1].Type===_s.BRACKETS?c=h+c:s[d-1].Type===_s.RTL?(c=h+c,a=0):s.length>d+1?s[d+1].Type===_s.RTL?(c=h+c,a=0):(c=J2(c,a,u.Word),a+=u.Word.length):c=J2(c,0,h)):u.Type===_s.RTL?c=J2(c,a,h):u.Type===_s.LTR?(c+=u.Word,a=c.length):(u.Type===_s.WEAK||u.Type===_s.BRACKETS)&&(d>0&&s[d-1].Type===_s.RTL?s.length>d+1?s[d+1].Type===_s.RTL?c=J2(c,a,h):(c+=u.Word,a=c.length):c+=u.Word:(c+=u.Word,a=c.length))}n+=c,i<t.length-1&&(n+=`
|
|
|
`)}return n}var ey=mh;var ohe=_(ehe(),1);function i7e(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var o7e=1.2,the="ID_WHITE_PIXEL",qJ=new U(4,4),r7e=new ze(1,1,1,1);function s7e(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=qJ.x,o.height=qJ.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(the,o),n.addImageSubRegion(the,r7e)}let i=e.add({collection:t});return i.setImageTexture(n),i}var Mb={};function a7e(e,t,n,i,o,r){return Mb.font=t,Mb.fillColor=n,Mb.strokeColor=i,Mb.strokeWidth=o,Mb.padding=ta.PADDING,Mb.fill=r===Oo.FILL||r===Oo.FILL_AND_OUTLINE,Mb.stroke=r===Oo.OUTLINE||r===Oo.FILL_AND_OUTLINE,Mb.backgroundColor=D.BLACK,e_(e,Mb)}function $J(e,t){let n=t.billboard;l(n)&&(n.show=!1,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var c7e=new ohe.default,l7e=/\s/;function d7e(e,t){let n=t._renderedText,i=c7e.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/ta.FONT_SIZE,o<s)for(let g=o;g<s;++g)$J(e,r[g]);r.length=o;let a=t.show&&t._showBackground&&n.split(`
|
|
|
`).join("").length>0,c=t._backgroundBillboard,d=e._backgroundBillboardCollection;a?(l(c)||(c=s7e(d,e),t._backgroundBillboard=c),c.color=t._backgroundColor,c.show=t._show,c.position=t._position,c.eyeOffset=t._eyeOffset,c.pixelOffset=t._pixelOffset,c.horizontalOrigin=_i.LEFT,c.verticalOrigin=t._verticalOrigin,c.heightReference=t._heightReference,c.scale=t.totalScale,c.pickPrimitive=t,c.id=t._id,c.translucencyByDistance=t._translucencyByDistance,c.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,c.scaleByDistance=t._scaleByDistance,c.distanceDisplayCondition=t._distanceDisplayCondition,c.disableDepthTestDistance=t._disableDepthTestDistance,c.clusterShow=t.clusterShow):l(c)&&(d.remove(c),t._backgroundBillboard=c=void 0);let u=e._glyphBillboardCollection,h=u.billboardTextureCache,p=e._textDimensionsCache;for(let g=0;g<o;++g){let f=i[g],y=t._verticalOrigin,x=JSON.stringify([f,t._fontFamily,t._fontStyle,t._fontWeight,+y]),S=p[x],C=h.get(x);if(!l(C)||!l(S)){C=new Fb(u),h.set(x,C);let E=`${t._fontStyle} ${t._fontWeight} ${ta.FONT_SIZE}px ${t._fontFamily}`,P=a7e(f,E,D.WHITE,D.WHITE,0,Oo.FILL);if(S=P.dimensions,p[x]=S,P.width>0&&P.height>0&&!l7e.test(f)){let W=(0,ihe.default)(P,{cutoff:ta.CUTOFF,radius:ta.RADIUS}),v=P.getContext("2d"),A=P.width,b=P.height,R=v.getImageData(0,0,A,b);for(let G=0;G<A;G++)for(let I=0;I<b;I++){let w=I*A+G,M=W[w]*255,O=w*4;R.data[O+0]=M,R.data[O+1]=M,R.data[O+2]=M,R.data[O+3]=M}v.putImageData(R,0,0),C.loadImage(x,P)}}let V=r[g];if(l(V)||(V=new i7e,V.dimensions=S,V.billboardTexture=C,r[g]=V),V.billboardTexture.id!==x&&(V.billboardTexture=C,V.dimensions=S),!C.hasImage){$J(e,V);continue}let L=V.billboard,Z=e._spareBillboards;l(L)||(Z.length>0?L=Z.pop():(L=u.add({collection:e}),L._labelDimensions=new U,L._labelTranslate=new U),V.billboard=L),L.setImageTexture(C),L.show=t._show,L.position=t._position,L.eyeOffset=t._eyeOffset,L.pixelOffset=t._pixelOffset,L.horizontalOrigin=_i.LEFT,L.verticalOrigin=t._verticalOrigin,L.heightReference=t._heightReference,L.scale=t.totalScale,L.pickPrimitive=t,L.id=t._id,L.translucencyByDistance=t._translucencyByDistance,L.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,L.scaleByDistance=t._scaleByDistance,L.distanceDisplayCondition=t._distanceDisplayCondition,L.disableDepthTestDistance=t._disableDepthTestDistance,L._batchIndex=t._batchIndex,L.outlineColor=t.outlineColor,t.style===Oo.FILL_AND_OUTLINE?(L.color=t._fillColor,L.outlineWidth=t.outlineWidth):t.style===Oo.FILL?(L.color=t._fillColor,L.outlineWidth=0):t.style===Oo.OUTLINE&&(L.color=D.TRANSPARENT,L.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function nhe(e,t,n){return t===_i.CENTER?-e/2:t===_i.RIGHT?-(e+n.x):n.x}var fr=new U,u7e=new U;function m7e(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,d=t.length,u=e._backgroundBillboard,h=U.clone(l(u)?e._backgroundPadding:U.ZERO,u7e);h.x/=e._relativeSize,h.y/=e._relativeSize;for(let v=0;v<d;++v){if(n.charAt(v)===`
|
|
|
`){r.push(i),++c,i=0;continue}let b=t[v].dimensions;l(b)&&(a=Math.max(a,b.height-b.descent),s=Math.max(s,b.descent),i+=b.width-b.minx,v<d-1&&(i+=t[v+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,g=e.totalScale,f=e._horizontalOrigin,y=e._verticalOrigin,x=0,S=r[x],C=nhe(S,f,h),V=(l(e._lineHeight)?e._lineHeight:o7e*e._fontSize)/e._relativeSize,L=V*(c-1),Z=o,E=p+L;l(u)&&(Z+=h.x*2,E+=h.y*2,u._labelHorizontalOrigin=f),fr.x=C*g,fr.y=0;let P=!0,W=0;for(let v=0;v<d;++v){if(n.charAt(v)===`
|
|
|
`){++x,W+=V,S=r[x],C=nhe(S,f,h),fr.x=C*g,P=!0;continue}let A=t[v],b=A.dimensions;if(l(b)&&(y===Mn.TOP?(fr.y=b.height-a-h.y,fr.y+=ta.PADDING):y===Mn.CENTER?fr.y=(L+b.height-a)/2:y===Mn.BASELINE?(fr.y=L,fr.y-=ta.PADDING):(fr.y=L+s+h.y,fr.y-=ta.PADDING),fr.y=(fr.y-b.descent-W)*g,P&&(fr.x-=ta.PADDING*g,P=!1),l(A.billboard)&&(A.billboard._setTranslate(fr),A.billboard._labelDimensions.x=Z,A.billboard._labelDimensions.y=E,A.billboard._labelHorizontalOrigin=f),v<d-1)){let R=t[v+1];fr.x+=(b.width-b.minx+R.dimensions.minx)*g}}if(l(u)&&n.split(`
|
|
|
`).join("").length>0&&(f===_i.CENTER?C=-o/2-h.x:f===_i.RIGHT?C=-(o+h.x*2):C=0,fr.x=C*g,y===Mn.TOP?fr.y=p-a-s:y===Mn.CENTER?fr.y=(p-a)/2-s:y===Mn.BASELINE?fr.y=-h.y-s:fr.y=0,fr.y=fr.y*g,u.width=Z,u.height=E,u._setTranslate(fr),u._labelTranslate=U.clone(fr,u._labelTranslate)),Pu(e.heightReference))for(let v=0;v<d;++v){let b=t[v].billboard;l(b)&&(b._labelTranslate=U.clone(fr,b._labelTranslate))}}function rhe(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)$J(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),me(t)}function Wf(e){e=e??Y.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new vd({scene:this._scene,textureAtlas:new Vx({initialSize:qJ})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new Fb(t),this._glyphBillboardCollection=new vd({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=D.clone(D.WHITE),this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Go.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Wf.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}}});Wf.prototype.add=function(e){let t=new ey(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Wf.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),rhe(this,e),!0}return!1};Wf.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)rhe(this,e[t]);e.length=0};Wf.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Wf.prototype.get=function(e){return this._labels[e]};Wf.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let r=0;r<i;++r){let s=this._labelsToUpdate[r];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&(d7e(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(m7e(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let o=n.length>0?Go.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)};Wf.prototype.isDestroyed=function(){return!1};Wf.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),me(this)};var Pf=Wf;var x7n=_(T(),1);var S8n=_(T(),1),Q2=`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 v8n=_(T(),1);function wd(e,t){e=e??Y.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=Ji.fromType(Ji.ColorType,{color:new D(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Co(n,m.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=wi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(ahe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=de.fromPoints(this._actualPositions),this._boundingVolumeWC=de.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new de}var she=wd.POSITION_INDEX=0,h7e=wd.SHOW_INDEX=1,f7e=wd.WIDTH_INDEX=2,p7e=wd.MATERIAL_INDEX=3,j2=wd.POSITION_SIZE_INDEX=4,b7e=wd.DISTANCE_DISPLAY_CONDITION=5,ahe=wd.NUMBER_OF_PROPERTIES=6;function Nb(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(wd.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Nb(this,h7e))}},positions:{get:function(){return this._positions},set:function(e){let t=Co(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Nb(this,j2),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=de.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=de.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Nb(this,she),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Nb(this,p7e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Nb(this,f7e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Nb(this,j2)}}},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){At.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=At.clone(e,this._distanceDisplayCondition),Nb(this,b7e))}}});wd.prototype.update=function(){let e=F.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[she]>0||this._propertiesChanged[j2]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=wi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=de.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)Nb(this,j2);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){Nb(this,j2);break}}};wd.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};wd.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<ahe-1;++t)e[t]=0};wd.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Yu=wd;var g7e=Yu.SHOW_INDEX,y7e=Yu.WIDTH_INDEX,tQ=Yu.POSITION_INDEX,x7e=Yu.MATERIAL_INDEX,che=Yu.POSITION_SIZE_INDEX,_7e=Yu.DISTANCE_DISPLAY_CONDITION,phe=Yu.NUMBER_OF_PROPERTIES,Yl={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 hh(e){e=e??Y.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(phe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:ke.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=D.clone(D.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(hh.prototype,{length:{get:function(){return nQ(this),this._polylines.length}}});hh.prototype.add=function(e){let t=new Yu(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};hh.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};hh.prototype.removeAll=function(){iQ(this),_he(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};hh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};hh.prototype.get=function(e){return nQ(this),this._polylines[e]};function T7e(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Q.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Q.FLOAT,componentsPerAttribute:2}];e._batchTable=new x_(t,n,e._polylines.length)}var bhe=new Yn,ghe=new re,yhe=new U;hh.prototype.update=function(e){if(nQ(this),this._polylines.length===0||!this.show)return;Z7e(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Dt.maximumVertexTextureImageUnits===0)throw new ce("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");T7e(this,t),this._createBatchTable=!1}if(this._createVertexArray||C7e(this))uhe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==oe.SCENE3D){let d=c.length;for(let u=0;u<d;++u)i=c[u],i.update()}if(o[che]||o[x7e])uhe(this,t,n);else{let d=c.length,u=this._polylineBuckets;for(let h=0;h<d;++h){i=c[h],o=i._propertiesChanged;let p=i._bucket,g=0;for(let f in u)if(u.hasOwnProperty(f)){if(u[f]===p){o[tQ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=u[f].lengthOfPositions}if((o[g7e]||o[y7e])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(o[tQ]||o[che]){let f=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Yn.fromCartesian(f.center,bhe),x=re.fromElements(y.low.x,y.low.y,y.low.z,f.radius,ghe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,x)}if(o[_7e]){let f=yhe;f.x=0,f.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(f.x=y.near,f.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<phe;++c)o[c]=0;let r=F.IDENTITY;e.mode===oe.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ue.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ue.fromCache({blending:fn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;S7e(this,e,c,r)}};var q2=new de,lhe=new de;function S7e(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,d=e._vertexArrays,u=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=d.length;for(let f=0;f<g;++f){let y=d[f],x=y.buckets,S=x.length;for(let C=0;C<S;++C){let V=x[C],L=V.offset,Z=V.bucket.shaderProgram,E=V.bucket.polylines,P=E.length,W,v,A=0,b,R;for(let G=0;G<P;++G){let I=E[G],w=L7e(I._material);if(w!==W){if(l(W)&&A>0){let B=v.isTranslucent();a>=s?(b=new $e({owner:e}),n.push(b)):b=n[a],++a,R=Rt(p(v._uniforms),e._uniformMap),b.boundingVolume=de.clone(q2,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=Z,b.vertexArray=y.va,b.renderState=B?e._translucentRS:e._opaqueRS,b.pass=B?Ge.TRANSLUCENT:Ge.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=A,b.offset=L,L+=A,A=0,c=!0,r.push(b)}v=I._material,v.update(o),W=w}let M=I._locatorBuckets,O=M.length;for(let B=0;B<O;++B){let N=M[B];N.locator===V&&(A+=N.count)}let k;t.mode===oe.SCENE3D?k=I._boundingVolumeWC:t.mode===oe.COLUMBUS_VIEW?k=I._boundingVolume2D:t.mode===oe.SCENE2D?l(I._boundingVolume2D)&&(k=de.clone(I._boundingVolume2D,lhe),k.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(k=de.union(I._boundingVolumeWC,I._boundingVolume2D,lhe)),c?(c=!1,de.clone(k,q2)):de.union(k,q2,q2)}l(W)&&A>0&&(a>=s?(b=new $e({owner:e}),n.push(b)):b=n[a],++a,R=Rt(p(v._uniforms),e._uniformMap),b.boundingVolume=de.clone(q2,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=Z,b.vertexArray=y.va,b.renderState=v.isTranslucent()?e._translucentRS:e._opaqueRS,b.pass=v.isTranslucent()?Ge.TRANSLUCENT:Ge.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=A,b.offset=L,c=!0,r.push(b)),W=void 0}}n.length=a}hh.prototype.isDestroyed=function(){return!1};hh.prototype.destroy=function(){return xhe(this),iQ(this),_he(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function C7e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[tQ]?(i.bufferUsage!==ke.STREAM_DRAW&&(t=!0,i.bufferUsage=ke.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==ke.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=ke.STATIC_DRAW):i.frameCount--),t}var dhe=[0,0,0];function uhe(e,t,n){e._createVertexArray=!1,iQ(e),xhe(e),R7e(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,h=e._polylineBuckets,p,g;for(p in h)h.hasOwnProperty(p)&&(g=h[p],g.updateShader(t,r,s),u+=g.lengthOfPositions);if(u>0){let f=e._mode,y=new Float32Array(6*u*3),x=new Float32Array(u*4),S,C=0,V=0,L=0;for(p in h)if(h.hasOwnProperty(p)){g=h[p],g.write(y,x,C,V,L,r,t,n),f===oe.MORPHING&&(l(S)||(S=new Float32Array(6*u*3)),g.writeForMorph(S,C));let R=g.lengthOfPositions;C+=6*R*3,V+=R*4,L+=R*4,c=g.updateIndices(i,a,d,c)}let Z=e._positionBufferUsage.bufferUsage,E=ke.STATIC_DRAW;e._positionBuffer=Ct.createVertexBuffer({context:t,typedArray:y,usage:Z});let P;l(S)&&(P=Ct.createVertexBuffer({context:t,typedArray:S,usage:Z})),e._texCoordExpandAndBatchIndexBuffer=Ct.createVertexBuffer({context:t,typedArray:x,usage:E});let W=3*Float32Array.BYTES_PER_ELEMENT,v=4*Float32Array.BYTES_PER_ELEMENT,A=0,b=i.length;for(let R=0;R<b;++R)if(o=i[R],o.length>0){let G=new Uint16Array(o),I=Ct.createIndexBuffer({context:t,typedArray:G,usage:ke.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});A+=a[R];let w=6*(R*(W*X.SIXTY_FOUR_KILOBYTES)-A*W),M=W+w,O=W+M,k=W+O,B=W+k,N=W+B,z=R*(v*X.SIXTY_FOUR_KILOBYTES)-A*v,K=[{index:Yl.position3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:w,strideInBytes:6*W},{index:Yl.position3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:M,strideInBytes:6*W},{index:Yl.position2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:w,strideInBytes:6*W},{index:Yl.position2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:M,strideInBytes:6*W},{index:Yl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*W},{index:Yl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*W},{index:Yl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*W},{index:Yl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*W},{index:Yl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:B,strideInBytes:6*W},{index:Yl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*W},{index:Yl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:B,strideInBytes:6*W},{index:Yl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*W},{index:Yl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:z}],te,H,j,ee;f===oe.SCENE3D?(H=e._positionBuffer,te="vertexBuffer",j=dhe,ee="value"):f===oe.SCENE2D||f===oe.COLUMBUS_VIEW?(H=dhe,te="value",j=e._positionBuffer,ee="vertexBuffer"):(H=P,te="vertexBuffer",j=e._positionBuffer,ee="vertexBuffer"),K[0][te]=H,K[1][te]=H,K[2][ee]=j,K[3][ee]=j,K[4][te]=H,K[5][te]=H,K[6][ee]=j,K[7][ee]=j,K[8][te]=H,K[9][te]=H,K[10][ee]=j,K[11][ee]=j;let pe=new oi({context:t,attributes:K,indexBuffer:I});e._vertexArrays.push({va:pe,buckets:d[R]})}}}function V7e(e,t){return t instanceof vt?t.id:t}var cU=[];function L7e(e){let t=Ji._uniformList[e.type],n=t.length;cU.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];cU[i]=r,cU[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(cU,V7e)}`}function R7e(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,d=i[c.type];l(d)||(d=i[c.type]=new vf(c,t,n)),d.addPolyline(a)}}}function Z7e(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function nQ(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function iQ(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 xhe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}hh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function _he(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function eQ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function vf(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}vf.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};vf.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"),Ht.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new De({defines:i,sources:[`in vec4 v_pickColor;
|
|
|
`,this.material.shaderSource,V_]}),r=t.getVertexShaderCallback()(Q2),s=new De({defines:i,sources:[Vd,r]});this.shaderProgram=nn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Yl})};function The(e){return m.dot(m.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(dn.ORIGIN_ZX_PLANE)===Jt.INTERSECTING}vf.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===oe.SCENE3D||!The(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 ws=new m,zu=new m,Hu=new m,lU=new m,G7e=new re,E7e=new U;vf.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,d=a.ellipsoid.maximumRadius*X.PI,u=this.polylines,h=u.length;for(let p=0;p<h;++p){let g=u[p],f=g.width,y=g.show&&f>0,x=g._index,S=this.getSegments(g,a),C=S.positions,V=S.lengths,L=C.length,Z=g.getPickId(s).color,E=0,P=0,W;for(let O=0;O<L;++O){O===0?g._loop?W=C[L-2]:(W=lU,m.subtract(C[0],C[1],W),m.add(C[0],W,W)):W=C[O-1],m.clone(W,zu),m.clone(C[O],ws),O===L-1?g._loop?W=C[1]:(W=lU,m.subtract(C[L-1],C[L-2],W),m.add(C[L-1],W,W)):W=C[O+1],m.clone(W,Hu);let k=V[E];O===P+k&&(P+=k,++E);let B=O-P===0,N=O===P+V[E]-1;c===oe.SCENE2D&&(zu.z=0,ws.z=0,Hu.z=0),(c===oe.SCENE2D||c===oe.MORPHING)&&(B||N)&&d-Math.abs(ws.x)<1&&((ws.x<0&&zu.x>0||ws.x>0&&zu.x<0)&&m.clone(ws,zu),(ws.x<0&&Hu.x>0||ws.x>0&&Hu.x<0)&&m.clone(ws,Hu));let z=B?2:0,K=N?2:4;for(let te=z;te<K;++te){Yn.writeElements(ws,e,n),Yn.writeElements(zu,e,n+6),Yn.writeElements(Hu,e,n+12);let H=te-2<0?-1:1;t[o]=O/(L-1),t[o+1]=2*(te%2)-1,t[o+2]=H,t[o+3]=x,n+=6*3,o+=4}}let v=G7e;v.x=D.floatToByte(Z.red),v.y=D.floatToByte(Z.green),v.z=D.floatToByte(Z.blue),v.w=D.floatToByte(Z.alpha);let A=E7e;A.x=f,A.y=y?1:0;let b=c===oe.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,R=Yn.fromCartesian(b.center,bhe),G=R.high,I=re.fromElements(R.low.x,R.low.y,R.low.z,b.radius,ghe),w=yhe;w.x=0,w.y=Number.MAX_VALUE;let M=g.distanceDisplayCondition;l(M)&&(w.x=M.near,w.y=M.far),r.setBatchedAttribute(x,0,A),r.setBatchedAttribute(x,1,v),r.attributes.length>2&&(r.setBatchedAttribute(x,2,G),r.setBatchedAttribute(x,3,I),r.setBatchedAttribute(x,4,w))}};var I7e=new m,X7e=new m,W7e=new m,mhe=new m;vf.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,d=a.length,u=0,h=0;for(let p=0;p<d;++p){let g;p===0?s._loop?g=a[d-2]:(g=mhe,m.subtract(a[0],a[1],g),m.add(a[0],g,g)):g=a[p-1],g=F.multiplyByPoint(n,g,X7e);let f=F.multiplyByPoint(n,a[p],I7e),y;p===d-1?s._loop?y=a[1]:(y=mhe,m.subtract(a[d-1],a[d-2],y),m.add(a[d-1],y,y)):y=a[p+1],y=F.multiplyByPoint(n,y,W7e);let x=c[u];p===h+x&&(h+=x,++u);let S=p-h===0,C=p===h+c[u]-1,V=S?2:0,L=C?2:4;for(let Z=V;Z<L;++Z)Yn.writeElements(f,e,t),Yn.writeElements(g,e,t+6),Yn.writeElements(y,e,t+12),t+=6*3}}};var P7e=new Array(1);vf.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new eQ(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let h=0;h<u;++h){let p=d[h];p._locatorBuckets=[];let g;if(this.mode===oe.SCENE3D){g=P7e;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let f=g.length;if(f>0){let y=0;for(let x=0;x<f;++x){let S=g[x]-1;for(let C=0;C<S;++C)c+4>X.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:y}),y=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new eQ(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),y+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:y}),c+4>X.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new eQ(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};vf.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 z1={positions:void 0,lengths:void 0},hhe=new Array(1),v7e=new m,w7e=new he;vf.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===oe.SCENE3D)return hhe[0]=n.length,z1.positions=n,z1.lengths=hhe,z1;The(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=v7e;for(let d=0;d<s;++d)a=n[d],c=F.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,w7e)));if(o.length>0){e._boundingVolume2D=de.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(d.z,d.x,d.y)}return z1.positions=o,z1.lengths=e._segments.lengths,z1};var fhe;vf.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*X.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=fhe,c=6*s*3;!l(a)||a.length<c?a=fhe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let d=this.getSegments(t,i),u=d.positions,h=d.lengths,p=0,g=0,f=0,y;s=u.length;for(let x=0;x<s;++x){x===0?t._loop?y=u[s-2]:(y=lU,m.subtract(u[0],u[1],y),m.add(u[0],y,y)):y=u[x-1],m.clone(y,zu),m.clone(u[x],ws),x===s-1?t._loop?y=u[1]:(y=lU,m.subtract(u[s-1],u[s-2],y),m.add(u[s-1],y,y)):y=u[x+1],m.clone(y,Hu);let S=h[g];x===f+S&&(f+=S,++g);let C=x-f===0,V=x===f+h[g]-1;o===oe.SCENE2D&&(zu.z=0,ws.z=0,Hu.z=0),(o===oe.SCENE2D||o===oe.MORPHING)&&(C||V)&&r-Math.abs(ws.x)<1&&((ws.x<0&&zu.x>0||ws.x>0&&zu.x<0)&&m.clone(ws,zu),(ws.x<0&&Hu.x>0||ws.x>0&&Hu.x<0)&&m.clone(ws,Hu));let L=C?2:0,Z=V?2:4;for(let E=L;E<Z;++E)Yn.writeElements(ws,a,p),Yn.writeElements(zu,a,p+6),Yn.writeElements(Hu,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var fh=hh;function ty(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new vd({batchTable:e.batchTable}),this._labelCollection=new Pf({batchTable:e.batchTable}),this._polylineCollection=new fh,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(ty.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 F7e(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+le.packedLength+ne.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,le.pack(n,s,a),a+=le.packedLength,ne.pack(t,s,a),s}var A7e=new yi("createVectorTilePoints",5),M7e=new m;function N7e(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=F7e(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=A7e.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let f=h[g],y=m.unpack(n,g*3,M7e),x=c.add();x.position=y,x._batchIndex=f;let S=d.add();S.text=" ",S.position=y,S._batchIndex=f;let C=u.add();C.positions=[m.clone(y),m.clone(y)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}ty.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],d=n.get(a),u=i.get(a),h=o.get(a);t[c]=new Ab(e,c,d,u,h)}};ty.prototype.applyDebugSettings=function(e,t){e?(D.clone(t,this._billboardCollection._highlightColor),D.clone(t,this._labelCollection._highlightColor),D.clone(t,this._polylineCollection._highlightColor)):(D.clone(D.WHITE,this._billboardCollection._highlightColor),D.clone(D.WHITE,this._labelCollection._highlightColor),D.clone(D.WHITE,this._polylineCollection._highlightColor))};function k7e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=Ab.defaultPointSize,s.color=Ab.defaultColor,s.pointOutlineColor=Ab.defaultPointOutlineColor,s.pointOutlineWidth=Ab.defaultPointOutlineWidth,s.labelColor=D.WHITE,s.labelOutlineColor=D.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Oo.FILL,s.labelText=void 0,s.backgroundColor=new D(.165,.165,.165,.8),s.backgroundPadding=new U(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=D.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=_i.CENTER,s.verticalOrigin=Mn.CENTER,s.labelHorizontalOrigin=_i.RIGHT,s.labelVerticalOrigin=Mn.BASELINE}}var U7e=new D,D7e=new D,O7e=new D,B7e=new D,Y7e=new D,z7e=new D,$2=new Ot,ev=new Ot,oQ=new At;ty.prototype.applyStyle=function(e,t){if(!l(e)){k7e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,U7e)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,D7e)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,O7e)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,B7e)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,Y7e)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?($2.near=a.x,$2.nearValue=a.y,$2.far=a.z,$2.farValue=a.w,s.scaleByDistance=$2):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(ev.near=a.x,ev.nearValue=a.y,ev.far=a.z,ev.farValue=a.w,s.translucencyByDistance=ev):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(oQ.near=a.x,oQ.far=a.y,s.distanceDisplayCondition=oQ):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,z7e)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};ty.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=N7e(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)};ty.prototype.isDestroyed=function(){return!1};ty.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(),me(this)};var tv=ty;var q7n=_(T(),1);function kb(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??ne.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??m.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=On.BOTH}Object.defineProperties(kb.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 H7e(e){let t=new Float64Array(3+m.packedLength+ne.packedLength+le.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,m.pack(e._center,t,n),n+=m.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,le.pack(e._rectangle,t,n),t}function K7e(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Xn.unpack(t,n),n+=Xn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=D.unpack(t,n);n+=D.packedLength;let d=t[n++],u=t[n++],h=t[n++],p=new Array(h);for(let g=0;g<h;++g)p[g]=t[n++];s[a]=new Cf({color:c,offset:d,count:u,batchIds:p})}}var J7e=new yi("createVectorTilePolygons",5),Q7e=new D;function j7e(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(le.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,f=s.length;for(let y=0;y<f;++y){let x=g.getColor(y,Q7e);s[y]=x.toRgba()}a=e._packedBuffer=H7e(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],d={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},u=e._polygonMinimumHeights,h=e._polygonMaximumHeights;l(u)&&l(h)&&(u=u.slice(),h=h.slice(),c.push(u.buffer,h.buffer),d.minimumHeights=u,d.maximumHeights=h);let p=J7e.scheduleTask(d,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(g.packedBuffer),y=f[0];K7e(e,f),e._indices=Ne.getSizeInBytes(y)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),q7e(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function q7e(e){l(e._primitive)||(e._primitive=new B_({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)}kb.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};kb.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};kb.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};kb.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};kb.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=j7e(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)};kb.prototype.isDestroyed=function(){return!1};kb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var nv=kb;var L6n=_(T(),1);var e6n=_(T(),1),iv=`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 ph(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ne.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=D.clone(D.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(ph.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function $7e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+le.packedLength+ne.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,le.pack(t,a,c),c+=le.packedLength,ne.pack(o,a,c),c+=ne.packedLength,m.pack(r,a,c),a}var e6e=new yi("createVectorTilePolylines",5),H1={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function t6e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=$7e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=e6e.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let h=u.indexDatatype;e._indices=h===Ne.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),n6e(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function n6e(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let d=Ct.createVertexBuffer({context:t,typedArray:i,usage:ke.STATIC_DRAW}),u=Ct.createVertexBuffer({context:t,typedArray:n,usage:ke.STATIC_DRAW}),h=Ct.createVertexBuffer({context:t,typedArray:o,usage:ke.STATIC_DRAW}),p=Ct.createVertexBuffer({context:t,typedArray:r,usage:ke.STATIC_DRAW}),g=Ct.createVertexBuffer({context:t,typedArray:s,usage:ke.STATIC_DRAW}),f=Ct.createIndexBuffer({context:t,typedArray:a,usage:ke.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),y=[{index:H1.previousPosition,vertexBuffer:d,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:H1.currentPosition,vertexBuffer:u,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:H1.nextPosition,vertexBuffer:h,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:H1.expandAndWidth,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:2},{index:H1.a_batchId,vertexBuffer:g,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new oi({context:t,attributes:y,indexBuffer:f}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var ov=new F,She=new m;function i6e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,ov),F.multiplyByPoint(ov,e._center,She),F.setTranslation(ov,She,ov),ov},u_highlightColor:function(){return e._highlightColor}})}function o6e(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ue.fromCache({blending:fn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var r6e=`uniform vec4 u_highlightColor;
|
|
|
void main()
|
|
|
{
|
|
|
out_FragColor = u_highlightColor;
|
|
|
}
|
|
|
`;function s6e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(iv),o=n.getFragmentShaderCallback(!1,void 0,!1)(r6e),r=new De({defines:["VECTOR_TILE",Ht.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Vd,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=nn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:H1})}function a6e(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new $e({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ge.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}ph.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,d=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let u=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let h=o[r],p=o[r+1]-h;for(s=0;s<p;++s){let g=(h+s)*3;u[d++]=i[g],u[d++]=i[g+1],u[d++]=i[g+2]}}return u};ph.prototype.getPositions=function(e){return ph.getPolylinePositions(this,e)};ph.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 js(e,r)}};ph.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function c6e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=D.WHITE}}var l6e=new D,d6e=D.WHITE,u6e=!0;ph.prototype.applyStyle=function(e,t){if(!l(e)){c6e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,l6e):d6e,s.show=l(e.show)?e.show.evaluate(s):u6e}};ph.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=t6e(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}i6e(this,t),s6e(this,t),o6e(this);let n=e.passes;(n.render||n.pick)&&a6e(this,e)};ph.prototype.isDestroyed=function(){return!1};ph.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var yT=ph;var dqn=_(T(),1);var Z6n=_(T(),1),rv=`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 E6n=_(T(),1),sv=`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 Ub(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ne.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 U(ui._defaultMinTerrainHeight,ui._defaultMaxTerrainHeight),this._boundingVolume=Xn.fromRectangle(e.rectangle,ui._defaultMinTerrainHeight,ui._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=D.clone(D.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Ub.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function m6e(e,t,n){let i=ui.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;Xn.fromRectangle(c,o,r,n,a)}function h6e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+le.packedLength+ne.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,le.pack(t,a,c),c+=le.packedLength,ne.pack(o,a,c),c+=ne.packedLength,m.pack(r,a,c),a}var f6e=new yi("createVectorTileClampedPolylines"),ny={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function p6e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=h6e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=f6e.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(u.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(u.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(u.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(u.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(u.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(u.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(u.vertexBatchIds);let h=u.indexDatatype;e._indices=h===Ne.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),b6e(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function b6e(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=c.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let h=Ct.createVertexBuffer({context:t,typedArray:n,usage:ke.STATIC_DRAW}),p=Ct.createVertexBuffer({context:t,typedArray:i,usage:ke.STATIC_DRAW}),g=Ct.createVertexBuffer({context:t,typedArray:o,usage:ke.STATIC_DRAW}),f=Ct.createVertexBuffer({context:t,typedArray:r,usage:ke.STATIC_DRAW}),y=Ct.createVertexBuffer({context:t,typedArray:s,usage:ke.STATIC_DRAW}),x=Ct.createVertexBuffer({context:t,typedArray:a,usage:ke.STATIC_DRAW}),S=Ct.createVertexBuffer({context:t,typedArray:c,usage:ke.STATIC_DRAW}),C=Ct.createIndexBuffer({context:t,typedArray:d,usage:ke.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),V=[{index:ny.startEllipsoidNormal,vertexBuffer:h,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:ny.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:ny.startPositionAndHeight,vertexBuffer:g,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:ny.endPositionAndHeight,vertexBuffer:f,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:ny.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:ny.endFaceNormalAndHalfWidth,vertexBuffer:x,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:ny.a_batchId,vertexBuffer:S,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new oi({context:t,attributes:V,indexBuffer:C}),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 av=new F,Che=new m;function g6e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,av),F.multiplyByPoint(av,e._center,Che),F.setTranslation(av,Che,av),av},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Vhe(e){return Ue.fromCache({cull:{enabled:!0,face:Ti.FRONT},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Bn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Bn.EQUAL,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function y6e(e){l(e._rs)||(e._rs=Vhe(!1),e._rs3DTiles=Vhe(!0))}function x6e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(rv),o=n.getFragmentShaderCallback(!1,void 0,!0)(sv),r=new De({defines:["VECTOR_TILE",Ht.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Vd,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=nn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:ny})}function _6e(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new $e({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Ge.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=$e.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===On.TERRAIN||i===On.BOTH)&&t.commandList.push(n),(i===On.CESIUM_3D_TILE||i===On.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Ub.prototype.getPositions=function(e){return yT.getPolylinePositions(this,e)};Ub.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 js(e,r)}};Ub.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function T6e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=D.WHITE}}var S6e=new D,C6e=D.WHITE,V6e=!0;Ub.prototype.applyStyle=function(e,t){if(!l(e)){T6e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,S6e):C6e,s.show=l(e.show)?e.show.evaluate(s):V6e}};function L6e(e){return ui.initialize().then(function(){m6e(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Ub.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=L6e(this).then(p6e(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}g6e(this,t),x6e(this,t),y6e(this);let n=e.passes;(n.render||n.pick)&&_6e(this,e)};Ub.prototype.isDestroyed=function(){return!1};Ub.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var cv=Ub;function gh(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,I6e(this,i,o)}Object.defineProperties(gh.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 R6e(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function Z6e(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let d=l(n)||l(i)||l(o),u=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(d&&u)throw new ce("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var bh=Uint32Array.BYTES_PER_ELEMENT;function G6e(e){return new yT(e)}function E6e(e){return new cv(e)}function I6e(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 ce(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=bh;let s=o.getUint32(n,!0);if(n+=bh,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=bh,a===0)throw new ce("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=bh;let d=o.getUint32(n,!0);n+=bh;let u=o.getUint32(n,!0);n+=bh;let h=o.getUint32(n,!0);n+=bh;let p=o.getUint32(n,!0);n+=bh;let g=o.getUint32(n,!0);n+=bh;let f=o.getUint32(n,!0);n+=bh;let y=Qo(i,n,a);n+=a;let x=new Uint8Array(t,n,c);n+=c;let S,C;d>0&&(S=Qo(i,n,d),n+=d,u>0&&(C=new Uint8Array(t,n,u),C=new Uint8Array(C),n+=u));let V=y.POLYGONS_LENGTH??0,L=y.POLYLINES_LENGTH??0,Z=y.POINTS_LENGTH??0,E=V+L+Z,P=new hb(e,E,S,C,R6e(e));if(e._batchTable=P,E===0)return;let W=new ch(y,x),v=W.getGlobalProperty("REGION");if(!l(v))throw new ce("Feature table global property: REGION must be defined");let A=le.unpack(v),b=v[4],R=v[5],G=e._tile.computedTransform,I=W.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(I)?(I=m.unpack(I),F.multiplyByPoint(G,I,I)):(I=le.center(A),I.height=X.lerp(b,R,.5),I=ne.WGS84.cartographicToCartesian(I));let w=Z6e(y,x);if(n+=(4-n%4)%4,V>0){W.featuresLength=V;let M=W.getPropertyArray("POLYGON_COUNTS",Q.UNSIGNED_INT,1)??W.getPropertyArray("POLYGON_COUNT",Q.UNSIGNED_INT,1);if(!l(M))throw new ce("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let O=W.getPropertyArray("POLYGON_INDEX_COUNTS",Q.UNSIGNED_INT,1)??W.getPropertyArray("POLYGON_INDEX_COUNT",Q.UNSIGNED_INT,1);if(!l(O))throw new ce("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=M.reduce(function(H,j){return H+j*2},0),B=O.reduce(function(H,j){return H+j},0),N=new Uint32Array(t,n,B);n+=h;let z=new Uint16Array(t,n,k);n+=p;let K,te;l(y.POLYGON_MINIMUM_HEIGHTS)&&l(y.POLYGON_MAXIMUM_HEIGHTS)&&(K=W.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Q.FLOAT,1),te=W.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Q.FLOAT,1)),e._polygons=new nv({positions:z,counts:M,indexCounts:O,indices:N,minimumHeight:b,maximumHeight:R,polygonMinimumHeights:K,polygonMaximumHeights:te,center:I,rectangle:A,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:P,batchIds:w.polygons,modelMatrix:G})}if(L>0){W.featuresLength=L;let M=W.getPropertyArray("POLYLINE_COUNTS",Q.UNSIGNED_INT,1)??W.getPropertyArray("POLYLINE_COUNT",Q.UNSIGNED_INT,1);if(!l(M))throw new ce("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let O=W.getPropertyArray("POLYLINE_WIDTHS",Q.UNSIGNED_SHORT,1);if(!l(O)){O=new Uint16Array(L);for(let te=0;te<L;++te)O[te]=2}let k=M.reduce(function(te,H){return te+H*3},0),B=new Uint16Array(t,n,k);n+=g;let N=e._tileset,z=N.examineVectorLinesFunction;if(l(z)){let te=HE(new Uint16Array(B),A,b,R,ne.WGS84);X6e(te,M,w.polylines,P,e.url,z)}let K=G6e;l(N.classificationType)&&(K=E6e),e._polylines=K({positions:B,widths:O,counts:M,batchIds:w.polylines,minimumHeight:b,maximumHeight:R,center:I,rectangle:A,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:P,classificationType:N.classificationType,keepDecodedPositions:N.vectorKeepDecodedPositions})}if(Z>0){let M=new Uint16Array(t,n,Z*3);n+=f,e._points=new tv({positions:M,batchIds:w.points,minimumHeight:b,maximumHeight:R,rectangle:A,batchTable:P})}}function rQ(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}}gh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};gh.prototype.getFeature=function(e){return l(this._features)||rQ(this),this._features[e]};gh.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)};gh.prototype.applyStyle=function(e){l(this._features)||rQ(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)};gh.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)||rQ(this),this._batchTable.update(e,t),this._ready=!0)};gh.prototype.pick=function(e,t,n){};gh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};gh.prototype.isDestroyed=function(){return!1};gh.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(),me(this)};function X6e(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let d=t[c]*3,u=e.slice(a,a+d);a+=d,r(u,n[c],o,i)}}var lv=gh;var Lhe={b3dm:function(e,t,n,i,o){return Pd.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Pd.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Pd.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return jX.fromTileType(e,t,n,i,o,Lhe)},externalTileset:function(e,t,n,i){return D2.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new eW(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new lv(e,t,n,i,o)},subt:function(e,t,n,i,o){return E1.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return E1.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new ce("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return Pd.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Pd.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Pd.fromGeoJson(e,t,n,i)}},xT=Lhe;var kqn=_(T(),1),W6e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Bo=Object.freeze(W6e);var Dqn=_(T(),1),yh={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"};yh.isBinaryFormat=function(e){switch(e){case yh.BATCHED_3D_MODEL:case yh.INSTANCED_3D_MODEL:case yh.COMPOSITE:case yh.POINT_CLOUD:case yh.VECTOR:case yh.GEOMETRY:case yh.IMPLICIT_SUBTREE:case yh.VOXEL_BINARY:case yh.GLTF_BINARY:return!0;default:return!1}};var Fs=Object.freeze(yh);var Bqn=_(T(),1),P6e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Ku=Object.freeze(P6e);var zqn=_(T(),1),na={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},Db=new Array(na.NUMBER_OF_PASSES);Db[na.RENDER]=Object.freeze({pass:na.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Db[na.PICK]=Object.freeze({pass:na.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Db[na.SHADOW]=Object.freeze({pass:na.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Db[na.PRELOAD]=Object.freeze({pass:na.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Db[na.PRELOAD_FLIGHT]=Object.freeze({pass:na.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Db[na.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:na.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Db[na.MOST_DETAILED_PRELOAD]=Object.freeze({pass:na.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Db[na.MOST_DETAILED_PICK]=Object.freeze({pass:na.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});na.getPassOptions=function(e){return Db[e]};var Fo=Object.freeze(na);var Jqn=_(T(),1);function wf(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(wf.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){}}});wf.prototype.hasProperty=function(e,t){return!1};wf.prototype.getFeature=function(e){};wf.prototype.applyDebugSettings=function(e,t){};wf.prototype.applyStyle=function(e){};wf.prototype.update=function(e,t){};wf.prototype.pick=function(e,t,n){};wf.prototype.isDestroyed=function(){return!1};wf.prototype.destroy=function(){return me(this)};var K1=wf;var s$n=_(T(),1);var $qn=_(T(),1);function Ob(e){e=e??Y.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(Ob.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ob.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Ob.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Ob.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Ob.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};Ob.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};Ob.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};Ob.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var dv=Ob;function sQ(e,t){let n=ci(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){sQ._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??Y.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new dv({content:n,class:o})}}sQ._oneTimeWarning=Vt;var _T=sQ;var d$n=_(T(),1);function v6e(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=ci(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var TT=v6e;var T$n=_(T(),1);var f$n=_(T(),1);function Bb(e){e=e??Y.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(Bb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Bb.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Bb.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Bb.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Bb.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};Bb.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};Bb.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};Bb.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var uv=Bb;function aQ(e,t){let n=ci(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){aQ._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??Y.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new uv({tile:n,class:o})}}aQ._oneTimeWarning=Vt;var mv=aQ;var O$n=_(T(),1);var G$n=_(T(),1);function w6e(e){let t=new Uint8Array(e),n=Dm(t);if(n==="glTF"&&(n="glb"),Fs.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=F6e(t);if(l(i.root))return{contentType:Fs.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Fs.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Fs.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Fs.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Fs.VOXEL_JSON,jsonPayload:i};throw new ce("Invalid tile content.")}function F6e(e){let t;try{t=Qo(e)}catch{throw new ce("Invalid tile content.")}return t}var Yb=w6e;function Ju(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=oc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(Ju.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 cQ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Rhe(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)}Ju.prototype.requestInnerContents=function(){if(!A6e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;cQ(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=M6e(this,n,t,this._tile._contentState);return N6e(this)};function A6e(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)&&!oc.serverHasOpenSlots(n,t[n]))return!1;return oc.heapHasOpenSlots(e.length)}function M6e(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Ho({throttle:!0,throttleByServer:!0,type:hs.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let d=o.fetchArrayBuffer();if(l(d))return d.then(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===$n.CANCELLED){Rhe(e,i);return}return cQ(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===$n.CANCELLED){Rhe(e,i);return}cQ(e,-1),Zhe(e,t,u)}})}async function N6e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>k6e(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(l),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function k6e(e,t,n){if(l(t))try{let i=Yb(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Fs.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Fs.GEOMETRY||i.contentType===Fs.VECTOR;let a,c=xT[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=_T(o,d));let u=TT(o,d);return l(u)&&(a.group=new k_({metadata:u})),a}catch(i){Zhe(e,n,i)}}function Zhe(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}Ju.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};Ju.prototype.hasProperty=function(e,t){return!1};Ju.prototype.getFeature=function(e){};Ju.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Ju.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Ju.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)};Ju.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let d=m.distance(e.origin,c);d<o&&(i=c,o=d)}if(l(i))return n};Ju.prototype.isDestroyed=function(){return!1};Ju.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var hv=Ju;var cei=_(T(),1);function Q1(e){this.rectangle=le.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new m,this.northeastCornerCartesian=new m,this.westNormal=new m,this.southNormal=new m,this.eastNormal=new m,this.northNormal=new m;let t=e.ellipsoid??ne.WGS84;Y6e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(Q1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});Q1.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Xn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=de.fromOrientedBoundingBox(this._orientedBoundingBox)};var Ghe=new m,dU=new m,Ehe=new m,U6e=new m,D6e=new m,O6e=new m,B6e=new m,Qu=new he,Ihe=new dn(m.UNIT_X,0),J1=new yn;function Y6e(e,t,n){n.cartographicToCartesian(le.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(le.northeast(t),e.northeastCornerCartesian),Qu.longitude=t.west,Qu.latitude=(t.south+t.north)*.5,Qu.height=0;let i=n.cartographicToCartesian(Qu,O6e),o=m.cross(i,m.UNIT_Z,U6e);m.normalize(o,e.westNormal),Qu.longitude=t.east;let r=n.cartographicToCartesian(Qu,B6e),s=m.cross(m.UNIT_Z,r,Ghe);m.normalize(s,e.eastNormal);let a=m.subtract(i,r,Ghe);m.magnitude(a)===0&&(a=m.clone(o,a));let c=m.normalize(a,D6e),d=t.south,u;if(d>0){Qu.longitude=(t.west+t.east)*.5,Qu.latitude=d;let y=n.cartographicToCartesian(Qu,J1.origin);m.clone(c,J1.direction);let x=dn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Ihe);ei.rayPlane(J1,x,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(y,dU)}else u=n.geodeticSurfaceNormalCartographic(le.southeast(t),dU);let h=m.cross(u,a,Ehe);m.normalize(h,e.southNormal);let p=t.north,g;if(p<0){Qu.longitude=(t.west+t.east)*.5,Qu.latitude=p;let y=n.cartographicToCartesian(Qu,J1.origin);m.negate(c,J1.direction);let x=dn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Ihe);ei.rayPlane(J1,x,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,dU)}else g=n.geodeticSurfaceNormalCartographic(le.northwest(t),dU);let f=m.cross(a,g,Ehe);m.normalize(f,e.northNormal)}var z6e=new m,H6e=new m,K6e=new m(0,-1,0),J6e=new m(0,0,-1),Xhe=new m;function Q6e(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!le.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,g=e.eastNormal,f=e.northNormal;t.mode!==oe.SCENE3D&&(d=t.mapProjection.project(le.southwest(e.rectangle),z6e),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(le.northeast(e.rectangle),H6e),u.z=u.y,u.y=u.x,u.x=0,h=K6e,g=m.UNIT_Y,p=J6e,f=m.UNIT_Z);let y=m.subtract(i,d,Xhe),x=m.dot(y,h),S=m.dot(y,p),C=m.subtract(i,u,Xhe),V=m.dot(C,g),L=m.dot(C,f);x>0?r+=x*x:V>0&&(r+=V*V),S>0?r+=S*S:L>0&&(r+=L*L)}let s,a,c;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let d=s-c;r+=d*d}else if(s<a){let d=a-s;r+=d*d}return Math.sqrt(r)}Q1.prototype.distanceToCamera=function(e){let t=Q6e(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};Q1.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};Q1.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new s_({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Xt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}});return new Wn({geometryInstances:i,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var Fd=Q1;var Lei=_(T(),1);var uU=new he;function fv(e){let t=$p.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??ne.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=rqe(t,n,i,o);this._boundingPlanes=r;let s=lqe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=bQ(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=m.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=bQ(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=bQ(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();uU=o.cartesianToCartographic(c,uU),uU.height=(i+n)/2,this.center=o.cartographicToCartesian(uU,c),this._boundingSphere=de.fromPoints(s)}var j6e=new m,q6e=new he,$6e=new m,eqe=new he,tqe=new m,nqe=new m,iqe=new m,oqe=new m;function rqe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,j6e),a=i.cartesianToCartographic(r,q6e);a.height=n;let c=i.cartographicToCartesian(a,$6e),d=dn.fromPointNormal(c,s);o[0]=d;let u=0,h,p=[],g,f;for(h=0;h<4;h++){g=e.getVertex(h),p[h]=g,f=i.cartesianToCartographic(g,eqe),f.height=t;let x=dn.getPointDistance(d,i.cartographicToCartesian(f,tqe));x<u&&(u=x)}let y=dn.clone(d);for(y.normal=m.negate(y.normal,y.normal),y.distance=y.distance*-1+u,o[1]=y,h=0;h<4;h++){g=p[h];let x=p[(h+1)%4],S=i.geodeticSurfaceNormal(g,nqe),C=m.subtract(x,g,oqe),V=m.cross(C,S,iqe);V=m.normalize(V,V),o[2+h]=dn.fromPointNormal(g,V)}return o}var ST=new m,CT=new m,VT=new m,lQ=new m,dQ=new m,uQ=new m,sqe=new m,aqe=new m,cqe=new m,mQ=new m,hQ=new m,fQ=new m,iy=new m,Ff=new $;function Whe(e,t,n){ST=e.normal,CT=t.normal,VT=n.normal,lQ=m.multiplyByScalar(e.normal,-e.distance,lQ),dQ=m.multiplyByScalar(t.normal,-t.distance,dQ),uQ=m.multiplyByScalar(n.normal,-n.distance,uQ),mQ=m.multiplyByScalar(m.cross(CT,VT,sqe),m.dot(lQ,ST),mQ),hQ=m.multiplyByScalar(m.cross(VT,ST,aqe),m.dot(dQ,CT),hQ),fQ=m.multiplyByScalar(m.cross(ST,CT,cqe),m.dot(uQ,VT),fQ),Ff[0]=ST.x,Ff[1]=CT.x,Ff[2]=VT.x,Ff[3]=ST.y,Ff[4]=CT.y,Ff[5]=VT.y,Ff[6]=ST.z,Ff[7]=CT.z,Ff[8]=VT.z;let i=$.determinant(Ff);return iy=m.add(mQ,hQ,iy),iy=m.add(iy,fQ,iy),new m(iy.x/i,iy.y/i,iy.z/i)}function lqe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Whe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Whe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var pQ=new m,j1=new m;function bQ(e,t){let n=[];for(let i=0;i<4;i++)pQ=m.subtract(t[(i+1)%4],t[i],pQ),j1=m.cross(e.normal,pQ,j1),j1=m.normalize(j1,j1),n[i]=m.clone(j1);return n}Object.defineProperties(fv.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var gQ=new m;fv.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;dn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):dn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,dn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=yQ(dn.projectPointOntoPlane(c,t,gQ),i[0],c,o),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Phe(t,p[0],p[1]),m.distance(a,t)}let u=Number.MAX_VALUE,h;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=yQ(dn.projectPointOntoPlane(c,t,gQ),i[r],c,this._edgeNormals[n[r]]),h=m.distanceSquared(a,t),h<u&&(u=h);return Math.sqrt(u)}else if(n.length>3)return a=yQ(dn.projectPointOntoPlane(this._boundingPlanes[1],t,gQ),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+d)%4]):m.distance(t,this._vertices[4+(n[1]-2+d)%4])};var dqe=new m,uqe=new m;function Phe(e,t,n){let i=m.subtract(n,t,dqe),o=m.subtract(e,t,uqe),r=m.dot(i,o);if(r<=0)return t;let s=m.dot(i,i);return r>=s?n:(r=r/s,new m((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var mqe=new dn(m.UNIT_X,0);function yQ(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let d=dn.fromPointNormal(t[c],i[c],mqe);dn.getPointDistance(d,e)<0||(a=Phe(e,t[c],t[(c+1)%4]),r=m.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}fv.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)m.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Jt.INSIDE:n===this._vertices.length?Jt.OUTSIDE:Jt.INTERSECTING};fv.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new Vu({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Vu.createGeometry(n),o=new Xt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}}),r=new Vu({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Vu.createGeometry(r),a=new Xt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}}),c=[];for(let d=0;d<4;d++){let u=new Vu({polygonHierarchy:{positions:this._planeVertices[2+d]}}),h=Vu.createGeometry(u);c[d]=new Xt({geometry:h,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}})}return new Wn({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var pv=fv;var Fei=_(T(),1);function q1(e,t){t===0&&(t=X.EPSILON7),this._boundingSphere=new de(e,t)}Object.defineProperties(q1.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}}});q1.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,m.distance(t.center,e.camera.positionWC)-t.radius)};q1.prototype.intersectPlane=function(e){return de.intersectPlane(this._boundingSphere,e)};q1.prototype.update=function(e,t){m.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};q1.prototype.createDebugVolume=function(e){let t=new eb({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new Xt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Kt.fromColor(e)}});return new Wn({geometryInstances:i,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var zb=q1;var Jei=_(T(),1);var hqe=new m,fqe=new m,pqe=new m,bqe=new m;function LT(e,t,n){n=m.cross(e,t,n);let i=m.magnitude(n);return m.multiplyByScalar(n,X.EPSILON7/i,n)}function xQ(e,t){let n=m.normalize(e,bqe),i=m.equalsEpsilon(n,m.UNIT_X,X.EPSILON6)?m.UNIT_Y:m.UNIT_X;return LT(e,i,t)}function vhe(e){let t=$.getColumn(e,0,hqe),n=$.getColumn(e,1,fqe),i=$.getColumn(e,2,pqe),o=m.equals(t,m.ZERO),r=m.equals(n,m.ZERO),s=m.equals(i,m.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=X.EPSILON7,e[4]=X.EPSILON7,e[8]=X.EPSILON7,e):(o&&!r&&!s?t=LT(n,i,t):!o&&r&&!s?n=LT(t,i,n):!o&&!r&&s?i=LT(n,t,i):o?r?s||(t=xQ(i,t),n=LT(i,t,n)):(t=xQ(n,t),i=LT(n,t,i)):(n=xQ(t,n),i=LT(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function $1(e,t){t=vhe(t),this._orientedBoundingBox=new Xn(e,t),this._boundingSphere=de.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties($1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});$1.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};$1.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};$1.prototype.update=function(e,t){m.clone(e,this._orientedBoundingBox.center),t=vhe(t),$.clone(t,this._orientedBoundingBox.halfAxes),de.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};$1.prototype.createDebugVolume=function(e){let t=new vm({minimum:new m(-1,-1,-1),maximum:new m(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Xt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Kt.fromColor(e)}});return new Wn({geometryInstances:i,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})};var zl=$1;function nr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||ci(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=F.multiply(a,this.transform,new F),d=l(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(d,this.transform,new F),this.computedTransform=c,this.metadata=mv(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let u;l(s)&&l(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let h;l(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,nr._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")&&nr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Do.REPLACE:Do.ADD):l(i)?p=i.refine:p=Do.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,f=!1,y,x,S;if(t=Re.createIfNeeded(t),r)y=Bo.UNLOADED,x=t.clone();else if(l(s)){let Z=s.uri;l(s.url)&&(nr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),Z=s.url),Z===""?(nr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new K1(e,this),f=!0,y=Bo.READY):(y=Bo.UNLOADED,x=t.getDerivedResource({url:Z}),S=oc.getServerKey(x.getUrlComponent()))}else g=new K1(e,this),f=!0,y=Bo.READY;this._content=g,this._contentResource=x,this._contentState=y,this._expiredContent=void 0,this._serverKey=S,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!f,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let C=n.expire,V,L;l(C)&&(V=C.duration,l(C.date)&&(L=q.fromIso8601(C.date))),this.expireDuration=V,this.expireDate=L,this.lastStyleTime=0,this._optimChildrenWithinParent=Ku.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=D.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new q,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}nr._deprecationWarning=Is;Object.defineProperties(nr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return this._contentBoundingVolume??this._boundingVolume}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new D),D.clone(this._color)},set:function(e){this._color=D.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Bo.READY}},contentUnloaded:{get:function(){return this._contentState===Bo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Bo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Bo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var oy=new m;function gqe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,oy),c=m.add(s.positionWC,a,oy),d=m.subtract(c,r,oy);if(m.magnitude(d)>o){let L=m.normalize(d,oy),Z=m.multiplyByScalar(L,o,oy),E=m.add(r,Z,oy),P=m.subtract(E,s.positionWC,oy),W=m.normalize(P,oy);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,W))}else e._foveatedFactor=0;let p=e.refine===Do.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Fo.PRELOAD_FLIGHT||n._pass===Fo.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*f;if(e._foveatedFactor<=y)return!1;let x=f-y,S=X.clamp((e._foveatedFactor-y)/x,0,1),C=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,S),V=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-C<=V}var Nhe=new q;nr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,d=a.frustum,u=c.drawingBufferWidth,h=c.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||d instanceof un){let g=d.offCenterFrustum;l(g)&&(d=g);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,h);p=s/f}else{let g=Math.max(this._distanceToCamera,X.EPSILON7),f=d.sseDenominator;if(p=s*h/(g*f),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,x=i.dynamicScreenSpaceErrorFactor,S=X.fog(g,y)*x;p-=S}}return p/=e.pixelRatio,p};function yqe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function xqe(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}nr.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:bs.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!==bs.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=xqe(n,this),this._priorityProgressiveResolution=yqe(n,this),this.priorityDeferred=gqe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};nr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=q.now(Nhe);q.lessThan(this.expireDate,e)&&(this._contentState=Bo.EXPIRED,this._expiredContent=this._content)}};function _qe(e){if(!l(e.expireDuration))return;let t=q.now(Nhe);q.addSeconds(t,e.expireDuration,t),l(e.expireDate)?q.lessThan(e.expireDate,t)&&q.clone(t,e.expireDate):e.expireDate=q.clone(t)}function Tqe(e){return function(){return e._priority}}nr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Sqe(this):Vqe(this)};function Sqe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ci(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new hv(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Bo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Bo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Bo.FAILED,o})}async function Cqe(e,t,n,i,o){let r=e._contentState;e._contentState=Bo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===$n.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Bo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===$n.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await Lqe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Bo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Bo.FAILED,a}}function Vqe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Ho({throttle:!0,throttleByServer:!0,type:hs.TILES3D,priorityFunction:Tqe(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 Cqe(e,o,i,n,r)}async function Lqe(e,t){let n=Yb(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Fs.GEOMETRY||n.contentType===Fs.VECTOR,(n.contentType===Fs.IMPLICIT_SUBTREE||n.contentType===Fs.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===Fs.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=xT[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,d=e.implicitCoordinates;o.metadata=c.getContentMetadataView(d,0)}else e.hasImplicitContent||(o.metadata=_T(i,s));let a=TT(i,s);return l(a)&&(o.group=new k_({metadata:a})),o}nr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};nr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Bo.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 khe=new de;function TQ(e,t){if(t.mode!==oe.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=de.projectTo2D(n,t.mapProjection,khe);e._boundingVolume2D=new zb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Rqe(e,t){if(t.mode!==oe.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=de.projectTo2D(n,t.mapProjection,khe);e._contentBoundingVolume2D=new zb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}nr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=TQ(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Jt.INSIDE,a===Jt.OUTSIDE)return bs.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Jt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};nr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Jt.INSIDE;if(this._visibilityPlaneMask===bs.MASK_INSIDE)return Jt.INSIDE;let t=e.cullingVolume,n=Rqe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Jt.INSIDE,s===Jt.OUTSIDE)return Jt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Jt.OUTSIDE,s===Jt.INSIDE)return Jt.OUTSIDE}return t.computeVisibility(n)};nr.prototype.distanceToTile=function(e){return TQ(this,e).distanceToCamera(e)};var Zqe=new m;nr.prototype.distanceToTileCenter=function(e){let n=TQ(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,Zqe);return m.dot(e.camera.directionWC,i)};nr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Uhe=new $,Dhe=new m,Gqe=new $,SQ=new m,Ohe=new le,Bhe=new Xn,_Q=new F;function Eqe(e,t,n){let i=m.fromElements(e[0],e[1],e[2],SQ),o=$.fromArray(e,3,Gqe);i=F.multiplyByPoint(t,i,i);let r=F.getMatrix3(t,Uhe);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new zl(i,o)}function whe(e,t,n,i){let o=le.unpack(e,0,Ohe),r=e[4],s=e[5],a=Xn.fromRectangle(o,r,s,ne.WGS84,Bhe),c=a.center,d=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,_Q),_Q),c=F.multiplyByPoint(t,c,c);let u=F.getMatrix3(t,Uhe);return d=$.multiply(u,d,d),l(i)&&i instanceof zl?(i.update(c,d),i):new zl(c,d)}function Iqe(e,t,n,i){if(!F.equalsEpsilon(t,n,X.EPSILON8))return i instanceof zl?whe(e,t,n,i):whe(e,t,n,void 0);let o=le.unpack(e,0,Ohe);return i instanceof Fd?(i.rectangle=le.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ne.WGS84),i):new Fd({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function Xqe(e,t,n){let i=m.fromElements(e[0],e[1],e[2],SQ),o=e[3];i=F.multiplyByPoint(t,i,i);let r=F.getScale(t,Dhe),s=m.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new zb(i,o)}nr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=iT.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ce("boundingVolume must be defined");if(ci(e,"3DTILES_bounding_volume_S2"))return new pv(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=Eqe(r,t,n);return this._verticalExaggeration!==1&&Fhe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=Iqe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof zl?Fhe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Zr.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Zr.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ne.WGS84))),c}if(l(a)){let c=Xqe(a,t,n);if(this._verticalExaggeration!==1){let d=Zr.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,SQ),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new ce("boundingVolume must contain a sphere, region, or box")};var Wqe=m.unpackArray(new Array(8*3).fill(0));function Fhe(e,t,n){let i=e.boundingVolume.computeCorners(Wqe).map(r=>Zr.getPosition(r,ne.WGS84,t,n,r)),o=Xn.fromPoints(i,Bhe);e.update(o.center,o.halfAxes)}nr.prototype.updateTransform=function(e,t){e=e??F.IDENTITY;let n=F.multiplyTransformation(e,this.transform,_Q),i=!F.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&F.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};nr.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,Dhe),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Pqe(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=D.WHITE:c=D.DARKGRAY:c=D.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=Kt.toValue(c,d.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(D.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(D.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=D.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function vqe(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=Bo.FAILED,o}}function wqe(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 Fqe(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)}nr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;wqe(this,e),Fqe(this,e),Pqe(this,e,t,n),vqe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===Ge.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var Ahe=[];nr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(_qe(this),this._selectedFrame=0,this.lastStyleTime=0,q.now(this._loadTimestamp),this._contentState=Bo.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=Ahe;try{this._content.update(e,t)}catch(i){throw this._contentState=Bo.FAILED,i}Ahe.length=0,t.commandList=n};function Mhe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function mU(e,t,n){return Math.max(X.normalize(e,t,n)-X.EPSILON7,0)}nr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,d=o,u=c+d,h=r,p=Math.pow(10,u),g=u+h,f=r,y=Math.pow(10,g),x=g+f,S=Math.pow(10,x),C=mU(this._depth,n.depth,i.depth);C=t?1-C:C;let L=!e.isSkippingLevelOfDetail&&this.refine===Do.REPLACE?mU(this._priorityHolder._distanceToCamera,n.distance,i.distance):mU(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),Z=Mhe(L,a,s),E=this._priorityProgressiveResolution?0:p,P=mU(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),W=Mhe(P,d,c),v=this.priorityDeferred?y:0,A=e._pass===Fo.PRELOAD_FLIGHT?0:S;this._priority=C+Z+E+W+v+A};nr.prototype.isDestroyed=function(){return!1};nr.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(),me(this)};var ju=nr;var oni=_(T(),1);var Hti=_(T(),1);function Hb(e){e=e??Y.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(Hb.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}}});Hb.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Hb.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Hb.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Hb.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};Hb.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};Hb.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};Hb.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var eV=Hb;var qti=_(T(),1);function Kb(e){e=e??Y.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(Kb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Kb.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Kb.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Kb.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Kb.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};Kb.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};Kb.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};Kb.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var bv=Kb;function Yhe(e){e=e??Y.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new bv({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let d=0;d<c;d++){let u=a[d];s.push(new eV({group:u,class:n.classes[u.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let d=0;d<c;d++){let u=r[d];if(a.hasOwnProperty(u)){let h=a[u];s.push(new eV({id:u,group:a[u],class:n.classes[h.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Yhe.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 RT=Yhe;var dni=_(T(),1);var zhe={},Aqe=new m;zhe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof zl||i instanceof Fd){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Ku.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof zl||a instanceof Fd)){e._optimChildrenWithinParent=Ku.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=m.subtract(c.center,o.center,Aqe),u=m.magnitude(d);m.divideByScalar(d,u,d);let h=Math.abs(o.halfAxes[0]*d.x)+Math.abs(o.halfAxes[1]*d.y)+Math.abs(o.halfAxes[2]*d.z)+Math.abs(o.halfAxes[3]*d.x)+Math.abs(o.halfAxes[4]*d.y)+Math.abs(o.halfAxes[5]*d.z)+Math.abs(o.halfAxes[6]*d.x)+Math.abs(o.halfAxes[7]*d.y)+Math.abs(o.halfAxes[8]*d.z),p=Math.abs(c.halfAxes[0]*d.x)+Math.abs(c.halfAxes[1]*d.y)+Math.abs(c.halfAxes[2]*d.z)+Math.abs(c.halfAxes[3]*d.x)+Math.abs(c.halfAxes[4]*d.y)+Math.abs(c.halfAxes[5]*d.z)+Math.abs(c.halfAxes[6]*d.x)+Math.abs(c.halfAxes[7]*d.y)+Math.abs(c.halfAxes[8]*d.z);if(h<=p+u){e._optimChildrenWithinParent=Ku.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Ku.USE_OPTIMIZATION};var gv=zhe;var fni=_(T(),1);function ZT(){this._list=new jE,this._sentinel=this._list.add(),this._trimTiles=!1}ZT.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};ZT.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};ZT.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};ZT.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};ZT.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};ZT.prototype.trim=function(){this._trimTiles=!0};var yv=ZT;var _ni=_(T(),1);function hU(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 VQ(e,t){let n;return t==="_loadTimestamp"?n=q.toDate(e).getTime():n=e,n}hU.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=VQ(e,n),this._referenceMaximum[n]=VQ(t,n)};function Mqe(e,t){let n=e.tilePropertyName;if(l(n)){let i=VQ(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 CQ=[new D(.1,.1,.1,1),new D(.153,.278,.878,1),new D(.827,.231,.49,1),new D(.827,.188,.22,1),new D(1,.592,.259,1),new D(1,.843,0,1)];hU.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Mqe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+X.EPSILON7,c=X.clamp(i-o,0,s)/s,d=CQ.length-1,u=c*d,h=Math.floor(u),p=Math.ceil(u),g=u-h,f=CQ[h],y=CQ[p],x=D.clone(D.WHITE);x.red=X.lerp(f.red,y.red,g),x.green=X.lerp(f.green,y.green,g),x.blue=X.lerp(f.blue,y.blue,g),e._debugColor=x};hU.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 xv=hU;var Vni=_(T(),1);function tV(){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}tV.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};tV.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])}};tV.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Pd))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])}};tV.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Pd))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])}};tV.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 xh=tV;var Zni=_(T(),1);function _v(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(_v.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});_v.prototype.makeDirty=function(){this._styleDirty=!0};_v.prototype.resetDirty=function(){this._styleDirty=!1};_v.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var Tv=_v;var wni=_(T(),1);function Nqe(e,t,n){let i=ci(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)&&!ci(o,"3DTILES_bounding_volume_S2")&&!ci(o,"3DTILES_bounding_volume_cylinder"))throw new ce("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 Re({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=kqe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Be(a,!0));let c=new Re({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Uqe(t),this.subdivisionScheme=os[i.subdivisionScheme],this.branchingFactor=os.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function kqe(e){if(ci(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 Uqe(e){let t=Be(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 GT=Nqe;var kni=_(T(),1);function Yo(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===os.OCTREE&&(this.z=e.z)}Object.defineProperties(Yo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===os.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===os.OCTREE?fg.encode3D(this.x,this.y,this.z):fg.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===os.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Yo.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===os.OCTREE){let o=(this.z<<e.level)+e.z;return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Yo.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===os.OCTREE){let r=Math.floor(this.z/t);return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Yo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===os.OCTREE){let r=e.z%n;return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Yo.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===os.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Yo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Yo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Yo.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===os.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Yo.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===os.OCTREE?this.z===e.z:!0)};Yo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Yo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Yo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Yo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===os.OCTREE&&(e.z=this.z),e};var Hhe=[0,0,0];Yo.fromMortonIndex=function(e,t,n,i){let o;return e===os.OCTREE?(o=fg.decode3D(i,Hhe),new Yo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=fg.decode2D(i,Hhe),new Yo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Yo.fromTileIndex=function(e,t,n){let i,o,r;return e===os.OCTREE?(i=Math.floor(X.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(X.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Yo.fromMortonIndex(e,t,i,r)};var ET=Yo;var $ni=_(T(),1);var Hni=_(T(),1);function Jb(){}Jb.selectTiles=function(e,t){fe.throwInstantiationError()};Jb.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Jb.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Jb.selectTile=function(e,t){if(e.contentVisibility(t)===Jt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};Jb.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Jb.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Jb.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Dqe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Dqe(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}Jb.updateTile=function(e,t){Khe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Yqe(e),e._shouldSelect=!1,e._finalResolution=!0};function Khe(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];Khe(r,t),e._visible=r._visible;return}if(Oqe(e,t)){e._visible=!1;return}let i=e.refine===Do.REPLACE,o=e._optimChildrenWithinParent===Ku.USE_OPTIMIZATION;if(i&&o&&n&&!Bqe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function Oqe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Do.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function Bqe(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 Yqe(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 ia=Jb;function Jhe(){}var Sv={stack:new qc,stackMaximumLength:0};Jhe.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}=ia,s=Sv.stack;for(s.push(i);s.length>0;){Sv.stackMaximumLength=Math.max(Sv.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Do.ADD,d=a.refine===Do.REPLACE,u=zqe(a);u&&Hqe(a,s,t),(c||d&&!u)&&(Kqe(e,a),o(a,t),Jqe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return Sv.stack.trim(Sv.stackMaximumLength),n};function zqe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function Hqe(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 Kqe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Jqe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Jt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var Cv=Jhe;var rii=_(T(),1);function Qhe(){}var Vv={stack:new qc,stackMaximumLength:0},Lv={stack:new qc,stackMaximumLength:0};Qhe.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(ia.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;jqe(n,t),Vv.stack.trim(Vv.stackMaximumLength),Lv.stack.trim(Lv.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function LQ(e,t){e.contentAvailable&&ia.selectTile(e,t)}function Qqe(e,t,n){let i=e.refine===Do.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=ia;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(ia.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,h=!1,p=-1,g=Number.MAX_VALUE;for(let f=0;f<r.length;++f){let y=r[f];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=f,g=y._foveatedFactor),h=!0):(d||o.loadSiblings)&&(y._foveatedFactor<g&&(p=f,g=y._foveatedFactor),a(y,n),c(y,n)),d){let x;y._inRequestVolume?y.hasRenderableContent?x=y.contentAvailable:x=qqe(y,n):x=!1,u=u&&x}}if(h||(u=!1),p!==-1&&i){let f=r[p];f._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(f._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(f._distanceToCamera,y._distanceToCamera);for(let x=0;x<r.length;++x)r[x]._priorityHolder=y}return u}function jqe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=ia,a=Vv.stack;for(a.push(e);a.length>0;){Vv.stackMaximumLength=Math.max(Vv.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?Qqe(c,a,t)&&u:!1;let h=!c._refines&&u;c.hasRenderableContent?c.refine===Do.ADD?(LQ(c,t),o(c,t)):c.refine===Do.REPLACE&&(o(c,t),h&&LQ(c,t)):(n._emptyTiles.push(c),o(c,t),h&&LQ(c,t)),r(c,t),s(c,t)}}function qqe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=ia,s=!0,a=Lv.stack;for(a.push(e);a.length>0;){Lv.stackMaximumLength=Math.max(Lv.stackMaximumLength,a.length);let c=a.pop(),d=c.children,u=d.length,h=!c.hasRenderableContent&&n(c);if(!h&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),h)for(let p=0;p<u;++p){let g=d[p];a.push(g)}}return e.hasEmptyContent||s}var Rv=Qhe;var uii=_(T(),1);function jhe(){}var Zv={stack:new qc,stackMaximumLength:0},Gv={stack:new qc,stackMaximumLength:0},Qb={stack:new qc,stackMaximumLength:0,ancestorStack:new qc,ancestorStackMaximumLength:0},$qe=2;jhe.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(ia.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;r$e(n,t),s$e(n,t),Zv.stack.trim(Zv.stackMaximumLength),Gv.stack.trim(Gv.stackMaximumLength),Qb.stack.trim(Qb.stackMaximumLength),Qb.ancestorStack.trim(Qb.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function e$e(e,t){let{updateTile:n,touchTile:i,selectTile:o}=ia,r=Gv.stack;for(r.push(e);r.length>0;){Gv.stackMaximumLength=Math.max(Gv.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let d=a[c];d.isVisible&&(d.contentAvailable?(n(d,t),i(d,t),o(d,t)):d._depth-e._depth<$qe&&r.push(d))}}}function fU(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:e$e(e,t)}function t$e(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 n$e(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 i$e(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=ia;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(ia.sortChildrenByDistanceToCamera);let c=!1;for(let d=0;d<o.length;++d){let u=o[d];u.isVisible?(t.push(u),c=!0):i.loadSiblings&&(s(u,n),a(u,n))}return c}function o$e(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 r$e(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=ia,c=Zv.stack;for(c.push(e);c.length>0;){Zv.stackMaximumLength=Math.max(Zv.stackMaximumLength,c.length);let d=c.pop();t$e(d,t);let u=d.parent,h=!l(u)||u._refines;d._refines=o(d)?i$e(d,c,t)&&h:!1;let p=!d._refines&&h;d.hasRenderableContent?d.refine===Do.ADD?(fU(d,t),r(d,t)):d.refine===Do.REPLACE&&(o$e(d,i)?(r(d,t),p&&fU(d,t)):p?(fU(d,t),r(d,t)):n$e(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&fU(d,t)),s(d,t),a(d,t)}}function s$e(e,t){let{selectTile:n,canTraverse:i}=ia,{stack:o,ancestorStack:r}=Qb,s;for(o.push(e);o.length>0||r.length>0;){if(Qb.stackMaximumLength=Math.max(Qb.stackMaximumLength,o.length),Qb.ancestorStackMaximumLength=Math.max(Qb.ancestorStackMaximumLength,r.length),r.length>0){let d=r.peek();if(d._stackLength===o.length){r.pop(),d!==s&&(d._finalResolution=!1),n(d,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Do.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let d=a.children;for(let u=0;u<d.length;++u){let h=d[u];h.isVisible&&o.push(h)}}}}var Ev=jhe;function ir(e){e=e??Y.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 yv,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 qc,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 Tv,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._addHeightCallbacks=[],this._statistics=new xh,this._statisticsLast=new xh,this._statisticsPerPass=new Array(Fo.NUMBER_OF_PASSES);for(let o=0;o<Fo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new xh;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 xv(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=X.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=e.ellipsoid??ne.WGS84,this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??X.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??Cn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Al.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Ef(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Rb,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be,this.tileLoad=new be,this.tileUnload=new be,this.tileFailed=new be,this.tileVisible=new be,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)&&ys.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&oh.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new N_,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Cb(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??D.BLACK,this.splitDirection=e.splitDirection??Br.NONE,this.enableCollision=e.enableCollision??!1,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&Vt("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){ys.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){oh.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Is("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},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,rfe(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 hd.fromAssetId(e);return ir.fromUrl(n,t)};ir.fromUrl=async function(e,t){t=t??Y.EMPTY_OBJECT;let n=Re.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await ir.loadJson(n),r=await a$e(n,o),s=new ir(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,rfe(s);let c=l(o.asset.gltfUpAxis)?vo.fromName(o.asset.gltfUpAxis):vo.Y,d=t.modelUpAxis??c,u=t.modelForwardAxis??vo.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=d,s._modelForwardAxis=u,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,F.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>ui._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Ft.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s};ir.loadJson=function(e){return Re.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 ce("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ce("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&ir.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=qhe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Do.ADD;let d=c._header.children;if(l(d))for(let u=0;u<d.length;++u){let h=d[u],p=qhe(this,e,h,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&gv.checkChildrenWithinParent(c)}return s};function qhe(e,t,n,i){if(!(l(n.implicitTiling)||ci(n,"3DTILES_implicit_tiling")))return new ju(e,t,n,i);let r=e.schema,s=new GT(t,n,r),a=new ET({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=Be(n,!0);u.contents=[{uri:c}],delete u.content,delete u.extensions;let h=new ju(e,t,u,i);return h.implicitTileset=s,h.implicitCoordinates=a,h}async function a$e(e,t){let n=ci(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Li.getSchemaLoader({resource:e});else if(l(n.schema))i=Li.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new RT({schema:i.schema,metadataJson:n});return Li.unload(i),o}var $he=new m,c$e=new he,l$e=new F,d$e=new m,u$e=new m,m$e=new m,h$e=new m;function f$e(e,t){let n,i,o,r,s,a=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof Fd)n=m.normalize(a.positionWC,$he),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let y=F.inverseTransformation(c.computedTransform,l$e),x=t.mapProjection.ellipsoid,S=d.boundingVolume,C=F.multiplyByPoint(y,S.center,d$e);if(m.magnitude(C)>x.minimumRadius){let V=he.fromCartesian(C,x,c$e);n=m.normalize(a.positionWC,$he),i=a.directionWC,o=a.positionCartographic.height,r=0,s=V.height*2}else{let V=F.multiplyByPoint(y,a.positionWC,u$e);if(n=m.UNIT_Z,i=F.multiplyByPointAsVector(y,a.directionWC,m$e),i=m.normalize(i,i),o=V.z,d instanceof zl){let L=$.getColumn(S.halfAxes,2,h$e),Z=m.magnitude(L);r=C.z-Z,s=C.z+Z}else if(d instanceof zb){let L=S.radius;r=C.z-L,s=C.z+L}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*u,p=s,g=X.clamp((o-h)/(p-h),0,1),f=1-Math.abs(m.dot(i,n));f=f*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function p$e(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=>{nfe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?E$e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function tfe(e,t){return e._priority-t._priority}ir.prototype.postPassesUpdate=function(e){l(this._root)&&(b$e(this,e),X$e(this,e),this._cache.unloadTiles(this,ofe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};ir.prototype.prePassesUpdate=function(e){if(!l(this._root))return;C$e(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=q.clone(e.time)),this._timeSinceLoad=Math.max(q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&f$e(this,e),e.newFrame&&this._cache.reset()};function b$e(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==Bo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function g$e(e){let t=e._requestedTiles;t.sort(tfe);for(let n=0;n<t.length;++n)p$e(e,t[n])}function nfe(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 y$e(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Bo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var x$e=new he,_$e=new he,T$e=new m;function S$e(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=he.clone(r.positionCartographic,x$e),c=he.fromCartesian(o.center,s,_$e);l(c)&&(a.height=c.height);let d=he.toCartesian(a,s,T$e);m.distance(d,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{l(r.callback)&&r.callback(),r.invoked=!1}))}}function C$e(e,t){y$e(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let d=n[c];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,nfe(u,e,d)}}e.totalMemoryUsageInBytes<i?L$e(e):a&&n.length>0&&V$e(e)}function V$e(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(tfe)}function L$e(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var pU=new m,R$e={maximumFractionDigits:3};function efe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,R$e):Math.round(t).toLocaleString()}function RQ(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=m.clone(i,pU);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=m.normalize(i,pU);r=m.multiplyByScalar(r,.75*n,pU),o=m.add(r,i,pU)}return o}function ZQ(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: ${efe(e.content.texturesByteLength)}`,i+=`
|
|
|
Geometry Memory: ${efe(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
|
|
|
Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=`
|
|
|
- ${s[a]}`;o+=s.length}else i+=`
|
|
|
Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function Z$e(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:RQ(e.debugPickedTile),a=ZQ(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];ZQ(a,e,RQ(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&ZQ(a,e,RQ(a))}}e._tileDebugLabels.update(t)}function G$e(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ii({stencil:0,pass:Ge.CESIUM_3D_TILE,renderState:Ue.fromCache({stencilMask:Yt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:d}=e,u=n.isRender,h=i.length;for(let f=0;f<s.length;++f){let y=s[f];u&&d.raiseEvent(y),S$e(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let f=0;f<p.length;++f)p[f].update(e,t,n);let g=i.length-h;if(e._backfaceCommands.trim(),a){let f=e._backfaceCommands.values,y=f.length;i.length+=y;for(let x=g-1;x>=0;--x)i[h+y+x]=i[h+x];for(let x=0;x<y;++x)i[h+x]=f[x]}g=i.length-r,c.numberOfCommands=g,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Pf),Z$e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var ife=[];function E$e(e,t){let n=t,i=ife;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&&(I$e(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function ofe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function I$e(e,t){e._cache.unloadTile(e,t,ofe),t.destroy()}ir.prototype.trimLoadedTiles=function(){this._cache.trim()};function X$e(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;xh.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function W$e(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function P$e(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function v$e(e,t,n,i){if(t.mode===oe.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,W$e(e),P$e(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&g$e(e),G$e(e,t,i),xh.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function rfe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Gt.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 Gt(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===Fo.MOST_DETAILED_PRELOAD||t===Fo.MOST_DETAILED_PICK?Cv:this.isSkippingLevelOfDetail?Ev:Rv};ir.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};ir.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Fo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Fo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Fo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Fo.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,d=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let u=this._clippingPolygons;l(u)&&u.enabled&&u.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=v$e(this,e,h,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};ir.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};ir.prototype.isDestroyed=function(){return!1};ir.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=ife;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,me(this)};ir.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};ir.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!ir.supportedExtensions[e[t]])throw new ce(`Unsupported 3D Tiles Extension: ${e[t]}`)};var w$e=new yn,F$e=new m,A$e=new he;ir.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ne.WGS84);let i=w$e,o=n.cartographicToCartesian(e,i.direction);m.normalize(i.direction,i.direction),i.direction=m.normalize(o,i.direction),i.direction=m.negate(o,i.direction),i.origin=m.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,F$e);if(l(r))return n.cartesianToCartographic(r,A$e)?.height};ir.prototype.updateHeight=function(e,t,n){n=n??ne.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var M$e=new Pa,N$e=new m;ir.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let d=i[c],u=ei.raySphere(e,d.contentBoundingVolume.boundingSphere,M$e);!l(u)||!l(d.content)||r.push(d)}let s=r.length;r.sort((c,d)=>{let u=de.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),h=de.distanceSquaredTo(d.contentBoundingVolume.boundingSphere,e.origin);return u-h});let a;for(let c=0;c<s;++c){let u=r[c].content.pick(e,t,N$e);if(l(u))return a=m.clone(u,n),a}};var Ts=ir;var k$e=new F;function ry(e,t){t.collectionChanged.addEventListener(ry.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new It,this._onCollectionChanged(t,t.values,[],[])}ry.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),h;u&&(h=s.computeModelMatrix(e,k$e),c=Re.createIfNeeded(J.getValueOrUndefined(a._uri,e)));let p=l(d)?d.tilesetPrimitive:void 0;if(!u){l(p)&&(p.show=!1);continue}(!l(d)||c.url!==d.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],U$e(c,n,s,i)),l(p)&&(p.show=!0,l(h)&&(p.modelMatrix=h),p.maximumScreenSpaceError=J.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};ry.prototype.isDestroyed=function(){return!1};ry.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ry.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)GQ(this,e[i],t,n);return me(this)};ry.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return ut.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(de.clone(i.boundingSphere,t),ut.DONE):ut.FAILED:ut.PENDING};ry.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(GQ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],GQ(this,r,a,c),s.remove(r.id)};function GQ(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function U$e(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await Ts.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 Iv=ry;var Ooi=_(T(),1);var D$e=D.WHITE,O$e=D.BLACK,B$e=new U(2,2);function nV(e){e=e??Y.EMPTY_OBJECT,this._definitionChanged=new be,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(nV.prototype,{isConstant:{get:function(){return J.isConstant(this._evenColor)&&J.isConstant(this._oddColor)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:ue("evenColor"),oddColor:ue("oddColor"),repeat:ue("repeat")});nV.prototype.getType=function(e){return"Checkerboard"};var Y$e=new q;nV.prototype.getValue=function(e,t){return l(e)||(e=q.now(Y$e)),l(t)||(t={}),t.lightColor=J.getValueOrClonedDefault(this._evenColor,e,D$e,t.lightColor),t.darkColor=J.getValueOrClonedDefault(this._oddColor,e,O$e,t.darkColor),t.repeat=J.getValueOrDefault(this._repeat,e,B$e),t};nV.prototype.equals=function(e){return this===e||e instanceof nV&&J.equals(this._evenColor,e._evenColor)&&J.equals(this._oddColor,e._oddColor)&&J.equals(this._repeat,e._repeat)};var iV=nV;var ari=_(T(),1);var eri=_(T(),1);var sfe={id:void 0};function Xv(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function Rc(e){this._owner=e,this._entities=new It,this._addedEntities=new It,this._removedEntities=new It,this._changedEntities=new It,this._suspendCount=0,this._collectionChanged=new be,this._id=Hn(),this._show=!0,this._firing=!1,this._refire=!1}Rc.prototype.suspendEvents=function(){this._suspendCount++};Rc.prototype.resumeEvents=function(){this._suspendCount--,Xv(this)};Object.defineProperties(Rc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});Rc.prototype.computeAvailability=function(){let e=Oe.MAXIMUM_VALUE,t=Oe.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;q.lessThan(a,e)&&!a.equals(Oe.MINIMUM_VALUE)&&(e=a),q.greaterThan(c,t)&&!c.equals(Oe.MAXIMUM_VALUE)&&(t=c)}}return Oe.MAXIMUM_VALUE.equals(e)&&(e=Oe.MINIMUM_VALUE),Oe.MINIMUM_VALUE.equals(t)&&(t=Oe.MAXIMUM_VALUE),new Rn({start:e,stop:t})};Rc.prototype.add=function(e){e instanceof er||(e=new er(e));let t=e.id,n=this._entities;if(n.contains(t))throw new fe(`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(Rc.prototype._onEntityDefinitionChanged,this),Xv(this),e};Rc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Rc.prototype.contains=function(e){return this._entities.get(e.id)===e};Rc.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(Rc.prototype._onEntityDefinitionChanged,this),Xv(this),!0):!1};Rc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(Rc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),Xv(this)};Rc.prototype.getById=function(e){return this._entities.get(e)};Rc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(sfe.id=e,t=new er(sfe),this.add(t)),t};Rc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),Xv(this)};var oa=Rc;var bU={id:void 0},oV=new Array(2);function EQ(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 afe(e,t,n,i){oV[0]=n,oV[1]=i.id,t[JSON.stringify(oV)]=i.definitionChanged.addEventListener(Kr.prototype._onDefinitionChanged,e)}function cfe(e,t,n,i){oV[0]=n,oV[1]=i.id;let o=JSON.stringify(oV);t[o](),t[o]=void 0}function sy(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,d,u=e._composite,h=new oa(e),p=e._eventHash,g;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Kr.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--)s=a[c],cfe(e,p,g,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Kr.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--){s=a[c],afe(e,p,g,s);let y=h.getById(s.id);l(y)||(y=u.getById(s.id),l(y)?EQ(y):(bU.id=s.id,y=new er(bU)),h.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=h.values;for(r=0;r<f.length;r++)u.add(f[r]);u.resumeEvents()}function Kr(e,t){this._owner=t,this._composite=new oa(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Hn(),this._eventHash={},sy(this),this._shouldRecomposite=!1}Object.defineProperties(Kr.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}}});Kr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),sy(this)};Kr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),sy(this),!0):!1};Kr.prototype.removeAllCollections=function(){this._collections.length=0,sy(this)};Kr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Kr.prototype.contains=function(e){return this._composite.contains(e)};Kr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Kr.prototype.getCollection=function(e){return this._collections[e]};Kr.prototype.getCollectionsLength=function(){return this._collections.length};function gU(e,t){return e.indexOf(t)}function lfe(e,t,n){let i=e._collections;if(t=X.clamp(t,0,i.length-1),n=X.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,sy(e)}Kr.prototype.raiseCollection=function(e){let t=gU(this._collections,e);lfe(this,t,t+1)};Kr.prototype.lowerCollection=function(e){let t=gU(this._collections,e);lfe(this,t,t-1)};Kr.prototype.raiseCollectionToTop=function(e){let t=gU(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),sy(this))};Kr.prototype.lowerCollectionToBottom=function(e){let t=gU(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),sy(this))};Kr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Kr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(sy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Kr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Kr.prototype.getById=function(e){return this._composite.getById(e)};Kr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,d,u=n.length,h=this._eventHash,p=e.id;for(s=0;s<u;s++){let f=n[s];cfe(this,h,p,f);let y=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(d)||(d=r.getById(y),EQ(d)),d.merge(c));l(d)||r.removeById(y),d=void 0}let g=t.length;for(s=0;s<g;s++){let f=t[s];afe(this,h,p,f);let y=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(d)||(d=r.getById(y),l(d)?EQ(d):(bU.id=y,d=new er(bU),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};Kr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),d=c[t],u=!l(d),h=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let f=g[t];if(l(f)){if(h)if(h=!1,l(f.merge)&&l(f.clone))d=f.clone(d);else{d=f;break}d.merge(f)}}}u&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=d};var IQ=Kr;var Sri=_(T(),1);var pri=_(T(),1);function z$e(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function IT(){this._eventHelper=new dr,this._definitionChanged=new be,this._intervals=new Or,this._intervals.changedEvent.addEventListener(IT.prototype._intervalsChanged,this)}Object.defineProperties(IT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var H$e=new q;IT.prototype.getValue=function(e,t){l(e)||(e=q.now(H$e));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};IT.prototype.equals=function(e){return this===e||e instanceof IT&&this._intervals.equals(e._intervals,J.equals)};IT.prototype._intervalsChanged=function(){z$e(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Zc=IT;function ay(){this._definitionChanged=new be,this._composite=new Zc,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 K$e=new q;ay.prototype.getValue=function(e,t){l(e)||(e=q.now(K$e));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,J.equals)};ay.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var rV=ay;var Iri=_(T(),1);function cy(e){this._referenceFrame=e??Di.FIXED,this._definitionChanged=new be,this._composite=new Zc,this._composite.definitionChanged.addEventListener(cy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(cy.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 J$e=new q;cy.prototype.getValue=function(e,t){return l(e)||(e=q.now(J$e)),this.getValueInReferenceFrame(e,Di.FIXED,t)};cy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};cy.prototype.equals=function(e){return this===e||e instanceof cy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,J.equals)};cy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Sa=cy;var usi=_(T(),1);var Dri=_(T(),1);var Q$e=new jn(0);function ll(e){ai.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(ll.prototype=Object.create(ai.prototype),ll.prototype.constructor=ll);Object.defineProperties(ll.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});ll.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&$c.isSupported(this._scene)};ll.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};ll.prototype._computeCenter=fe.throwInstantiationError;ll.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ai.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))&&Vt(Vt.geometryZIndex),this._zIndex=o.zIndex??Q$e,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new jm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new F_(this._scene,a,r,s)}};ll.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ai.prototype.destroy.call(this)};ll.getGeometryHeight=function(e,t){if(!l(e)){t!==Ke.NONE&&Vt(Vt.geometryHeightReference);return}return Pu(t)?0:e};ll.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==Ke.NONE&&Vt(Vt.geometryExtrudedHeightReference);return}return Pu(t)?ll.CLAMP_TO_GROUND:e};ll.CLAMP_TO_GROUND="clamp";ll.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=Ke.NONE),(!l(n)||!l(i))&&(i=Ke.NONE);let o=0;if(t!==Ke.NONE&&o++,i===Ke.RELATIVE_TO_GROUND&&o++,o===2)return ln.ALL;if(o===1)return ln.TOP};var zn=ll;var dfe=new D,ufe=m.ZERO,mfe=new m,hfe=new le;function j$e(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 _h(e,t){zn.call(this,{entity:e,scene:t,geometryOptions:new j$e(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(_h.prototype=Object.create(zn.prototype),_h.prototype.constructor=_h);_h.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,dfe)),l(o)||(o=D.WHITE),i.color=Kt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,ufe,mfe))),new Xt({id:t,geometry:new Nx(this._options),attributes:i})};_h.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,dfe),o={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,ufe,mfe))),new Xt({id:t,geometry:new DE(this._options),attributes:o})};_h.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return m.clone(n[Math.floor(n.length/2)],t)};_h.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||ai.prototype._isHidden.call(this,e,t)};_h.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!J.isConstant(t.height)||!J.isConstant(t.extrudedHeight)||!J.isConstant(t.granularity)||!J.isConstant(t.width)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.cornerType)||!J.isConstant(t.zIndex)||this._onTerrain&&!J.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};_h.prototype._setStaticOptions=function(e,t){let n=J.getValueOrUndefined(t.height,Oe.MINIMUM_VALUE),i=J.getValueOrDefault(t.heightReference,Oe.MINIMUM_VALUE,Ke.NONE),o=J.getValueOrUndefined(t.extrudedHeight,Oe.MINIMUM_VALUE),r=J.getValueOrDefault(t.extrudedHeightReference,Oe.MINIMUM_VALUE,Ke.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof zt?hn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Oe.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Oe.MINIMUM_VALUE),s.granularity=J.getValueOrUndefined(t.granularity,Oe.MINIMUM_VALUE),s.cornerType=J.getValueOrUndefined(t.cornerType,Oe.MINIMUM_VALUE),s.offsetAttribute=zn.computeGeometryOffsetAttribute(n,i,o,r),s.height=zn.getGeometryHeight(n,i),o=zn.getGeometryExtrudedHeight(o,r),o===zn.CLAMP_TO_GROUND&&(o=ui.getMinimumMaximumHeights(Nx.computeRectangle(s,hfe)).minimumTerrainHeight),s.extrudedHeight=o};_h.DynamicGeometryUpdater=sV;function sV(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(sV.prototype=Object.create(si.prototype),sV.prototype.constructor=sV);sV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||si.prototype._isHidden.call(this,e,t,n)};sV.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,Ke.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE);l(s)&&!l(o)&&(o=0),i.positions=J.getValueOrUndefined(t.positions,n),i.width=J.getValueOrUndefined(t.width,n),i.granularity=J.getValueOrUndefined(t.granularity,n),i.cornerType=J.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=zn.computeGeometryOffsetAttribute(o,r,s,a),i.height=zn.getGeometryHeight(o,r),s=zn.getGeometryExtrudedHeight(s,a),s===zn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(Nx.computeRectangle(i,hfe)).minimumTerrainHeight),i.extrudedHeight=s};var Wv=_h;var Iai=_(T(),1);var fsi=_(T(),1);function yU(){fe.throwInstantiationError()}Object.defineProperties(yU.prototype,{name:{get:fe.throwInstantiationError},clock:{get:fe.throwInstantiationError},entities:{get:fe.throwInstantiationError},isLoading:{get:fe.throwInstantiationError},changedEvent:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},loadingEvent:{get:fe.throwInstantiationError},show:{get:fe.throwInstantiationError},clustering:{get:fe.throwInstantiationError}});yU.prototype.update=function(e){fe.throwInstantiationError()};yU.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Jr=yU;var Vai=_(T(),1);var Esi=_(T(),1);function Xr(e,t){e=e??Y.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Ot.clone(n)),l(i)&&(i=Ot.clone(i)),l(o)&&(o=At.clone(o)),this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),this._actualPosition=m.clone(this._position),this._color=D.clone(e.color??D.WHITE),this._outlineColor=D.clone(e.outlineColor??D.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Br.NONE}var ffe=Xr.SHOW_INDEX=0,gfe=Xr.POSITION_INDEX=1,q$e=Xr.COLOR_INDEX=2,$$e=Xr.OUTLINE_COLOR_INDEX=3,eet=Xr.OUTLINE_WIDTH_INDEX=4,tet=Xr.PIXEL_SIZE_INDEX=5,net=Xr.SCALE_BY_DISTANCE_INDEX=6,iet=Xr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,oet=Xr.DISTANCE_DISPLAY_CONDITION_INDEX=8,ret=Xr.DISABLE_DEPTH_DISTANCE_INDEX=9,set=Xr.SPLIT_DIRECTION_INDEX=10;Xr.NUMBER_OF_PROPERTIES=11;function Ad(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Xr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Ad(this,ffe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Ad(this,gfe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ot.equals(t,e)||(this._scaleByDistance=Ot.clone(e,t),Ad(this,net))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ot.equals(t,e)||(this._translucencyByDistance=Ot.clone(e,t),Ad(this,iet))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Ad(this,tet))}},color:{get:function(){return this._color},set:function(e){let t=this._color;D.equals(t,e)||(D.clone(e,t),Ad(this,q$e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;D.equals(t,e)||(D.clone(e,t),Ad(this,$$e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ad(this,eet))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){At.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=At.clone(e,this._distanceDisplayCondition),Ad(this,oet))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Ad(this,ret))}},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,Ad(this,ffe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Ad(this,set))}}});Xr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Xr.prototype._getActualPosition=function(){return this._actualPosition};Xr.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Ad(this,gfe)};var pfe=new re;Xr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(F.multiplyByPoint(n,e,pfe),Oi.computeActualEllipsoidPosition(t,pfe))};var bfe=new re;Xr._computeScreenSpacePosition=function(e,t,n,i){let o=F.multiplyByVector(e,re.fromElements(t.x,t.y,t.z,1,bfe),bfe);return Oi.worldToWindowCoordinates(n,o,i)};Xr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,o=Xr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Xr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new ze),n.x=r,n.y=s,n.width=a,n.height=c,n};Xr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&D.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&D.equals(this._outlineColor,e._outlineColor)&&Ot.equals(this._scaleByDistance,e._scaleByDistance)&&Ot.equals(this._translucencyByDistance,e._translucencyByDistance)&&At.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Xr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var As=Xr;var sai=_(T(),1);var Xsi=_(T(),1),ly=`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 Psi=_(T(),1),Pv=`uniform float u_maxTotalPointSize;
|
|
|
|
|
|
in vec4 positionHighAndSize;
|
|
|
in vec4 positionLowAndOutline;
|
|
|
in vec4 compressedAttribute0; // color, outlineColor, pick color
|
|
|
in vec4 compressedAttribute1; // show, translucency by distance, some free space
|
|
|
in vec4 scaleByDistance; // near, nearScale, far, farScale
|
|
|
in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection
|
|
|
|
|
|
out vec4 v_color;
|
|
|
out vec4 v_outlineColor;
|
|
|
out float v_innerPercent;
|
|
|
out float v_pixelDistance;
|
|
|
out vec4 v_pickColor;
|
|
|
out float v_splitDirection;
|
|
|
|
|
|
const float SHIFT_LEFT8 = 256.0;
|
|
|
const float SHIFT_RIGHT8 = 1.0 / 256.0;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
// Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition
|
|
|
|
|
|
// unpack attributes
|
|
|
vec3 positionHigh = positionHighAndSize.xyz;
|
|
|
vec3 positionLow = positionLowAndOutline.xyz;
|
|
|
float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
|
|
|
float totalSize = positionHighAndSize.w + outlineWidthBothSides;
|
|
|
float outlinePercent = outlineWidthBothSides / totalSize;
|
|
|
// Scale in response to browser-zoom.
|
|
|
totalSize *= czm_pixelRatio;
|
|
|
|
|
|
float temp = compressedAttribute1.x * SHIFT_RIGHT8;
|
|
|
float show = floor(temp);
|
|
|
|
|
|
#ifdef EYE_DISTANCE_TRANSLUCENCY
|
|
|
vec4 translucencyByDistance;
|
|
|
translucencyByDistance.x = compressedAttribute1.z;
|
|
|
translucencyByDistance.z = compressedAttribute1.w;
|
|
|
|
|
|
translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
|
|
|
|
|
|
temp = compressedAttribute1.y * SHIFT_RIGHT8;
|
|
|
translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
|
|
|
#endif
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
vec4 color;
|
|
|
vec4 outlineColor;
|
|
|
vec4 pickColor;
|
|
|
|
|
|
// compressedAttribute0.z => pickColor.rgb
|
|
|
|
|
|
temp = compressedAttribute0.z * SHIFT_RIGHT8;
|
|
|
pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
temp = floor(temp) * SHIFT_RIGHT8;
|
|
|
pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
pickColor.r = floor(temp);
|
|
|
|
|
|
// compressedAttribute0.x => color.rgb
|
|
|
|
|
|
temp = compressedAttribute0.x * SHIFT_RIGHT8;
|
|
|
color.b = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
temp = floor(temp) * SHIFT_RIGHT8;
|
|
|
color.g = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
color.r = floor(temp);
|
|
|
|
|
|
// compressedAttribute0.y => outlineColor.rgb
|
|
|
|
|
|
temp = compressedAttribute0.y * SHIFT_RIGHT8;
|
|
|
outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
temp = floor(temp) * SHIFT_RIGHT8;
|
|
|
outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
outlineColor.r = floor(temp);
|
|
|
|
|
|
// compressedAttribute0.w => color.a, outlineColor.a, pickColor.a
|
|
|
|
|
|
temp = compressedAttribute0.w * SHIFT_RIGHT8;
|
|
|
pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
pickColor = pickColor / 255.0;
|
|
|
|
|
|
temp = floor(temp) * SHIFT_RIGHT8;
|
|
|
outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
|
|
|
outlineColor /= 255.0;
|
|
|
color.a = floor(temp);
|
|
|
color /= 255.0;
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
|
vec4 positionEC = czm_modelViewRelativeToEye * p;
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
|
|
|
float lengthSq;
|
|
|
if (czm_sceneMode == czm_sceneMode2D)
|
|
|
{
|
|
|
// 2D camera distance is a special case
|
|
|
// treat all billboards as flattened to the z=0.0 plane
|
|
|
lengthSq = czm_eyeHeight2D.y;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
lengthSq = dot(positionEC.xyz, positionEC.xyz);
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#ifdef EYE_DISTANCE_SCALING
|
|
|
totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
|
|
|
#endif
|
|
|
if (totalSize > 0.0) {
|
|
|
// Add padding for anti-aliasing on both sides.
|
|
|
totalSize += 3.0;
|
|
|
}
|
|
|
|
|
|
// Clamp to max point size.
|
|
|
totalSize = min(totalSize, u_maxTotalPointSize);
|
|
|
// If size is too small, push vertex behind near plane for clipping.
|
|
|
// Note that context.minimumAliasedPointSize "will be at most 1.0".
|
|
|
if (totalSize < 1.0)
|
|
|
{
|
|
|
positionEC.xyz = vec3(0.0);
|
|
|
totalSize = 1.0;
|
|
|
}
|
|
|
|
|
|
float translucency = 1.0;
|
|
|
#ifdef EYE_DISTANCE_TRANSLUCENCY
|
|
|
translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
|
|
|
// push vertex behind near plane for clipping
|
|
|
if (translucency < 0.004)
|
|
|
{
|
|
|
positionEC.xyz = vec3(0.0);
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#ifdef DISTANCE_DISPLAY_CONDITION
|
|
|
float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x;
|
|
|
float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y;
|
|
|
if (lengthSq < nearSq || lengthSq > farSq) {
|
|
|
// push vertex behind camera to force it to be clipped
|
|
|
positionEC.xyz = vec3(0.0, 0.0, 1.0);
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
gl_Position = czm_projection * positionEC;
|
|
|
czm_vertexLogDepth();
|
|
|
|
|
|
#ifdef DISABLE_DEPTH_DISTANCE
|
|
|
float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z;
|
|
|
if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
|
|
|
{
|
|
|
disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
|
|
|
}
|
|
|
|
|
|
if (disableDepthTestDistance != 0.0)
|
|
|
{
|
|
|
// Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
|
|
|
float zclip = gl_Position.z / gl_Position.w;
|
|
|
bool clipped = (zclip < -1.0 || zclip > 1.0);
|
|
|
if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
|
|
|
{
|
|
|
// Position z on the near plane.
|
|
|
gl_Position.z = -gl_Position.w;
|
|
|
#ifdef LOG_DEPTH
|
|
|
czm_vertexLogDepth(vec4(czm_currentFrustum.x));
|
|
|
#endif
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
v_color = color;
|
|
|
v_color.a *= translucency * show;
|
|
|
v_outlineColor = outlineColor;
|
|
|
v_outlineColor.a *= translucency * show;
|
|
|
|
|
|
v_innerPercent = 1.0 - outlinePercent;
|
|
|
v_pixelDistance = 2.0 / totalSize;
|
|
|
gl_PointSize = totalSize * show;
|
|
|
gl_Position *= show;
|
|
|
|
|
|
v_pickColor = pickColor;
|
|
|
v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
|
|
|
}
|
|
|
`;var aet=As.SHOW_INDEX,PQ=As.POSITION_INDEX,yfe=As.COLOR_INDEX,cet=As.OUTLINE_COLOR_INDEX,det=As.OUTLINE_WIDTH_INDEX,uet=As.PIXEL_SIZE_INDEX,xfe=As.SCALE_BY_DISTANCE_INDEX,_fe=As.TRANSLUCENCY_BY_DISTANCE_INDEX,Tfe=As.DISTANCE_DISPLAY_CONDITION_INDEX,met=As.DISABLE_DEPTH_DISTANCE_INDEX,het=As.SPLIT_DIRECTION_INDEX,vQ=As.NUMBER_OF_PROPERTIES,Gc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function qu(e){e=e??Y.EMPTY_OBJECT,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(vQ),this._maxPixelSize=1,this._baseVolume=new de,this._baseVolumeWC=new de,this._baseVolume2D=new de,this._boundingVolume=new de,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Go.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW,ke.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(qu.prototype,{length:{get:function(){return wQ(this),this._pointPrimitives.length}}});function Sfe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}qu.prototype.add=function(e){let t=new As(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};qu.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};qu.prototype.removeAll=function(){Sfe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function wQ(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}qu.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};qu.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};qu.prototype.get=function(e){return wQ(this),this._pointPrimitives[e]};qu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<vQ;++i){let o=n[i]===0?ke.STATIC_DRAW:ke.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function fet(e,t,n){return new Gp(e,[{index:Gc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[PQ]},{index:Gc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[PQ]},{index:Gc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[yfe]},{index:Gc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[_fe]},{index:Gc.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[xfe]},{index:Gc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Tfe]}],t)}var XQ=new Yn;function Cfe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===oe.SCENE3D&&(de.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Yn.fromCartesian(r,XQ);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[Gc.positionHighAndSize],d=XQ.high;c(o,d.x,d.y,d.z,s);let u=n[Gc.positionLowAndOutline],h=XQ.low;u(o,h.x,h.y,h.z,a)}var xU=65536,vv=256;function Vfe(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=D.floatToByte(r.red),d=D.floatToByte(r.green),u=D.floatToByte(r.blue),h=c*xU+d*vv+u;c=D.floatToByte(a.red),d=D.floatToByte(a.green),u=D.floatToByte(a.blue);let p=c*xU+d*vv+u;c=D.floatToByte(s.red),d=D.floatToByte(s.green),u=D.floatToByte(s.blue);let g=c*xU+d*vv+u,f=D.floatToByte(r.alpha)*xU+D.floatToByte(a.alpha)*vv+D.floatToByte(s.alpha),y=n[Gc.compressedAttribute0];y(o,h,p,g,f)}function Lfe(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,d=i.translucencyByDistance;l(d)&&(r=d.near,s=d.nearValue,a=d.far,c=d.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let u=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(u=!1),s=X.clamp(s,0,1),s=s===1?255:s*255|0;let h=(u?1:0)*vv+s;c=X.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[Gc.compressedAttribute1];g(o,h,p,r,a)}function Rfe(e,t,n,i){let o=i._index,r=n[Gc.scaleByDistance],s=0,a=1,c=1,d=1,u=i.scaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,d)}function Zfe(e,t,n,i){let o=i._index,r=n[Gc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance;d*=d,d>0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let u=0,h=i.splitDirection;l(h)&&(u=h),r(o,s,a,d,u)}function pet(e,t,n,i){Cfe(e,t,n,i),Vfe(e,t,n,i),Lfe(e,t,n,i),Rfe(e,t,n,i),Zfe(e,t,n,i)}function WQ(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,h=As._computeActualPosition(u,i,o);l(h)&&(d._setActualPosition(h),r?a.push(h):de.expand(s,h,s))}r&&de.fromPoints(a,s)}function bet(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&WQ(e,i,i.length,t,r,!0)):n===oe.MORPHING?WQ(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&WQ(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function get(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var yet=[];qu.prototype.update=function(e){if(wQ(this),!this.show)return;this._maxTotalPointSize=Dt.maximumAliasedPointSize,bet(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,d=e.passes,u=d.pick;if(s||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let Z=0;Z<vQ;++Z)r[Z]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=fet(c,n,this._buffersUsage),a=this._vaf.writers;for(let Z=0;Z<n;++Z){let E=this._pointPrimitives[Z];E._dirty=!1,pet(this,c,a,E)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let Z=yet;Z.length=0,(r[PQ]||r[det]||r[uet])&&Z.push(Cfe),(r[yfe]||r[cet])&&Z.push(Vfe),(r[aet]||r[_fe])&&Z.push(Lfe),r[xfe]&&Z.push(Rfe),(r[Tfe]||r[met]||r[het])&&Z.push(Zfe);let E=Z.length;if(a=this._vaf.writers,o/n>.1){for(let P=0;P<o;++P){let W=i[P];W._dirty=!1;for(let v=0;v<E;++v)Z[v](this,c,a,W)}this._vaf.commit()}else{for(let P=0;P<o;++P){let W=i[P];W._dirty=!1;for(let v=0;v<E;++v)Z[v](this,c,a,W);this._vaf.subCommit(W._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,de.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=F.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,h=de.clone(this._baseVolumeWC,this._boundingVolume)):h=de.clone(this._baseVolume2D,this._boundingVolume),get(this,e,h);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Go.OPAQUE||this._blendOption===Go.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Go.TRANSLUCENT||this._blendOption===Go.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!1,blending:fn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new De({sources:[Pv]}),this._shaderScaleByDistance&&f.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&f.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&f.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&f.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Go.OPAQUE_AND_TRANSLUCENT&&(y=new De({defines:["OPAQUE"],sources:[ly]}),this._sp=nn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:Gc}),y=new De({defines:["TRANSLUCENT"],sources:[ly]}),this._spTranslucent=nn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:Gc})),this._blendOption===Go.OPAQUE&&(y=new De({sources:[ly]}),this._sp=nn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:Gc})),this._blendOption===Go.TRANSLUCENT&&(y=new De({sources:[ly]}),this._spTranslucent=nn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:Gc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let x,S,C,V,L=e.commandList;if(d.render||u){let Z=this._colorCommands,E=this._blendOption===Go.OPAQUE,P=this._blendOption===Go.OPAQUE_AND_TRANSLUCENT;x=this._vaf.va,S=x.length,Z.length=S;let W=P?S*2:S;for(V=0;V<W;++V){let v=E||P&&V%2===0;C=Z[V],l(C)||(C=Z[V]=new $e),C.primitiveType=Ae.POINTS,C.pass=v||!P?Ge.OPAQUE:Ge.TRANSLUCENT,C.owner=this;let A=P?Math.floor(V/2):V;C.boundingVolume=h,C.modelMatrix=p,C.shaderProgram=v?this._sp:this._spTranslucent,C.uniformMap=this._uniforms,C.vertexArray=x[A].va,C.renderState=v?this._rsOpaque:this._rsTranslucent,C.debugShowBoundingVolume=this.debugShowBoundingVolume,C.pickId="v_pickColor",L.push(C)}}};qu.prototype.isDestroyed=function(){return!1};qu.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(),Sfe(this._pointPrimitives),me(this)};var aV=qu;function Th(e){e=e??Y.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 be,this.show=e.show??!0}function Gfe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var xet=new ze;function Efe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=ey.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=fo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=As.getScreenSpaceBoundingBox(e,t,o)),Gfe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Xfe(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=ey.getScreenSpaceBoundingBox(s,t,xet);Gfe(a,n),o=ze.union(o,a,o)}return o}function _et(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Xfe(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 Ife(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 Xfe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function FQ(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===oe.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),d=o._clusterBillboards&&l(a.id._billboard),u=o._clusterPoints&&l(a.id._point);if(c&&(u||d))continue;let h=a.computeScreenSpacePosition(n);l(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}var Tet=new ze,Cet=new ze,Vet=new ze;function Let(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new Pf({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new vd({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new aV;let d=e._pixelRange,u=e._minimumClusterSize,h=e._previousClusters,p=[],g=e._previousHeight,f=n.camera.positionCartographic.height,y=n.ellipsoid,x=n.camera.positionWC,S=new Ip(y,x),C=[];e._clusterLabels&&FQ(i,C,n,S,e),e._clusterBillboards&&FQ(o,C,n,S,e),e._clusterPoints&&FQ(r,C,n,S,e);let V,L,Z,E,P,W,v,A,b,R,G,I;if(C.length>0){let w=new Lx(C.length,64,Uint32Array);for(let M=0;M<C.length;++M)w.add(C[M].coord.x,C[M].coord.y);if(w.finish(),f<g)for(Z=h.length,V=0;V<Z;++V){let M=h[V];if(!S.isPointVisible(M.position))continue;let O=fo._computeScreenSpacePosition(F.IDENTITY,M.position,m.ZERO,U.ZERO,n);if(!l(O))continue;let k=1-f/g,B=M.width=M.width*k,N=M.height=M.height*k;B=Math.max(B,M.minimumWidth),N=Math.max(N,M.minimumHeight);let z=O.x-B*.5,K=O.y-N*.5,te=O.x+B,H=O.y+N;for(P=w.range(z,K,te,H),W=P.length,R=0,b=[],L=0;L<W;++L)v=P[L],A=C[v],A.clustered||(++R,G=A.collection,I=A.index,b.push(G.get(I).id));if(R>=u)for(Ife(M.position,R,b,e),p.push(M),L=0;L<W;++L)C[P[L]].clustered=!0}for(Z=C.length,V=0;V<Z;++V){let M=C[V];if(M.clustered)continue;M.clustered=!0,G=M.collection,I=M.index;let O=G.get(I);E=Efe(O,M.coord,d,e,Tet);let k=ze.clone(E,Cet);P=w.range(E.x,E.y,E.x+E.width,E.y+E.height),W=P.length;let B=m.clone(O.position);for(R=1,b=[O.id],L=0;L<W;++L)if(v=P[L],A=C[v],!A.clustered){let N=A.collection.get(A.index),z=Efe(N,A.coord,d,e,Vet);m.add(N.position,B,B),ze.union(k,z,k),++R,b.push(N.id)}if(R>=u){let N=m.multiplyByScalar(B,1/R,B);for(Ife(N,R,b,e),p.push({position:N,width:k.width,height:k.height,minimumWidth:E.width,minimumHeight:E.height}),L=0;L<W;++L)C[P[L]].clustered=!0}else _et(O,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=f}}Th.prototype._initialize=function(e){this._scene=e;let t=Let(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Th.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 MQ(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,d=this[n];d.length>0?(a=d.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function NQ(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Th.prototype.getLabel=MQ("_labelCollection",Pf,"_unusedLabelIndices","labelIndex");Th.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,NQ(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};Th.prototype.getBillboard=MQ("_billboardCollection",vd,"_unusedBillboardIndices","billboardIndex");Th.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,NQ(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};Th.prototype.getPoint=MQ("_pointCollection",aV,"_unusedPointIndices","pointIndex");Th.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,NQ(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function AQ(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Ret(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,AQ(e._labelCollection),AQ(e._billboardCollection),AQ(e._pointCollection))}Th.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,Ret(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)};Th.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 Md=Th;function kQ(e){this._name=e,this._clock=void 0,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new oa(this),this._entityCluster=new Md}Object.defineProperties(kQ.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){Jr.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}}});kQ.prototype.update=function(e){return!0};var wv=kQ;var qai=_(T(),1);var Wfe=m.ZERO,Pfe=new m,Zet=new m,vfe=new D;function Get(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 Nd(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new Get(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Nd.prototype=Object.create(ai.prototype),Nd.prototype.constructor=Nd);Object.defineProperties(Nd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Nd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Dn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof zt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,vfe)),l(a)||(a=D.WHITE),s.color=Kt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Wfe,Pfe))),new Xt({id:t,geometry:new BE(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Nd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,vfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Wfe,Pfe))),new Xt({id:t,geometry:new YE(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Nd.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Nd.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||ai.prototype._isHidden.call(this,e,t)};Nd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!J.isConstant(t.slices)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.numberOfVerticalLines)};Nd.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Oe.MINIMUM_VALUE,Ke.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof zt?hn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Oe.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Oe.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Oe.MINIMUM_VALUE),i.slices=J.getValueOrUndefined(t.slices,Oe.MINIMUM_VALUE),i.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,Oe.MINIMUM_VALUE),i.offsetAttribute=n!==Ke.NONE?ln.ALL:void 0};Nd.prototype._onEntityPropertyChanged=db;Nd.DynamicGeometryUpdater=cV;function cV(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(cV.prototype=Object.create(si.prototype),cV.prototype.constructor=cV);cV.prototype._isHidden=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(e.position,n,Zet);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||si.prototype._isHidden.call(this,e,t,n)};cV.prototype._setOptions=function(e,t,n){let i=J.getValueOrDefault(t.heightReference,n,Ke.NONE),o=this._options;o.length=J.getValueOrUndefined(t.length,n),o.topRadius=J.getValueOrUndefined(t.topRadius,n),o.bottomRadius=J.getValueOrUndefined(t.bottomRadius,n),o.slices=J.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Ke.NONE?ln.ALL:void 0};var Fv=Nd;var _mi=_(T(),1);var Uv=_(cd(),1);var rci=_(T(),1);function XT(){this._definitionChanged=new be,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(XT.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:tl("startTime"),stopTime:tl("stopTime"),currentTime:tl("currentTime"),clockRange:tl("clockRange"),clockStep:tl("clockStep"),multiplier:tl("multiplier")});XT.prototype.clone=function(e){return l(e)||(e=new XT),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};XT.prototype.equals=function(e){return this===e||l(e)&&q.equals(this.startTime,e.startTime)&&q.equals(this.stopTime,e.stopTime)&&q.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};XT.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};XT.prototype.getValue=function(e){return l(e)||(e=new Am),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 Sh=XT;var pci=_(T(),1);var Eet=D.WHITE,Iet=.1,Xet=new U(8,8),Wet=new U(0,0),Pet=new U(1,1);function lV(e){e=e??Y.EMPTY_OBJECT,this._definitionChanged=new be,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(lV.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._cellAlpha)&&J.isConstant(this._lineCount)&&J.isConstant(this._lineThickness)&&J.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),cellAlpha:ue("cellAlpha"),lineCount:ue("lineCount"),lineThickness:ue("lineThickness"),lineOffset:ue("lineOffset")});lV.prototype.getType=function(e){return"Grid"};var vet=new q;lV.prototype.getValue=function(e,t){return l(e)||(e=q.now(vet)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Eet,t.color),t.cellAlpha=J.getValueOrDefault(this._cellAlpha,e,Iet),t.lineCount=J.getValueOrClonedDefault(this._lineCount,e,Xet,t.lineCount),t.lineThickness=J.getValueOrClonedDefault(this._lineThickness,e,Pet,t.lineThickness),t.lineOffset=J.getValueOrClonedDefault(this._lineOffset,e,Wet,t.lineOffset),t};lV.prototype.equals=function(e){return this===e||e instanceof lV&&J.equals(this._color,e._color)&&J.equals(this._cellAlpha,e._cellAlpha)&&J.equals(this._lineCount,e._lineCount)&&J.equals(this._lineThickness,e._lineThickness)&&J.equals(this._lineOffset,e._lineOffset)};var dV=lV;var Cci=_(T(),1);function uV(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(uV.prototype,{isConstant:{get:function(){return J.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});uV.prototype.getType=function(e){return"PolylineArrow"};var wet=new q;uV.prototype.getValue=function(e,t){return l(e)||(e=q.now(wet)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,D.WHITE,t.color),t};uV.prototype.equals=function(e){return this===e||e instanceof uV&&J.equals(this._color,e._color)};var mV=uV;var Wci=_(T(),1);var Fet=D.WHITE,Aet=D.TRANSPARENT,Met=16,Net=255;function hV(e){e=e??Y.EMPTY_OBJECT,this._definitionChanged=new be,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(hV.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._gapColor)&&J.isConstant(this._dashLength)&&J.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),gapColor:ue("gapColor"),dashLength:ue("dashLength"),dashPattern:ue("dashPattern")});hV.prototype.getType=function(e){return"PolylineDash"};var ket=new q;hV.prototype.getValue=function(e,t){return l(e)||(e=q.now(ket)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Fet,t.color),t.gapColor=J.getValueOrClonedDefault(this._gapColor,e,Aet,t.gapColor),t.dashLength=J.getValueOrDefault(this._dashLength,e,Met,t.dashLength),t.dashPattern=J.getValueOrDefault(this._dashPattern,e,Net,t.dashPattern),t};hV.prototype.equals=function(e){return this===e||e instanceof hV&&J.equals(this._color,e._color)&&J.equals(this._gapColor,e._gapColor)&&J.equals(this._dashLength,e._dashLength)&&J.equals(this._dashPattern,e._dashPattern)};var fV=hV;var Uci=_(T(),1);var Uet=D.WHITE,Det=.25,Oet=1;function pV(e){e=e??Y.EMPTY_OBJECT,this._definitionChanged=new be,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(pV.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),glowPower:ue("glowPower"),taperPower:ue("taperPower")});pV.prototype.getType=function(e){return"PolylineGlow"};var Bet=new q;pV.prototype.getValue=function(e,t){return l(e)||(e=q.now(Bet)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Uet,t.color),t.glowPower=J.getValueOrDefault(this._glowPower,e,Det,t.glowPower),t.taperPower=J.getValueOrDefault(this._taperPower,e,Oet,t.taperPower),t};pV.prototype.equals=function(e){return this===e||e instanceof pV&&J.equals(this._color,e._color)&&J.equals(this._glowPower,e._glowPower)&&J.equals(this._taperPower,e._taperPower)};var bV=pV;var Qci=_(T(),1);var Yet=D.WHITE,zet=D.BLACK,Het=1;function gV(e){e=e??Y.EMPTY_OBJECT,this._definitionChanged=new be,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(gV.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._outlineColor)&&J.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth")});gV.prototype.getType=function(e){return"PolylineOutline"};var Ket=new q;gV.prototype.getValue=function(e,t){return l(e)||(e=q.now(Ket)),l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Yet,t.color),t.outlineColor=J.getValueOrClonedDefault(this._outlineColor,e,zet,t.outlineColor),t.outlineWidth=J.getValueOrDefault(this._outlineWidth,e,Het),t};gV.prototype.equals=function(e){return this===e||e instanceof gV&&J.equals(this._color,e._color)&&J.equals(this._outlineColor,e._outlineColor)&&J.equals(this._outlineWidth,e._outlineWidth)};var dy=gV;var oli=_(T(),1);function jb(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new dr,this._referenceFrame=t??Di.FIXED,this.setValue(e)}Object.defineProperties(jb.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!J.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Jet=new q;jb.prototype.getValue=function(e,t){return l(e)||(e=q.now(Jet)),this.getValueInReferenceFrame(e,Di.FIXED,t)};jb.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};jb.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,jb.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};jb.prototype.equals=function(e){return this===e||e instanceof jb&&this._referenceFrame===e._referenceFrame&&J.arrayEquals(this._value,e._value)};jb.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var qb=jb;var uli=_(T(),1);function uy(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new dr,this.setValue(e)}Object.defineProperties(uy.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!J.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var Qet=new q;uy.prototype.getValue=function(e,t){l(e)||(e=q.now(Qet));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};uy.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,uy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};uy.prototype.equals=function(e){return this===e||e instanceof uy&&J.arrayEquals(this._value,e._value)};uy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var yV=uy;var gli=_(T(),1);function WT(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(kd.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 kd(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,e.collectionChanged.addEventListener(kd.prototype._onCollectionChanged,this)}Object.defineProperties(kd.prototype,{isConstant:{get:function(){return J.isConstant(WT(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=WT(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 WT(this)}}});kd.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new kd(e,n,i)};var jet=new q;kd.prototype.getValue=function(e,t){let n=WT(this);return l(e)||(e=q.now(jet)),l(n)?n.getValue(e,t):void 0};kd.prototype.getValueInReferenceFrame=function(e,t,n){let i=WT(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};kd.prototype.getType=function(e){let t=WT(this);return l(t)?t.getType(e):void 0};kd.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};kd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};kd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(kd.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=WT(this),l(i)&&this._definitionChanged.raiseEvent(this))};var $b=kd;var Tli=_(T(),1);var qet={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-X.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+X.TWO_PI:o}},$u=qet;var Nli=_(T(),1);var Eli=_(T(),1);var wfe={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 Ffe(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function Afe(e,t){return e instanceof q?e:typeof e=="string"?q.fromIso8601(e):q.addSeconds(t,e,new q)}var UQ=[],DQ=[];function _U(e,t,n,i,o){let r=0,s,a,c,d,u,h;for(;r<i.length;){u=Afe(i[r],e),c=Wo(t,u,q.compare);let p=0,g=0;if(c<0){for(c=~c,d=c*o,a=void 0,h=t[c];r<i.length&&(u=Afe(i[r],e),!(l(a)&&q.compare(a,u)>=0||l(h)&&q.compare(u,h)>=0));){for(UQ[p++]=u,r=r+1,s=0;s<o;s++)DQ[g++]=i[r],r=r+1;a=u}p>0&&(DQ.length=g,Ffe(n,d,DQ),UQ.length=p,Ffe(t,c,UQ))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function em(e,t){let n=e;n===Number&&(n=wfe);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let d=t[c];d===Number&&(d=wfe);let u=d.packedLength;i+=u,o+=d.packedInterpolationLength??u,s[c]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=jx,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 be,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=yd.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=yd.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(em.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 $et=new q;em.prototype.getValue=function(e,t){l(e)||(e=q.now($et));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Wo(n,e,q.compare);if(a<0){if(a=~a,a===0){let L=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===yd.NONE||o!==0&&q.secondsDifference(L,e)>o)return;if(this._backwardExtrapolationType===yd.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let L=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===yd.NONE||o!==0&&q.secondsDifference(e,L)>o)return;if(this._forwardExtrapolationType===yd.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,d=this._yTable,u=this._interpolationAlgorithm,h=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let L=Math.min(u.getRequiredDataPoints(this._interpolationDegree,p),i);L!==this._numberOfPoints&&(this._numberOfPoints=L,c.length=L,d.length=L*h)}let g=this._numberOfPoints-1;if(g<1)return;let f=0,y=i-1;if(y-f+1>=g+1){let L=a-(g/2|0)-1;L<f&&(L=f);let Z=L+g;Z>y&&(Z=y,L=Z-g,L<f&&(L=f)),f=L,y=Z}let S=y-f+1;for(let L=0;L<S;++L)c[L]=q.secondsDifference(n[f+L],n[y]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,f,y,d);else{let L=0,Z=this._packedLength,E=f*Z,P=(y+1)*Z;for(;E<P;)d[L]=s[E],E++,L++}let C=q.secondsDifference(e,n[y]),V;if(p===0||!l(u.interpolate))V=u.interpolateOrderZero(C,c,d,h,this._interpolationResult);else{let L=Math.floor(h/(p+1));V=u.interpolate(C,c,d,L,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(V,s,f,y,t):r.unpack(V,0,t)}return r.unpack(s,a*this._packedLength,t)};em.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))};em.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}_U(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};em.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let d=n[c],u=i.length;for(let h=0;h<u;h++)i[h].pack(d[h],a,a.length)}_U(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};em.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};em.prototype.addSamplesPackedArray=function(e,t){_U(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};em.prototype.removeSample=function(e){let t=Wo(this._times,e,q.compare);return t<0?!1:(Mfe(this,t,1),!0)};function Mfe(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)}em.prototype.removeSamples=function(e){let t=this._times,n=Wo(t,e.start,q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Wo(t,e.stop,q.compare);i<0?i=~i:e.isStopIncluded&&++i,Mfe(this,n,i-n)};em.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!q.equals(a[r],c[r]))return!1;let d=this._values,u=e._values;for(s=d.length,r=0;r<s;r++)if(d[r]!==u[r])return!1;return!0};em._mergeNewSamples=_U;var Ud=em;function tm(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=m}this._numberOfDerivatives=t,this._property=new Ud(m,n),this._definitionChanged=new be,this._referenceFrame=e??Di.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(tm.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 ett=new q;tm.prototype.getValue=function(e,t){return l(e)||(e=q.now(ett)),this.getValueInReferenceFrame(e,Di.FIXED,t)};tm.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Hm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};tm.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};tm.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};tm.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};tm.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};tm.prototype.removeSample=function(e){return this._property.removeSample(e)};tm.prototype.removeSamples=function(e){this._property.removeSamples(e)};tm.prototype.equals=function(e){return this===e||e instanceof tm&&J.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Ca=tm;var jli=_(T(),1);var Uli=_(T(),1),ttt={HORIZONTAL:0,VERTICAL:1},Ch=Object.freeze(ttt);var ntt=Ch.HORIZONTAL,itt=D.WHITE,ott=D.BLACK,rtt=0,stt=1;function xV(e){e=e??Y.EMPTY_OBJECT,this._definitionChanged=new be,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(xV.prototype,{isConstant:{get:function(){return J.isConstant(this._orientation)&&J.isConstant(this._evenColor)&&J.isConstant(this._oddColor)&&J.isConstant(this._offset)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:ue("orientation"),evenColor:ue("evenColor"),oddColor:ue("oddColor"),offset:ue("offset"),repeat:ue("repeat")});xV.prototype.getType=function(e){return"Stripe"};var att=new q;xV.prototype.getValue=function(e,t){return l(e)||(e=q.now(att)),l(t)||(t={}),t.horizontal=J.getValueOrDefault(this._orientation,e,ntt)===Ch.HORIZONTAL,t.evenColor=J.getValueOrClonedDefault(this._evenColor,e,itt,t.evenColor),t.oddColor=J.getValueOrClonedDefault(this._oddColor,e,ott,t.oddColor),t.offset=J.getValueOrDefault(this._offset,e,rtt),t.repeat=J.getValueOrDefault(this._repeat,e,stt),t};xV.prototype.equals=function(e){return this===e||e instanceof xV&&J.equals(this._orientation,e._orientation)&&J.equals(this._evenColor,e._evenColor)&&J.equals(this._oddColor,e._oddColor)&&J.equals(this._offset,e._offset)&&J.equals(this._repeat,e._repeat)};var _V=xV;var sdi=_(T(),1);function my(e){this._definitionChanged=new be,this._intervals=new Or,this._intervals.changedEvent.addEventListener(my.prototype._intervalsChanged,this),this._referenceFrame=e??Di.FIXED}Object.defineProperties(my.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 ctt=new q;my.prototype.getValue=function(e,t){return l(e)||(e=q.now(ctt)),this.getValueInReferenceFrame(e,Di.FIXED,t)};my.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Hm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};my.prototype.equals=function(e){return this===e||e instanceof my&&this._intervals.equals(e._intervals,J.equals)&&this._referenceFrame===e._referenceFrame};my.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var e0=my;var hdi=_(T(),1);function PT(){this._definitionChanged=new be,this._intervals=new Or,this._intervals.changedEvent.addEventListener(PT.prototype._intervalsChanged,this)}Object.defineProperties(PT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var ltt=new q;PT.prototype.getValue=function(e,t){l(e)||(e=q.now(ltt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};PT.prototype.equals=function(e){return this===e||e instanceof PT&&this._intervals.equals(e._intervals,J.equals)};PT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var t0=PT;var Wdi=_(T(),1);var _di=_(T(),1);function TV(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(TV.prototype,{isConstant:{get:function(){return J.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var dtt=new m,Nfe=new m,kfe=new q,utt=new q,OQ=1/60;TV.prototype.getValue=function(e,t){return this._getValue(e,t)};TV.prototype._getValue=function(e,t,n){l(e)||(e=q.now(utt)),l(t)||(t=new m);let i=this._position;if(J.isConstant(i))return this._normalize?void 0:m.clone(m.ZERO,t);let o=i.getValue(e,dtt),r=i.getValue(q.addSeconds(e,OQ,kfe),Nfe);if(!l(o)||!l(r)&&(r=o,o=i.getValue(q.addSeconds(e,-OQ,kfe),Nfe),!l(o)))return;if(m.equals(o,r))return this._normalize?void 0:m.clone(m.ZERO,t);l(n)&&o.clone(n);let s=m.subtract(r,o,t);return this._normalize?m.normalize(s,t):m.divideByScalar(s,OQ,t)};TV.prototype.equals=function(e){return this===e||e instanceof TV&&J.equals(this._position,e._position)};var n0=TV;function Av(e,t){this._velocityVectorProperty=new n0(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=t??ne.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(Av.prototype,{isConstant:{get:function(){return J.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var Ufe=new m,mtt=new m,Dfe=new $,htt=new q;Av.prototype.getValue=function(e,t){l(e)||(e=q.now(htt));let n=this._velocityVectorProperty._getValue(e,mtt,Ufe);if(l(n))return Ft.rotationMatrixFromPositionVelocity(Ufe,n,this._ellipsoid,Dfe),we.fromRotationMatrix(Dfe,t)};Av.prototype.equals=function(e){return this===e||e instanceof Av&&J.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var Mv=Av;var wdi=_(T(),1);var i0={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};i0.validate=function(e){return e===i0.COMPLETE||e===i0.BELOW_ELLIPSOID_HORIZON||e===i0.ABOVE_ELLIPSOID_HORIZON};i0.toString=function(e){switch(e){case i0.COMPLETE:return"COMPLETE";case i0.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case i0.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new fe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var SV=i0;function hy(){}hy.packedLength=m.packedLength;hy.unpack=m.unpack;hy.pack=m.pack;var BQ;function Nv(e,t){return t[0]==="#"&&(t=BQ+t),$b.fromString(e,t)}function Ofe(e,t,n){if(l(n.reference))return Nv(t,n.reference);if(l(n.velocityReference)){let i=Nv(t,n.velocityReference);switch(e){case m:case hy:return new n0(i,e===hy);case we:return new Mv(i)}}throw new ce(`${JSON.stringify(n)} is not valid CZML.`)}function ftt(e,t){return new jm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Yi=new m,dl=new WI,Ec=new he,vT=new Rn,TU=new we;function ptt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===D.packedLength)return[D.byteToFloat(n[0]),D.byteToFloat(n[1]),D.byteToFloat(n[2]),D.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=D.byteToFloat(n[o+1]),t[o+2]=D.byteToFloat(n[o+2]),t[o+3]=D.byteToFloat(n[o+3]),t[o+4]=D.byteToFloat(n[o+4]);return t}function Bfe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):Re.createIfNeeded(n)}function btt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===le.packedLength)return[X.toRadians(n[0]),X.toRadians(n[1]),X.toRadians(n[2]),X.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=X.toRadians(n[o+1]),t[o+2]=X.toRadians(n[o+2]),t[o+3]=X.toRadians(n[o+3]),t[o+4]=X.toRadians(n[o+4]);return t}function gtt(e){let t=e.length;if(dl.magnitude=1,t===2)return dl.clock=e[0],dl.cone=e[1],m.fromSpherical(dl,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],dl.clock=e[i+1],dl.cone=e[i+2],m.fromSpherical(dl,Yi),n[o+1]=Yi.x,n[o+2]=Yi.y,n[o+3]=Yi.z;return n}function ytt(e){let t=e.length;if(t===3)return dl.clock=e[0],dl.cone=e[1],dl.magnitude=e[2],m.fromSpherical(dl,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],dl.clock=e[i+1],dl.cone=e[i+2],dl.magnitude=e[i+3],m.fromSpherical(dl,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function xtt(e){let t=e.length;if(t===3)return Ec.longitude=e[0],Ec.latitude=e[1],Ec.height=e[2],ne.default.cartographicToCartesian(Ec,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ec.longitude=e[i+1],Ec.latitude=e[i+2],Ec.height=e[i+3],ne.default.cartographicToCartesian(Ec,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function _tt(e){let t=e.length;if(t===3)return Ec.longitude=X.toRadians(e[0]),Ec.latitude=X.toRadians(e[1]),Ec.height=e[2],ne.default.cartographicToCartesian(Ec,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ec.longitude=X.toRadians(e[i+1]),Ec.latitude=X.toRadians(e[i+2]),Ec.height=e[i+3],ne.default.cartographicToCartesian(Ec,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function YQ(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 gtt(o);let r=e.spherical;if(l(r))return ytt(r);let s=e.cartographicRadians;if(l(s))return xtt(s);let a=e.cartographicDegrees;if(l(a))return _tt(a);throw new ce(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Yfe(e,t){m.unpack(e,t,Yi),m.normalize(Yi,Yi),m.pack(Yi,e,t)}function Ttt(e){let t=YQ(e);if(t.length===3)return Yfe(t,0),t;for(let n=1;n<t.length;n+=4)Yfe(t,n);return t}function zfe(e,t){we.unpack(e,t,TU),we.normalize(TU,TU),we.pack(TU,e,t)}function Stt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return zfe(t,0),t;for(let n=1;n<t.length;n+=5)zfe(t,n)}return t}function Hfe(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")?ze:e.hasOwnProperty("cartesian2")?U:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?m:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?hy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?D:e.hasOwnProperty("arcType")?on:e.hasOwnProperty("classificationType")?On:e.hasOwnProperty("colorBlendMode")?Cc:e.hasOwnProperty("cornerType")?vi:e.hasOwnProperty("heightReference")?Ke:e.hasOwnProperty("horizontalOrigin")?_i:e.hasOwnProperty("date")?q:e.hasOwnProperty("labelStyle")?Oo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Ot:e.hasOwnProperty("distanceDisplayCondition")?At:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?we:e.hasOwnProperty("shadowMode")?Cn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Ch:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?le:e.hasOwnProperty("uri")?Uv.default:e.hasOwnProperty("verticalOrigin")?Mn:Object}function Ctt(e,t,n){switch(e){case on:return on[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case ze:return t.boundingRectangle;case U:return t.cartesian2;case m:return YQ(t);case hy:return Ttt(t);case D:return ptt(t);case On:return On[t.classificationType??t];case Cc:return Cc[t.colorBlendMode??t];case vi:return vi[t.cornerType??t];case Ke:return Ke[t.heightReference??t];case _i:return _i[t.horizontalOrigin??t];case Image:return Bfe(t,n);case q:return q.fromIso8601(t.date??t);case Oo:return Oo[t.labelStyle??t];case Number:return t.number??t;case Ot:return t.nearFarScalar;case At:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case we:return Stt(t);case $u:return t.number??t;case SV:return SV[t.portionToDisplay??t];case Cn:return Cn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Ch:return Ch[t.stripeOrientation??t];case le:return btt(t);case Uv.default:return Bfe(t,n);case Mn:return Mn[t.verticalOrigin??t];default:throw new ce(`Unknown CzmlDataSource interval type: ${e}`)}}var Vtt={HERMITE:rI,LAGRANGE:uI,LINEAR:jx};function SU(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:Vtt[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=yd[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=yd[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Kfe={iso8601:void 0};function pr(e){if(l(e))return Kfe.iso8601=e,Rn.fromIso8601(Kfe)}function zQ(e){let t=Oe.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Jfe(e){let t=new Zc;return t.intervals.addInterval(zQ(e)),t}function Qfe(e){let t=new Sa(e.referenceFrame);return t.intervals.addInterval(zQ(e)),t}function CU(e,t,n,i,o,r,s){let a=pr(i.interval);l(o)&&(l(a)?a=Rn.intersect(a,o,vT):a=o);let c,d,u,h=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(Oe.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return ape(t[n],a)}let g=!1;if(h){if(d=Ctt(e,i,r),!l(d))return;c=e.packedLength??1,u=d.length??1,g=!l(i.array)&&typeof d!="string"&&u>c&&e!==Object}let f=typeof e.unpack=="function"&&e!==$u;if(!g&&!p){h?t[n]=new jn(f?e.unpack(d,0):d):t[n]=Ofe(e,s,i);return}let y=t[n],x,S=i.epoch;if(l(S)&&(x=q.fromIso8601(S)),g&&!p){y instanceof Ud||(t[n]=y=new Ud(e)),y.addSamplesPackedArray(d,x),SU(i,y);return}let C;if(!g&&p){a=a.clone(),h?a.data=f?e.unpack(d,0):d:a.data=Ofe(e,s,i),l(y)||(t[n]=y=h?new t0:new Zc),h&&y instanceof t0?y.intervals.addInterval(a):y instanceof Zc?(h&&(a.data=new jn(a.data)),y.intervals.addInterval(a)):(t[n]=y=Jfe(y),h&&(a.data=new jn(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new Zc),y instanceof Zc||(t[n]=y=Jfe(y));let V=y.intervals;C=V.findInterval(a),(!l(C)||!(C.data instanceof Ud))&&(C=a.clone(),C.data=new Ud(e),V.addInterval(C)),C.data.addSamplesPackedArray(d,x),SU(i,C.data)}function ape(e,t){if(e instanceof Ud){e.removeSamples(t);return}else if(e instanceof t0){e.intervals.removeInterval(t);return}else if(e instanceof Zc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Rn.intersect(n.get(i),t,vT);o.isEmpty||ape(o.data,t)}n.removeInterval(t);return}}function xe(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)CU(e,t,n,i[a],o,r,s);else CU(e,t,n,i,o,r,s)}function jfe(e,t,n,i,o,r){let s=pr(n.interval);l(i)&&(l(s)?s=Rn.intersect(s,i,vT):s=i);let a=l(n.cartesianVelocity)?1:0,c=m.packedLength*(a+1),d,u,h=!l(n.reference),p=l(s)&&!s.equals(Oe.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return cpe(e[t],s)}let g,f=!1;if(h&&(l(n.referenceFrame)&&(g=Di[n.referenceFrame]),g=g??Di.FIXED,d=YQ(n),u=d.length??1,f=u>c),!f&&!p){h?e[t]=new el(m.unpack(d),g):e[t]=Nv(r,n.reference);return}let y=e[t],x,S=n.epoch;if(l(S)&&(x=q.fromIso8601(S)),f&&!p){(!(y instanceof Ca)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new Ca(g,a)),y.addSamplesPackedArray(d,x),SU(n,y);return}let C;if(!f&&p){s=s.clone(),h?s.data=m.unpack(d):s.data=Nv(r,n.reference),l(y)||(h?y=new e0(g):y=new Sa(g),e[t]=y),h&&y instanceof e0&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof Sa?(h&&(s.data=new el(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=Qfe(y),h&&(s.data=new el(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof Sa||(e[t]=y=Qfe(y)):e[t]=y=new Sa(g);let V=y.intervals;C=V.findInterval(s),(!l(C)||!(C.data instanceof Ca)||l(g)&&C.data.referenceFrame!==g)&&(C=s.clone(),C.data=new Ca(g,a),V.addInterval(C)),C.data.addSamplesPackedArray(d,x),SU(n,C.data)}function cpe(e,t){if(e instanceof Ca){e.removeSamples(t);return}else if(e instanceof e0){e.intervals.removeInterval(t);return}else if(e instanceof Sa){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Rn.intersect(n.get(i),t,vT);o.isEmpty||cpe(o.data,t)}n.removeInterval(t);return}}function lpe(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)jfe(e,t,n[s],i,o,r);else jfe(e,t,n,i,o,r)}function qfe(e,t,n,i){l(n.references)?VU(e,t,n.references,n.interval,i,yV,Zc):(l(n.cartesian2)?n.array=U.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=U.unpackArray(n.cartesian)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i))}function $fe(e,t,n,i,o,r){let s=pr(n.interval);l(i)&&(l(s)?s=Rn.intersect(s,i,vT):s=i);let a=e[t],c,d;if(l(s)){a instanceof rV||(a=new rV,e[t]=a);let h=a.intervals;d=h.findInterval({start:s.start,stop:s.stop}),l(d)?c=d.data:(d=s.clone(),h.addInterval(d))}else c=a;let u;l(n.solidColor)?(c instanceof zt||(c=new zt),u=n.solidColor,xe(D,c,"color",u.color,void 0,void 0,r)):l(n.grid)?(c instanceof dV||(c=new dV),u=n.grid,xe(D,c,"color",u.color,void 0,o,r),xe(Number,c,"cellAlpha",u.cellAlpha,void 0,o,r),xe(U,c,"lineCount",u.lineCount,void 0,o,r),xe(U,c,"lineThickness",u.lineThickness,void 0,o,r),xe(U,c,"lineOffset",u.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Eg||(c=new Eg),u=n.image,xe(Image,c,"image",u.image,void 0,o,r),xe(U,c,"repeat",u.repeat,void 0,o,r),xe(D,c,"color",u.color,void 0,o,r),xe(Boolean,c,"transparent",u.transparent,void 0,o,r)):l(n.stripe)?(c instanceof _V||(c=new _V),u=n.stripe,xe(Ch,c,"orientation",u.orientation,void 0,o,r),xe(D,c,"evenColor",u.evenColor,void 0,o,r),xe(D,c,"oddColor",u.oddColor,void 0,o,r),xe(Number,c,"offset",u.offset,void 0,o,r),xe(Number,c,"repeat",u.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof dy||(c=new dy),u=n.polylineOutline,xe(D,c,"color",u.color,void 0,o,r),xe(D,c,"outlineColor",u.outlineColor,void 0,o,r),xe(Number,c,"outlineWidth",u.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof bV||(c=new bV),u=n.polylineGlow,xe(D,c,"color",u.color,void 0,o,r),xe(Number,c,"glowPower",u.glowPower,void 0,o,r),xe(Number,c,"taperPower",u.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof mV||(c=new mV),u=n.polylineArrow,xe(D,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof fV||(c=new fV),u=n.polylineDash,xe(D,c,"color",u.color,void 0,void 0,r),xe(D,c,"gapColor",u.gapColor,void 0,void 0,r),xe(Number,c,"dashLength",u.dashLength,void 0,o,r),xe(Number,c,"dashPattern",u.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof iV||(c=new iV),u=n.checkerboard,xe(D,c,"evenColor",u.evenColor,void 0,o,r),xe(D,c,"oddColor",u.oddColor,void 0,o,r),xe(U,c,"repeat",u.repeat,void 0,o,r)),l(d)?d.data=c:e[t]=c}function Dd(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)$fe(e,t,n[s],i,o,r);else $fe(e,t,n,i,o,r)}function Ltt(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function Rtt(e,t,n,i){let o=t.description;l(o)&&xe(String,e,"description",o,void 0,i,n)}function Ztt(e,t,n,i){let o=t.position;l(o)&&lpe(e,"position",o,void 0,i,n)}function Gtt(e,t,n,i){let o=t.viewFrom;l(o)&&xe(m,e,"viewFrom",o,void 0,i,n)}function Ett(e,t,n,i){let o=t.orientation;l(o)&&xe(we,e,"orientation",o,void 0,i,n)}function Itt(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new nl);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)CU(Hfe(s[a]),e.properties,r,s[a],void 0,i,n);else CU(Hfe(s),e.properties,r,s,void 0,i,n)}}}function VU(e,t,n,i,o,r,s){let a=n.map(function(c){return Nv(o,c)});if(l(i)){i=pr(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(zQ(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function epe(e,t,n,i){let o=n.references;l(o)?VU(e,t,o,n.interval,i,yV,Zc):xe(Array,e,t,n,void 0,void 0,i)}function tpe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)epe(e,t,n[o],i);else epe(e,t,n,i)}function npe(e,t,n,i){let o=n.references;l(o)?VU(e,t,o,n.interval,i,qb,Sa):(l(n.cartesian)?n.array=m.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=m.fromRadiansArrayHeights(n.cartographicRadians,ne.default):l(n.cartographicDegrees)&&(n.array=m.fromDegreesArrayHeights(n.cartographicDegrees,ne.default)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i))}function Dv(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)npe(e,t,n[o],i);else npe(e,t,n,i)}function Xtt(e){return m.unpackArray(e)}function Wtt(e){return m.fromRadiansArrayHeights(e,ne.default)}function Ptt(e){return m.fromDegreesArrayHeights(e,ne.default)}function ipe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return VU(a,"positions",s,n.interval,i,qb,Sa),a.positions});e[t]=new qb(r)}else l(n.cartesian)?n.array=n.cartesian.map(Xtt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(Wtt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(Ptt)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i)}function vtt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)ipe(e,t,n[o],i);else ipe(e,t,n,i)}function wtt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)qfe(e,t,n[o],i);else qfe(e,t,n,i)}function Ftt(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new Or),r.addInterval(pr(o[s]));else r=new Or,r.addInterval(pr(o));e.availability=r}function Att(e,t,n,i,o){l(t)&&xe(hy,e,"alignedAxis",t,n,i,o)}function Mtt(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=pr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new gc),xe(Boolean,s,"show",o.show,r,i,n),xe(Image,s,"image",o.image,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(U,s,"pixelOffset",o.pixelOffset,r,i,n),xe(m,s,"eyeOffset",o.eyeOffset,r,i,n),xe(_i,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),xe(Mn,s,"verticalOrigin",o.verticalOrigin,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(D,s,"color",o.color,r,i,n),xe($u,s,"rotation",o.rotation,r,i,n),Att(s,o.alignedAxis,r,i,n),xe(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Ot,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(Ot,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(Ot,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),xe(ze,s,"imageSubRegion",o.imageSubRegion,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Ntt(e,t,n,i){let o=t.box;if(!l(o))return;let r=pr(o.interval),s=e.box;l(s)||(e.box=s=new R_),xe(Boolean,s,"show",o.show,r,i,n),xe(m,s,"dimensions",o.dimensions,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Dd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function ktt(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=pr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new G_),xe(Boolean,s,"show",o.show,r,i,n),Dv(s,"positions",o.positions,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe(vi,s,"cornerType",o.cornerType,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Dd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(On,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function Utt(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=pr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new E_),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"length",o.length,r,i,n),xe(Number,s,"topRadius",o.topRadius,r,i,n),xe(Number,s,"bottomRadius",o.bottomRadius,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Dd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),xe(Number,s,"slices",o.slices,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Dtt(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 ce("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new ce("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 Ott(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=pr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new I_),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),xe(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe($u,s,"rotation",o.rotation,r,i,n),xe($u,s,"stRotation",o.stRotation,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Dd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(On,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function Btt(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=pr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new X_),xe(Boolean,s,"show",o.show,r,i,n),xe(m,s,"radii",o.radii,r,i,n),xe(m,s,"innerRadii",o.innerRadii,r,i,n),xe(Number,s,"minimumClock",o.minimumClock,r,i,n),xe(Number,s,"maximumClock",o.maximumClock,r,i,n),xe(Number,s,"minimumCone",o.minimumCone,r,i,n),xe(Number,s,"maximumCone",o.maximumCone,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Dd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"stackPartitions",o.stackPartitions,r,i,n),xe(Number,s,"slicePartitions",o.slicePartitions,r,i,n),xe(Number,s,"subdivisions",o.subdivisions,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Ytt(e,t,n,i){let o=t.label;if(!l(o))return;let r=pr(o.interval),s=e.label;l(s)||(e.label=s=new Km),xe(Boolean,s,"show",o.show,r,i,n),xe(String,s,"text",o.text,r,i,n),xe(String,s,"font",o.font,r,i,n),xe(Oo,s,"style",o.style,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(Boolean,s,"showBackground",o.showBackground,r,i,n),xe(D,s,"backgroundColor",o.backgroundColor,r,i,n),xe(U,s,"backgroundPadding",o.backgroundPadding,r,i,n),xe(U,s,"pixelOffset",o.pixelOffset,r,i,n),xe(m,s,"eyeOffset",o.eyeOffset,r,i,n),xe(_i,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),xe(Mn,s,"verticalOrigin",o.verticalOrigin,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(D,s,"fillColor",o.fillColor,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Ot,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(Ot,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),xe(Ot,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function ztt(e,t,n,i){let o=t.model;if(!l(o))return;let r=pr(o.interval),s=e.model;l(s)||(e.model=s=new ab),xe(Boolean,s,"show",o.show,r,i,n),xe(Uv.default,s,"uri",o.gltf,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),xe(Number,s,"maximumScale",o.maximumScale,r,i,n),xe(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),xe(Boolean,s,"runAnimations",o.runAnimations,r,i,n),xe(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(D,s,"silhouetteColor",o.silhouetteColor,r,i,n),xe(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),xe(D,s,"color",o.color,r,i,n),xe(Cc,s,"colorBlendMode",o.colorBlendMode,r,i,n),xe(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,d=o.nodeTransformations;if(l(d))if(Array.isArray(d))for(a=0,c=d.length;a<c;++a)ope(s,d[a],r,i,n);else ope(s,d,r,i,n);let u=o.articulations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)rpe(s,u[a],r,i,n);else rpe(s,u,r,i,n)}function ope(e,t,n,i,o){let r=pr(t.interval);l(n)&&(l(r)?r=Rn.intersect(r,n,vT):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let h=t[u];if(!l(h))continue;l(s)||(e.nodeTransformations=s=new nl),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new W_),xe(m,p,"translation",h.translation,r,i,o),xe(we,p,"rotation",h.rotation,r,i,o),xe(m,p,"scale",h.scale,r,i,o)}}function rpe(e,t,n,i,o){let r=pr(t.interval);l(n)&&(l(r)?r=Rn.intersect(r,n,vT):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let h=t[u];l(h)&&(l(s)||(e.articulations=s=new nl),s.hasProperty(u)||s.addProperty(u),xe(Number,s,u,h,r,i,o))}}function Htt(e,t,n,i){let o=t.path;if(!l(o))return;let r=pr(o.interval),s=e.path;l(s)||(e.path=s=new cb),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"leadTime",o.leadTime,r,i,n),xe(Number,s,"trailTime",o.trailTime,r,i,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"resolution",o.resolution,r,i,n),Dd(s,"material",o.material,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Ktt(e,t,n,i){let o=t.point;if(!l(o))return;let r=pr(o.interval),s=e.point;l(s)||(e.point=s=new v_),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"pixelSize",o.pixelSize,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(D,s,"color",o.color,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Ot,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(Ot,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function kv(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(kv.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}}});kv.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 Na(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Na(n,i)};kv.prototype.equals=function(e){return this===e||e instanceof kv&&J.equals(this.polygon._positions,e.polygon._positions)&&J.equals(this.polygon._holes,e.polygon._holes)};function Jtt(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=pr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Jm),xe(Boolean,s,"show",o.show,r,i,n),Dv(s,"_positions",o.positions,n),vtt(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new kv(s)),xe(Number,s,"height",o.height,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe($u,s,"stRotation",o.stRotation,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Dd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),xe(Boolean,s,"closeTop",o.closeTop,r,i,n),xe(Boolean,s,"closeBottom",o.closeBottom,r,i,n),xe(on,s,"arcType",o.arcType,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(On,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function Qtt(e){return e?on.GEODESIC:on.NONE}function jtt(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=pr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new xc),xe(Boolean,s,"show",o.show,r,i,n),Dv(s,"positions",o.positions,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),Dd(s,"material",o.material,r,i,n),Dd(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),xe(on,s,"arcType",o.arcType,r,i,n),xe(Boolean,s,"clampToGround",o.clampToGround,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(On,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};xe(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=ftt(a.followSurface,Qtt)}}function qtt(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=pr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new w_),Dv(s,"positions",o.positions,n),wtt(s,"shape",o.shape,n),xe(Boolean,s,"show",o.show,r,i,n),xe(vi,s,"cornerType",o.cornerType,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Dd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function $tt(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=pr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Qm),xe(Boolean,s,"show",o.show,r,i,n),xe(le,s,"coordinates",o.coordinates,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Ke,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe($u,s,"rotation",o.rotation,r,i,n),xe($u,s,"stRotation",o.stRotation,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Dd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(On,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function ent(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=pr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new P_),xe(Boolean,s,"show",o.show,r,i,n),xe(Uv.default,s,"uri",o.uri,r,i,n),xe(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function tnt(e,t,n,i){let o=t.wall;if(!l(o))return;let r=pr(o.interval),s=e.wall;l(s)||(e.wall=s=new lb),xe(Boolean,s,"show",o.show,r,i,n),Dv(s,"positions",o.positions,n),tpe(s,"minimumHeights",o.minimumHeights,n),tpe(s,"maximumHeights",o.maximumHeights,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Dd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(D,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function spe(e,t,n,i,o){let r=e.id;if(l(r)||(r=Hn()),BQ=r,!l(o._version)&&r!=="document")throw new ce("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")Dtt(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}BQ=void 0}function nnt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Oe.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=q.secondsDifference(s,r),c=Math.round(a/120);return t=new Sh,t.startTime=q.clone(r),t.stopTime=q.clone(s),t.clockRange=Mr.LOOP_STOP,t.multiplier=c,t.currentTime=q.clone(r),t.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Sh,t.startTime=Oe.MINIMUM_VALUE.clone(),t.stopTime=Oe.MAXIMUM_VALUE.clone(),t.currentTime=Oe.MINIMUM_VALUE.clone(),t.clockRange=Mr.LOOP_STOP,t.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=pr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=q.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=Mr[n.range]??Mr.LOOP_STOP),l(n.step)&&(t.clockStep=yo[n.step]??yo.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function dpe(e,t,n,i){n=n??Y.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Gt(s)),e._credit=s,typeof t=="string"||t instanceof Re){t=Re.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return r=Re.createIfNeeded(r),Jr.setLoading(e,!0),Promise.resolve(o).then(function(a){return int(e,a,r,i)}).catch(function(a){return Jr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function int(e,t,n,i){Jr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new upe,o.removeAll()),Ss._processCzml(t,o,n,void 0,e);let r=nnt(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=Yp(n.getUrlComponent()),r=!0),Jr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function upe(){this.name=void 0,this.clock=void 0}function Ss(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._clock=void 0,this._documentPacket=new upe,this._version=void 0,this._entityCollection=new oa(this),this._entityCluster=new Md,this._credit=void 0,this._resourceCredits=[]}Ss.load=function(e,t){return new Ss().load(e,t)};Object.defineProperties(Ss.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}}});Ss.updaters=[Mtt,Ntt,ktt,Utt,Ott,Btt,Ytt,ztt,Ltt,Rtt,Htt,Ktt,Jtt,jtt,qtt,Itt,$tt,Ztt,ent,Gtt,tnt,Ett,Ftt];Ss.registerUpdater=function(e){Ss.updaters.includes(e)||Ss.updaters.push(e)};Ss.unregisterUpdater=function(e){if(Ss.updaters.includes(e)){let t=Ss.updaters.indexOf(e);Ss.updaters.splice(t,1)}};Ss.prototype.process=function(e,t){return dpe(this,e,t,!1)};Ss.prototype.load=function(e,t){return dpe(this,e,t,!0)};Ss.prototype.update=function(e){return!0};Ss.processPacketData=xe;Ss.processPositionPacketData=lpe;Ss.processMaterialPacketData=Dd;Ss._processCzml=function(e,t,n,i,o){if(i=i??Ss.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)spe(e[r],t,i,n,o);else spe(e,t,i,n,o)};var Ov=Ss;var Lmi=_(T(),1);function ul(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(ul.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}}});ul.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})};ul.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};ul.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=[]};ul.prototype.contains=function(e){return this.indexOf(e)!==-1};ul.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};ul.prototype.get=function(e){return this._dataSources[e]};ul.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function LU(e,t){return e.indexOf(t)}function mpe(e,t,n){let i=e._dataSources,o=i.length-1;if(t=X.clamp(t,0,o),n=X.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}ul.prototype.raise=function(e){let t=LU(this._dataSources,e);mpe(this,t,t+1)};ul.prototype.lower=function(e){let t=LU(this._dataSources,e);mpe(this,t,t-1)};ul.prototype.raiseToTop=function(e){let t=LU(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))};ul.prototype.lowerToBottom=function(e){let t=LU(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};ul.prototype.isDestroyed=function(){return!1};ul.prototype.destroy=function(){return this.removeAll(!0),me(this)};var Bv=ul;var Oxi=_(T(),1);var Ami=_(T(),1);var Wmi=_(T(),1);function Va(e){e=e??Y.EMPTY_OBJECT,this._primitives=[],this._guid=Hn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0}Object.defineProperties(Va.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});Va.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._primitiveAdded.raiseEvent(e),e};Va.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};Va.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};Va.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};Va.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function RU(e,t){return e._primitives.indexOf(t)}Va.prototype.raise=function(e){if(l(e)){let t=RU(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};Va.prototype.raiseToTop=function(e){if(l(e)){let t=RU(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};Va.prototype.lower=function(e){if(l(e)){let t=RU(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};Va.prototype.lowerToBottom=function(e){if(l(e)){let t=RU(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};Va.prototype.get=function(e){return this._primitives[e]};Va.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};Va.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)}};Va.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)}};Va.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)}};Va.prototype.isDestroyed=function(){return!1};Va.prototype.destroy=function(){return this.removeAll(),me(this)};var ml=Va;function Af(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Af.prototype,{length:{get:function(){return this._length}}});Af.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new ml({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};Af.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Af.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};Af.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};Af.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Af.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Af.prototype.isDestroyed=function(){return!1};Af.prototype.destroy=function(){return this.removeAll(),me(this)};var Yv=Af;var k0i=_(T(),1);var Dmi=_(T(),1);function CV(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new It}CV.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};CV.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};CV.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};CV.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};CV.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):ut.FAILED};var wT=CV;var ebi=_(T(),1);var uhi=_(T(),1);var hpe=new D,fpe=m.ZERO,ppe=new m,bpe=new le;function ont(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 Vh(e,t){zn.call(this,{entity:e,scene:t,geometryOptions:new ont(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Vh.prototype=Object.create(zn.prototype),Vh.prototype.constructor=Vh);Vh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,hpe)),l(o)||(o=D.WHITE),i.color=Kt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,fpe,ppe))),new Xt({id:t,geometry:new Hc(this._options),attributes:i})};Vh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,hpe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,fpe,ppe))),new Xt({id:t,geometry:new fd(this._options),attributes:r})};Vh.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Vh.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||ai.prototype._isHidden.call(this,e,t)};Vh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!J.isConstant(t.rotation)||!J.isConstant(t.height)||!J.isConstant(t.extrudedHeight)||!J.isConstant(t.granularity)||!J.isConstant(t.stRotation)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.numberOfVerticalLines)||!J.isConstant(t.zIndex)||this._onTerrain&&!J.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};Vh.prototype._setStaticOptions=function(e,t){let n=J.getValueOrUndefined(t.height,Oe.MINIMUM_VALUE),i=J.getValueOrDefault(t.heightReference,Oe.MINIMUM_VALUE,Ke.NONE),o=J.getValueOrUndefined(t.extrudedHeight,Oe.MINIMUM_VALUE),r=J.getValueOrDefault(t.extrudedHeightReference,Oe.MINIMUM_VALUE,Ke.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof zt?hn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Oe.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Oe.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Oe.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=J.getValueOrUndefined(t.rotation,Oe.MINIMUM_VALUE),s.granularity=J.getValueOrUndefined(t.granularity,Oe.MINIMUM_VALUE),s.stRotation=J.getValueOrUndefined(t.stRotation,Oe.MINIMUM_VALUE),s.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,Oe.MINIMUM_VALUE),s.offsetAttribute=zn.computeGeometryOffsetAttribute(n,i,o,r),s.height=zn.getGeometryHeight(n,i),o=zn.getGeometryExtrudedHeight(o,r),o===zn.CLAMP_TO_GROUND&&(o=ui.getMinimumMaximumHeights(Hc.computeRectangle(s,bpe)).minimumTerrainHeight),s.extrudedHeight=o};Vh.DynamicGeometryUpdater=VV;function VV(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(VV.prototype=Object.create(si.prototype),VV.prototype.constructor=VV);VV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||si.prototype._isHidden.call(this,e,t,n)};VV.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,Ke.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE);l(s)&&!l(o)&&(o=0),i.center=J.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=J.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=J.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=J.getValueOrUndefined(t.rotation,n),i.granularity=J.getValueOrUndefined(t.granularity,n),i.stRotation=J.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=zn.computeGeometryOffsetAttribute(o,r,s,a),i.height=zn.getGeometryHeight(o,r),s=zn.getGeometryExtrudedHeight(s,a),s===zn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(Hc.computeRectangle(i,bpe)).minimumTerrainHeight),i.extrudedHeight=s};var zv=Vh;var Mhi=_(T(),1);var rnt=new zt(D.WHITE),HQ=m.ZERO,KQ=new m,snt=new m,ant=new m,JQ=new D,cnt=new m(1,1,1);function lnt(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 Od(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new lnt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Od.prototype=Object.create(ai.prototype),Od.prototype.constructor=Od);Object.defineProperties(Od.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Od.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new Sn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Dn.fromDistanceDisplayCondition(a),d={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof zt){let u;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,JQ)),l(u)||(u=D.WHITE),r=Kt.fromColor(u),d.color=r}return l(this._options.offsetAttribute)&&(d.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,HQ,KQ))),new Xt({id:i,geometry:new Ks(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:d})};Od.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=J.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,JQ),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Sn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(r),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,HQ,KQ))),new Xt({id:i,geometry:new gd(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Od.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Od.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||ai.prototype._isHidden.call(this,e,t)};Od.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.radii.isConstant||!J.isConstant(t.innerRadii)||!J.isConstant(t.stackPartitions)||!J.isConstant(t.slicePartitions)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.minimumClock)||!J.isConstant(t.maximumClock)||!J.isConstant(t.minimumCone)||!J.isConstant(t.maximumCone)||!J.isConstant(t.subdivisions)};Od.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Oe.MINIMUM_VALUE,Ke.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof zt?hn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Oe.MINIMUM_VALUE,i.radii),i.innerRadii=J.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=J.getValueOrUndefined(t.minimumClock,Oe.MINIMUM_VALUE),i.maximumClock=J.getValueOrUndefined(t.maximumClock,Oe.MINIMUM_VALUE),i.minimumCone=J.getValueOrUndefined(t.minimumCone,Oe.MINIMUM_VALUE),i.maximumCone=J.getValueOrUndefined(t.maximumCone,Oe.MINIMUM_VALUE),i.stackPartitions=J.getValueOrUndefined(t.stackPartitions,Oe.MINIMUM_VALUE),i.slicePartitions=J.getValueOrUndefined(t.slicePartitions,Oe.MINIMUM_VALUE),i.subdivisions=J.getValueOrUndefined(t.subdivisions,Oe.MINIMUM_VALUE),i.offsetAttribute=n!==Ke.NONE?ln.ALL:void 0};Od.prototype._onEntityPropertyChanged=db;Od.DynamicGeometryUpdater=Hv;function Hv(e,t,n){si.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new m,this._material={}}l(Object.create)&&(Hv.prototype=Object.create(si.prototype),Hv.prototype.constructor=Hv);Hv.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!J.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=J.getValueOrUndefined(n.radii,e,snt),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=J.getValueOrDefault(n.fill,e,!0),s=J.getValueOrDefault(n.outline,e,!1),a=J.getValueOrClonedDefault(n.outlineColor,e,D.BLACK,JQ),c=$o.getValue(e,n.material??rnt,this._material),d=J.getValueOrUndefined(n.innerRadii,e,ant),u=J.getValueOrUndefined(n.minimumClock,e),h=J.getValueOrUndefined(n.maximumClock,e),p=J.getValueOrUndefined(n.minimumCone,e),g=J.getValueOrUndefined(n.maximumCone,e),f=J.getValueOrUndefined(n.stackPartitions,e),y=J.getValueOrUndefined(n.slicePartitions,e),x=J.getValueOrUndefined(n.subdivisions,e),S=J.getValueOrDefault(n.outlineWidth,e,1),C=J.getValueOrDefault(n.heightReference,e,Ke.NONE),V=C!==Ke.NONE?ln.ALL:void 0,L=this._scene.mode,Z=L===oe.SCENE3D&&C===Ke.NONE,E=this._options,P=this._geometryUpdater.shadowsProperty.getValue(e),v=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),A=J.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,HQ,KQ);if(!Z||this._lastSceneMode!==L||!l(this._primitive)||E.stackPartitions!==f||E.slicePartitions!==y||l(d)&&!m.equals(E.innerRadii!==d)||E.minimumClock!==u||E.maximumClock!==h||E.minimumCone!==p||E.maximumCone!==g||E.subdivisions!==x||this._lastOutlineWidth!==S||E.offsetAttribute!==V){let R=this._primitives;R.removeAndDestroy(this._primitive),R.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=L,this._lastOutlineWidth=S,E.stackPartitions=f,E.slicePartitions=y,E.subdivisions=x,E.offsetAttribute=V,E.radii=m.clone(Z?cnt:i,E.radii),l(d)?Z?E.innerRadii=m.fromElements(d.x/i.x,d.y/i.y,d.z/i.z,E.innerRadii):E.innerRadii=m.clone(d,E.innerRadii):E.innerRadii=void 0,E.minimumClock=u,E.maximumClock=h,E.minimumCone=p,E.maximumCone=g;let G=new mo({material:c,translucent:c.isTranslucent(),closed:!0});E.vertexFormat=G.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,Z,this._modelMatrix);this._primitive=R.add(new Wn({geometryInstances:I,appearance:G,asynchronous:!1,shadows:P}));let w=this._geometryUpdater.createOutlineGeometryInstance(e,Z,this._modelMatrix);this._outlinePrimitive=R.add(new Wn({geometryInstances:w,appearance:new hn({flat:!0,translucent:w.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(S)}}),asynchronous:!1,shadows:P})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=D.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=v,this._lastOffset=m.clone(A,this._lastOffset)}else if(this._primitive.ready){let R=this._primitive,G=this._outlinePrimitive;R.show=!0,G.show=!0,R.appearance.material=c;let I=this._attributes;l(I)||(I=R.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=Sn.toValue(r,I.show),this._lastShow=r);let w=this._outlineAttributes;l(w)||(w=G.getGeometryInstanceAttributes(t),this._outlineAttributes=w),s!==this._lastOutlineShow&&(w.show=Sn.toValue(s,w.show),this._lastOutlineShow=s),D.equals(a,this._lastOutlineColor)||(w.color=Kt.toValue(a,w.color),D.clone(a,this._lastOutlineColor)),At.equals(v,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=Dn.toValue(v,I.distanceDisplayCondition),w.distanceDisplayCondition=Dn.toValue(v,w.distanceDisplayCondition),At.clone(v,this._lastDistanceDisplayCondition)),m.equals(A,this._lastOffset)||(I.offset=io.toValue(A,I.offset),w.offset=io.toValue(A,I.offset),m.clone(A,this._lastOffset))}Z&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=F.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var Kv=Od;var rfi=_(T(),1);var dnt=new m,gpe=new D;function unt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function nm(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new unt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(nm.prototype=Object.create(ai.prototype),nm.prototype.constructor=nm);nm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Dn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof zt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,gpe)),l(g)||(g=D.WHITE),o=Kt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,d=this._options,u=t.computeModelMatrix(e),h=J.getValueOrDefault(c.plane,e,d.plane),p=J.getValueOrUndefined(c.dimensions,e,d.dimensions);return d.plane=h,d.dimensions=p,u=QQ(h,p,u,u),new Xt({id:t,geometry:new gI(this._options),modelMatrix:u,attributes:i})};nm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,gpe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=J.getValueOrDefault(r.plane,e,s.plane),d=J.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=d,a=QQ(c,d,a,a),new Xt({id:t,geometry:new yI,modelMatrix:a,attributes:{show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o)}})};nm.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||ai.prototype._isHidden.call(this,e,t)};nm.prototype._getIsClosed=function(e){return!1};nm.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!J.isConstant(t.outlineWidth)};nm.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof zt,i=this._options;i.vertexFormat=n?hn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Oe.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Oe.MINIMUM_VALUE,i.dimensions)};nm.DynamicGeometryUpdater=LV;function LV(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(LV.prototype=Object.create(si.prototype),LV.prototype.constructor=LV);LV.prototype._isHidden=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(e.position,n,dnt);return!l(o)||!l(i.plane)||!l(i.dimensions)||si.prototype._isHidden.call(this,e,t,n)};LV.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=J.getValueOrDefault(t.plane,n,i.plane),i.dimensions=J.getValueOrUndefined(t.dimensions,n,i.dimensions)};var mnt=new m,hnt=new m,fnt=new m,pnt=new m,bnt=new $,gnt=new $,ynt=new F;function QQ(e,t,n,i){let o=e.normal,r=e.distance,s=m.multiplyByScalar(o,-r,fnt),a=m.clone(m.UNIT_Z,hnt);X.equalsEpsilon(Math.abs(m.dot(a,o)),1,X.EPSILON8)&&(a=m.clone(m.UNIT_Y,a));let c=m.cross(a,o,mnt);a=m.cross(o,c,a),m.normalize(c,c),m.normalize(a,a);let d=bnt;$.setColumn(d,0,c,d),$.setColumn(d,1,a,d),$.setColumn(d,2,o,d);let u=m.fromElements(t.x,t.y,1,pnt),h=$.multiplyByScale(d,u,gnt),p=F.fromRotationTranslation(h,s,ynt);return F.multiplyTransformation(n,p,i)}nm.createPrimitiveMatrix=QQ;var Jv=nm;var vfi=_(T(),1);var ype="Entity polygons cannot have both height and perPositionHeight. height will be ignored",xpe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",_pe=new D,Tpe=m.ZERO,Spe=new m,Cpe=new le,xnt=[],_nt=new U;function Tnt(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 Bd(e,t){zn.call(this,{entity:e,scene:t,geometryOptions:new Tnt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Bd.prototype=Object.create(zn.prototype),Bd.prototype.constructor=Bd);Bd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,_pe)),l(s)||(s=D.WHITE),o.color=Kt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Tpe,Spe)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new vE(i):r=new jp(i),new Xt({id:t,geometry:r,attributes:o})};Bd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=J.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,_pe),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(o),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Tpe,Spe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Vu(i):a=new xI(i),new Xt({id:t,geometry:a,attributes:s})};Bd.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=$r.fromPoints(i,o),s=r.projectPointsOntoPlane(i,xnt),a=s.length,c=0,d=a-1,u=new U;for(let p=0;p<a;d=p++){let g=s[p],f=s[d],y=g.x*f.y-f.x*g.y,x=U.add(g,f,_nt);x=U.multiplyByScalar(x,y,x),u=U.add(u,x,u),c+=y}let h=1/(c*3);return u=U.multiplyByScalar(u,h,u),r.projectPointOntoEllipsoid(u,t)};Bd.prototype._isHidden=function(e,t){return!l(t.hierarchy)||ai.prototype._isHidden.call(this,e,t)};Bd.prototype._isOnTerrain=function(e,t){let n=zn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Oe.MINIMUM_VALUE):!0);return n&&!o};Bd.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!J.isConstant(t.height)||!J.isConstant(t.extrudedHeight)||!J.isConstant(t.granularity)||!J.isConstant(t.stRotation)||!J.isConstant(t.textureCoordinates)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.perPositionHeight)||!J.isConstant(t.closeTop)||!J.isConstant(t.closeBottom)||!J.isConstant(t.zIndex)||!J.isConstant(t.arcType)||this._onTerrain&&!J.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};Bd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof zt,i=this._options;i.vertexFormat=n?hn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Oe.MINIMUM_VALUE),r=J.getValueOrUndefined(t.height,Oe.MINIMUM_VALUE),s=J.getValueOrDefault(t.heightReference,Oe.MINIMUM_VALUE,Ke.NONE),a=J.getValueOrUndefined(t.extrudedHeight,Oe.MINIMUM_VALUE),c=J.getValueOrDefault(t.extrudedHeightReference,Oe.MINIMUM_VALUE,Ke.NONE),d=J.getValueOrDefault(t.perPositionHeight,Oe.MINIMUM_VALUE,!1);r=zn.getGeometryHeight(r,s);let u;if(d?(l(r)&&(r=void 0,Vt(ype)),s!==Ke.NONE&&d&&(r=void 0,Vt(xpe))):(l(a)&&!l(r)&&(r=0),u=zn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=J.getValueOrUndefined(t.granularity,Oe.MINIMUM_VALUE),i.stRotation=J.getValueOrUndefined(t.stRotation,Oe.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=J.getValueOrDefault(t.closeTop,Oe.MINIMUM_VALUE,!0),i.closeBottom=J.getValueOrDefault(t.closeBottom,Oe.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=J.getValueOrDefault(t.arcType,Oe.MINIMUM_VALUE,on.GEODESIC),i.textureCoordinates=J.getValueOrUndefined(t.textureCoordinates,Oe.MINIMUM_VALUE),a=zn.getGeometryExtrudedHeight(a,c),a===zn.CLAMP_TO_GROUND){let h=jp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Cpe);a=ui.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=a};Bd.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)};Bd.DynamicGeometryUpdater=RV;function RV(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(RV.prototype=Object.create(si.prototype),RV.prototype.constructor=RV);RV.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||si.prototype._isHidden.call(this,e,t,n)};RV.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=J.getValueOrUndefined(t.hierarchy,n);let o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,Ke.NONE),s=J.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE),a=J.getValueOrUndefined(t.extrudedHeight,n),c=J.getValueOrUndefined(t.perPositionHeight,n);o=zn.getGeometryHeight(o,s);let d;if(c?(l(o)&&(o=void 0,Vt(ype)),r!==Ke.NONE&&c&&(o=void 0,Vt(xpe))):(l(a)&&!l(o)&&(o=0),d=zn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=J.getValueOrUndefined(t.granularity,n),i.stRotation=J.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=J.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=J.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=J.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=J.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=d,i.height=o,i.arcType=J.getValueOrDefault(t.arcType,n,on.GEODESIC),a=zn.getGeometryExtrudedHeight(a,s),a===zn.CLAMP_TO_GROUND){let u=jp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Cpe);a=ui.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var Qv=Bd;var jfi=_(T(),1);var Vpe=new D;function Snt(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 Mf(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new Snt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Mf.prototype=Object.create(ai.prototype),Mf.prototype.constructor=Mf);Mf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Dn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof zt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Vpe)),l(c)||(c=D.WHITE),o=Kt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Xt({id:t,geometry:new CI(this._options),attributes:i})};Mf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,Vpe),o=this._distanceDisplayConditionProperty.getValue(e);return new Xt({id:t,geometry:new RI(this._options),attributes:{show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o)}})};Mf.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||ai.prototype._isHidden.call(this,e,t)};Mf.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!J.isConstant(t.granularity)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.cornerType)};Mf.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof zt;o.vertexFormat=r?hn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Oe.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Oe.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Oe.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Oe.MINIMUM_VALUE):void 0};Mf.DynamicGeometryUpdater=ZV;function ZV(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(ZV.prototype=Object.create(si.prototype),ZV.prototype.constructor=ZV);ZV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||si.prototype._isHidden.call(this,e,t,n)};ZV.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=J.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=J.getValueOrUndefined(t.shape,n),i.granularity=J.getValueOrUndefined(t.granularity,n),i.cornerType=J.getValueOrUndefined(t.cornerType,n)};var jv=Mf;var Spi=_(T(),1);var Lpe=new D,Rpe=m.ZERO,Zpe=new m,Gpe=new le,Cnt=new le,Vnt=new he;function Lnt(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){zn.call(this,{entity:e,scene:t,geometryOptions:new Lnt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Lh.prototype=Object.create(zn.prototype),Lh.prototype.constructor=Lh);Lh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Lpe)),l(o)||(o=D.WHITE),i.color=Kt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Rpe,Zpe))),new Xt({id:t,geometry:new r_(this._options),attributes:i})};Lh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,Lpe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=io.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Rpe,Zpe))),new Xt({id:t,geometry:new s_(this._options),attributes:r})};Lh.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.rectangle.coordinates,e,Cnt);if(!l(n))return;let i=le.center(n,Vnt);return he.toCartesian(i,ne.default,t)};Lh.prototype._isHidden=function(e,t){return!l(t.coordinates)||ai.prototype._isHidden.call(this,e,t)};Lh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!J.isConstant(t.height)||!J.isConstant(t.extrudedHeight)||!J.isConstant(t.granularity)||!J.isConstant(t.stRotation)||!J.isConstant(t.rotation)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.zIndex)||this._onTerrain&&!J.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};Lh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof zt,i=J.getValueOrUndefined(t.height,Oe.MINIMUM_VALUE),o=J.getValueOrDefault(t.heightReference,Oe.MINIMUM_VALUE,Ke.NONE),r=J.getValueOrUndefined(t.extrudedHeight,Oe.MINIMUM_VALUE),s=J.getValueOrDefault(t.extrudedHeightReference,Oe.MINIMUM_VALUE,Ke.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?hn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Oe.MINIMUM_VALUE,a.rectangle),a.granularity=J.getValueOrUndefined(t.granularity,Oe.MINIMUM_VALUE),a.stRotation=J.getValueOrUndefined(t.stRotation,Oe.MINIMUM_VALUE),a.rotation=J.getValueOrUndefined(t.rotation,Oe.MINIMUM_VALUE),a.offsetAttribute=zn.computeGeometryOffsetAttribute(i,o,r,s),a.height=zn.getGeometryHeight(i,o),r=zn.getGeometryExtrudedHeight(r,s),r===zn.CLAMP_TO_GROUND&&(r=ui.getMinimumMaximumHeights(r_.computeRectangle(a,Gpe)).minimumTerrainHeight),a.extrudedHeight=r};Lh.DynamicGeometryUpdater=GV;function GV(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(GV.prototype=Object.create(si.prototype),GV.prototype.constructor=GV);GV.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||si.prototype._isHidden.call(this,e,t,n)};GV.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,Ke.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=J.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=J.getValueOrUndefined(t.granularity,n),i.stRotation=J.getValueOrUndefined(t.stRotation,n),i.rotation=J.getValueOrUndefined(t.rotation,n),i.offsetAttribute=zn.computeGeometryOffsetAttribute(o,r,s,a),i.height=zn.getGeometryHeight(o,r),s=zn.getGeometryExtrudedHeight(s,a),s===zn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(r_.computeRectangle(i,Gpe)).minimumTerrainHeight),i.extrudedHeight=s};var qv=Lh;var Npi=_(T(),1);var Epe=new D;function Rnt(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 Rh(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new Rnt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Rh.prototype=Object.create(ai.prototype),Rh.prototype.constructor=Rh);Rh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Dn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof zt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Epe)),l(c)||(c=D.WHITE),o=Kt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Xt({id:t,geometry:new MI(this._options),attributes:i})};Rh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,D.BLACK,Epe),o=this._distanceDisplayConditionProperty.getValue(e);return new Xt({id:t,geometry:new kI(this._options),attributes:{show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o)}})};Rh.prototype._isHidden=function(e,t){return!l(t.positions)||ai.prototype._isHidden.call(this,e,t)};Rh.prototype._getIsClosed=function(e){return!1};Rh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!J.isConstant(t.minimumHeights)||!J.isConstant(t.maximumHeights)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.granularity)};Rh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof zt,s=this._options;s.vertexFormat=r?hn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Oe.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(Oe.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(Oe.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(Oe.MINIMUM_VALUE):void 0};Rh.DynamicGeometryUpdater=EV;function EV(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(EV.prototype=Object.create(si.prototype),EV.prototype.constructor=EV);EV.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||si.prototype._isHidden.call(this,e,t,n)};EV.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=J.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=J.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=J.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=J.getValueOrUndefined(t.granularity,n)};var $v=Rh;var FT=[HX,Fv,Wv,zv,Kv,Jv,Qv,jv,qv,$v];function AT(e,t){this.entity=e,this.scene=t;let n=new Array(FT.length),i=new be,o=new dr;for(let r=0;r<n.length;r++){let s=new FT[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(AT.prototype._onEntityPropertyChanged,this)}AT.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)};AT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};AT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),me(this)};AT.registerUpdater=function(e){FT.includes(e)||FT.push(e)};AT.unregisterUpdater=function(e){if(FT.includes(e)){let t=FT.indexOf(e);FT.splice(t,1)}};var MT=AT;var bbi=_(T(),1);var Ipe=new D,Znt=new At,Gnt=new At,Ent=m.ZERO,Int=new m;function Zh(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new It,this.updaters=new It,this.updatersWithAttributes=new It,this.attributes=new It,this.subscriptions=new It,this.showsUpdated=new It,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(Zh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Zh.prototype.onMaterialChanged=function(){this.invalidated=!0};Zh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Zh.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!J.isConstant(e.distanceDisplayConditionProperty)||!J.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Zh.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};Zh.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=$o.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Wn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof zt)&&(this.depthFailMaterial=$o.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),h=this.attributes.get(u.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!d.fillMaterialProperty.isConstant||c){let x=d.fillMaterialProperty.color,S=J.getValueOrDefault(x,e,D.WHITE,Ipe);D.equals(h._lastColor,S)||(h._lastColor=D.clone(S,h._lastColor),h.color=Kt.toValue(S,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=d))}if(l(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof zt&&(!d.depthFailMaterialProperty.isConstant||c)){let x=d.depthFailMaterialProperty.color,S=J.getValueOrDefault(x,e,D.WHITE,Ipe);D.equals(h._lastDepthFailColor,S)||(h._lastDepthFailColor=D.clone(S,h._lastDepthFailColor),h.depthFailColor=Kt.toValue(S,h.depthFailColor))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=Sn.toValue(p,h.show));let f=d.distanceDisplayConditionProperty;if(!J.isConstant(f)){let x=J.getValueOrDefault(f,e,Gnt,Znt);At.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=At.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Dn.toValue(x,h.distanceDisplayCondition))}let y=d.terrainOffsetProperty;if(!J.isConstant(y)){let x=J.getValueOrDefault(y,e,Ent,Int);m.equals(x,h._lastOffset)||(h._lastOffset=m.clone(x,h._lastOffset),h.offset=io.toValue(x,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Zh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Sn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Zh.prototype.contains=function(e){return this.updaters.contains(e.id)};Zh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Zh.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 IV(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}IV.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new Zh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Xpe(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}IV.prototype.remove=function(e){Xpe(this._solidItems,e)||Xpe(this._translucentItems,e)};function Wpe(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let d=a[r];s.remove(d),e.add(n,d),i=!0}}return i}function ZU(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let d=0;d<c;d++)e.add(n,a[d]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}IV.prototype.update=function(e){let t=ZU(this,this._solidItems,e,!0);t=ZU(this,this._translucentItems,e,t)&&t;let n=Wpe(this,this._solidItems,e),i=Wpe(this,this._translucentItems,e);return(n||i)&&(t=ZU(this,this._solidItems,e,t)&&t,t=ZU(this,this._translucentItems,e,t)&&t),t};function Ppe(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return ut.FAILED}IV.prototype.getBoundingSphere=function(e,t){let n=Ppe(this._solidItems,e,t);return n===ut.FAILED?Ppe(this._translucentItems,e,t):n};function vpe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}IV.prototype.removeAllPrimitives=function(){vpe(this._solidItems),vpe(this._translucentItems)};var im=IV;var Wbi=_(T(),1);var Xnt=new At,Wnt=new At,Pnt=m.ZERO,vnt=new m;function Gh(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new It,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new It,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new It,this.attributes=new It,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Gh.prototype.onMaterialChanged,this),this.subscriptions=new It,this.showsUpdated=new It}Gh.prototype.onMaterialChanged=function(){this.invalidated=!0};Gh.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};Gh.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!J.isConstant(t.distanceDisplayConditionProperty)||!J.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};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),this.showsUpdated.remove(t)),!0}return!1};var wnt=new D;Gh.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=$o.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=$o.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Wn({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=$o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof zt)&&(this.depthFailMaterial=$o.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),h=this.attributes.get(u.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof zt&&!c.depthFailMaterialProperty.isConstant){let x=c.depthFailMaterialProperty.color,S=J.getValueOrDefault(x,e,D.WHITE,wnt);D.equals(h._lastDepthFailColor,S)||(h._lastDepthFailColor=D.clone(S,h._lastDepthFailColor),h.depthFailColor=Kt.toValue(S,h.depthFailColor))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=Sn.toValue(p,h.show));let f=c.distanceDisplayConditionProperty;if(!J.isConstant(f)){let x=J.getValueOrDefault(f,e,Wnt,Xnt);At.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=At.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Dn.toValue(x,h.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!J.isConstant(y)){let x=J.getValueOrDefault(y,e,Pnt,vnt);m.equals(x,h._lastOffset)||(h._lastOffset=m.clone(x,h._lastOffset),h.offset=io.toValue(x,h.offset))}}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,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Sn.toValue(c,a.show),s.attributes.show.value[0]=a.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 ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Gh.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 XV(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}XV.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new Gh(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};XV.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};XV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};XV.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};XV.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var om=XV;var Ybi=_(T(),1);var Fnt=new D,Ant=new At,Mnt=new At;function o0(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 It,this.updaters=new It,this.updatersWithAttributes=new It,this.attributes=new It,this.subscriptions=new It,this.showsUpdated=new It,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new o_}o0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};o0.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!J.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};o0.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};o0.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new $c({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),h=this.attributes.get(u.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!d.fillMaterialProperty.isConstant||c){let y=d.fillMaterialProperty.color,x=J.getValueOrDefault(y,e,D.WHITE,Fnt);D.equals(h._lastColor,x)||(h._lastColor=D.clone(x,h._lastColor),h.color=Kt.toValue(x,h.color))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=Sn.toValue(p,h.show));let f=d.distanceDisplayConditionProperty;if(!J.isConstant(f)){let y=J.getValueOrDefault(f,e,Mnt,Ant);At.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=At.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Dn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};o0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Sn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};o0.prototype.contains=function(e){return this.updaters.contains(e.id)};o0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),ut.DONE):ut.FAILED};o0.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 WV(e,t){this._batches=[],this._primitives=e,this._classificationType=t}WV.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=J.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new o0(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};WV.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};WV.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let d=0;d<c;d++){n=a[d],s.remove(n);let u=this.add(e,n);s.isDirty=!0,u.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};WV.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};WV.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var PV=WV;var r0i=_(T(),1);var Nnt=new At,knt=new At;function rm(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new It,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new It,this.material=void 0,this.updatersWithAttributes=new It,this.attributes=new It,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(rm.prototype.onMaterialChanged,this),this.subscriptions=new It,this.showsUpdated=new It,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new o_}rm.prototype.onMaterialChanged=function(){this.invalidated=!0};rm.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};rm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof zt&&t instanceof zt?!0:l(t)&&t.equals(n)};rm.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!J.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};rm.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};rm.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=$o.getValue(e,this.materialProperty,this.material),n=new $c({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=$o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),h=this.attributes.get(u.id.id);l(h)||(h=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h));let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=Sn.toValue(p,h.show));let f=c.distanceDisplayConditionProperty;if(!J.isConstant(f)){let y=J.getValueOrDefault(f,e,knt,Nnt);At.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=At.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Dn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};rm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Sn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};rm.prototype.contains=function(e){return this.updaters.contains(e.id)};rm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};rm.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 vV(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}vV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Cd.shouldUseSphericalCoordinates(o.geometry.rectangle),s=J.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let d=n[c];if(d.isMaterial(t)&&d.usingSphericalTextureCoordinates===r&&d.zIndex===s&&!d.overlapping(o.geometry.rectangle)){d.add(e,t,o);return}}let a=new rm(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};vV.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}}};vV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};vV.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};vV.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 ew=vV;var _0i=_(T(),1);var Unt=new D,Dnt=new At,Ont=new At,Bnt=m.ZERO,Ynt=new m;function r0(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 It,this.updaters=new It,this.updatersWithAttributes=new It,this.attributes=new It,this.itemsToRemove=[],this.subscriptions=new It,this.showsUpdated=new It}r0.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!J.isConstant(e.distanceDisplayConditionProperty)||!J.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};r0.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};r0.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Wn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new hn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),h=this.attributes.get(u.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!d.outlineColorProperty.isConstant||c){let x=d.outlineColorProperty,S=J.getValueOrDefault(x,e,D.WHITE,Unt);D.equals(h._lastColor,S)||(h._lastColor=D.clone(S,h._lastColor),h.color=Kt.toValue(S,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=d))}let p=d.entity.isShowing&&(d.hasConstantOutline||d.isOutlineVisible(e)),g=h.show[0]===1;p!==g&&(h.show=Sn.toValue(p,h.show));let f=d.distanceDisplayConditionProperty;if(!J.isConstant(f)){let x=J.getValueOrDefault(f,e,Ont,Dnt);At.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=At.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Dn.toValue(x,h.distanceDisplayCondition))}let y=d.terrainOffsetProperty;if(!J.isConstant(y)){let x=J.getValueOrDefault(y,e,Bnt,Ynt);m.equals(x,h._lastOffset)||(h._lastOffset=m.clone(x,h._lastOffset),h.offset=io.toValue(x,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};r0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Sn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};r0.prototype.contains=function(e){return this.updaters.contains(e.id)};r0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};r0.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 wV(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new It,this._translucentBatches=new It}wV.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 r0(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 r0(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};wV.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};wV.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,d,u=!0,h=!1;do{for(h=!1,n=0;n<s;n++){o=r[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(h=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(h=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}}while(h);return u};wV.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return ut.FAILED};wV.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 FV=wV;var znt=[];function Hl(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 It,this._removedObjects=new It,this._changedObjects=new It;let o=Cn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=er.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new FV(n,e,s,!1),this._outlineBatches[o+s]=new FV(n,e,s,!0),this._closedColorBatches[s]=new im(n,hn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new im(n,hn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new om(n,mo,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new om(n,mo,void 0,!0,s,!1),this._openColorBatches[s]=new im(n,hn,void 0,!1,s,!0),this._openColorBatches[o+s]=new im(n,hn,void 0,!1,s,!1),this._openMaterialBatches[s]=new om(n,mo,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new om(n,mo,void 0,!1,s,!1);let a=On.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new ew(i,s,mo)),c[s]=new PV(i,s);else for(s=0;s<a;++s)c[s]=new PV(i,s);this._groundColorBatches=c,this._groundMaterialBatches=d,this._dynamicBatch=new wT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new It,this._updaterSets=new It,this._entityCollection=t,t.collectionChanged.addEventListener(Hl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,znt)}Hl.registerUpdater=function(e){MT.registerUpdater(e)};Hl.unregisterUpdater=function(e){MT.unregisterUpdater(e)};Hl.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u,h=this;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaterSets.get(d),u.entity===c?u.forEach(function(y){h._removeUpdater(y),h._insertUpdaterIntoBatch(e,y)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaterSets.get(d),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new MT(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(y){h._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Hl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,f=g.length;for(a=0;a<f;a++)p=g[a].update(e)&&p;return p};var Hnt=[],Knt=new de;Hl.prototype.getBoundingSphere=function(e,t){let n=Hnt,i=Knt,o=0,r=ut.DONE,s=this._batches,a=s.length,c=e.id;if(!this._updaterSets.get(c))return ut.FAILED;let d=this._updaterSets.get(c).updaters;for(let u=0;u<d.length;u++){let h=d[u];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(h,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=de.clone(i,n[o]),o++)}}return o===0?ut.FAILED:(n.length=o,de.fromBoundingSpheres(n,t),ut.DONE)};Hl.prototype.isDestroyed=function(){return!1};Hl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Hl.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),me(this)};Hl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Hl.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Cn.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 zt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof zt?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 zt?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)};Hl._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)};Hl.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var tw=Hl;var ngi=_(T(),1);var Jnt=1,Qnt="30px sans-serif",jnt=Oo.FILL,qnt=D.WHITE,$nt=D.BLACK,eit=1,tit=!1,nit=new D(.165,.165,.165,.8),iit=new U(7,5),oit=U.ZERO,rit=m.ZERO,sit=Ke.NONE,ait=_i.CENTER,cit=Mn.CENTER,lit=new m,dit=new D,uit=new D,mit=new D,hit=new U,fit=new m,pit=new U,bit=new Ot,git=new Ot,yit=new Ot,xit=new At;function wpe(e){this.entity=e,this.label=void 0,this.index=void 0}function fy(e,t){t.collectionChanged.addEventListener(fy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new It,this._onCollectionChanged(t,t.values,[],[])}fy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,d=r.label,u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),h;if(u&&(h=J.getValueOrUndefined(s._position,e,lit),c=J.getValueOrUndefined(a._text,e),u=l(h)&&l(c)),!u){jQ(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=J.getValueOrDefault(a._heightReference,e,sit);l(d)||(d=n.getLabel(s),d.id=s,r.label=d,p=m.equals(d.position,h)&&d.heightReference===g),d.show=!0,d.position=h,d.text=c,d.scale=J.getValueOrDefault(a._scale,e,Jnt),d.font=J.getValueOrDefault(a._font,e,Qnt),d.style=J.getValueOrDefault(a._style,e,jnt),d.fillColor=J.getValueOrDefault(a._fillColor,e,qnt,dit),d.outlineColor=J.getValueOrDefault(a._outlineColor,e,$nt,uit),d.outlineWidth=J.getValueOrDefault(a._outlineWidth,e,eit),d.showBackground=J.getValueOrDefault(a._showBackground,e,tit),d.backgroundColor=J.getValueOrDefault(a._backgroundColor,e,nit,mit),d.backgroundPadding=J.getValueOrDefault(a._backgroundPadding,e,iit,hit),d.pixelOffset=J.getValueOrDefault(a._pixelOffset,e,oit,pit),d.eyeOffset=J.getValueOrDefault(a._eyeOffset,e,rit,fit),d.heightReference=g,d.horizontalOrigin=J.getValueOrDefault(a._horizontalOrigin,e,ait),d.verticalOrigin=J.getValueOrDefault(a._verticalOrigin,e,cit),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,bit),d.pixelOffsetScaleByDistance=J.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,git),d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,yit),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,xit),d.disableDepthTestDistance=J.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};fy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return ut.FAILED;let i=n.label;return t.center=m.clone(i._clampedPosition??i.position,t.center),t.radius=0,ut.DONE};fy.prototype.isDestroyed=function(){return!1};fy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(fy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return me(this)};fy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new wpe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new wpe(r)):(jQ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],jQ(s.get(r.id),r,a),s.remove(r.id)};function jQ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var nw=fy;var Sgi=_(T(),1);var _it=1,Tit=!0,Sit=0,Cit=!0,Vit=!0,Lit=Cn.ENABLED,Rit=Ke.NONE,Zit=D.RED,Git=0,Eit=D.WHITE,Iit=Cc.HIGHLIGHT,Xit=.5,Wit=new U(1,1),Fpe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Pit=new F,vit=new F,Ape=new D,Mpe=new Array(4),wit=new m;function py(e,t){t.collectionChanged.addEventListener(py.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new It,this._onCollectionChanged(t,t.values,[],[])}async function Fit(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await uh.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}py.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),h;if(u&&(h=s.computeModelMatrix(e,Pit),c=Re.createIfNeeded(J.getValueOrUndefined(a._uri,e)),u=l(h)&&l(c)),!u){l(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if(!l(d)||c.url!==d.url){l(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...Fpe}},n[s.id]=d;let f=J.getValueOrDefault(a._incrementallyLoadTextures,e,Cit),y=J.getValueOrDefault(a._environmentMapOptions,e,Fpe,d.environmentMapOptionsScratch);Fit(this,s,c,f,y)}let p=d.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=J.getValueOrDefault(a._scale,e,_it),p.enableVerticalExaggeration=J.getValueOrDefault(a._enableVerticalExaggeration,e,Tit),p.minimumPixelSize=J.getValueOrDefault(a._minimumPixelSize,e,Sit),p.maximumScale=J.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(h,p.modelMatrix),p.shadows=J.getValueOrDefault(a._shadows,e,Lit),p.heightReference=J.getValueOrDefault(a._heightReference,e,Rit),p.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=J.getValueOrDefault(a._silhouetteColor,e,Zit,Ape),p.silhouetteSize=J.getValueOrDefault(a._silhouetteSize,e,Git),p.color=J.getValueOrDefault(a._color,e,Eit,Ape),p.colorBlendMode=J.getValueOrDefault(a._colorBlendMode,e,Iit),p.colorBlendAmount=J.getValueOrDefault(a._colorBlendAmount,e,Xit),p.clippingPlanes=J.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=J.getValueOrDefault(a._clampAnimations,e,Vit),p.imageBasedLighting.imageBasedLightingFactor=J.getValueOrDefault(a._imageBasedLightingFactor,e,Wit);let g=J.getValueOrUndefined(a._lightColor,e);if(l(g)&&(D.pack(g,Mpe,0),g=m.unpack(Mpe,0,wit)),p.lightColor=g,p.customShader=J.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){!a._readyOk&&a._marsOptions&&a._marsOptions.callback&&(a._marsOptions.callback(s,p),a._readyOk=!0);let f=J.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==f&&(f?p.activeAnimations.addAll({loop:Dl.REPEAT}):p.activeAnimations.removeAll(),d.animationsRunning=f);let y=J.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(l(y)){let C=Object.keys(y);for(let V=0,L=C.length;V<L;++V){let Z=C[V],E=y[Z];if(!l(E))continue;let P=p.getNode(Z);if(!l(P))continue;let W=F.fromTranslationRotationScale(E,vit);P.matrix=F.multiply(P.originalMatrix,W,W)}}let x=!1,S=J.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(l(S)){let C=Object.keys(S);for(let V=0,L=C.length;V<L;++V){let Z=C[V],E=S[Z];l(E)&&(x=!0,p.setArticulationStage(Z,E))}}x&&p.applyArticulations()}}return!0};py.prototype.isDestroyed=function(){return!1};py.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(py.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)qQ(this,e[i],t,n);return me(this)};var GU=new m,Ait=new he;py.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return ut.FAILED;if(n.loadFailed)return ut.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return ut.PENDING;if(!i.ready||!n.modelUpdated)return ut.PENDING;let o=this._scene,r=o.ellipsoid??ne.default;if(i.heightReference!==Ke.NONE){let a=i.modelMatrix;GU.x=a[12],GU.y=a[13],GU.z=a[14];let c=r.cartesianToCartographic(GU,Ait),d=o.getHeight(c,i.heightReference);return l(d)&&(Pu(i.heightReference)?c.height=d:c.height+=d),de.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),ut.DONE}return de.clone(i.boundingSphere,t),ut.DONE};py.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(Mit(r,a),s.set(r.id,r)):(qQ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],qQ(this,r,a,c),s.remove(r.id)};function qQ(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Mit(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var iw=py;var $gi=_(T(),1);var Igi=_(T(),1);function by(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(by.prototype,{isConstant:{get:function(){return J.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Di.FIXED}}});var Nit=new q;by.prototype.getValue=function(e,t){return l(e)||(e=q.now(Nit)),this.getValueInReferenceFrame(e,Di.FIXED,t)};by.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))};by.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ne.default.scaleToGeodeticSurface(n,n):void 0};by.prototype.equals=function(e){return this===e||e instanceof by&&this._value===e._value};by.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Nf=by;var kit=60,Uit=1,kpe=new Rn,$Q=new Rn,e4=new Rn;function Npe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function Dit(e,t,n,i,o,r,s,a,c){let d=a,u;u=e.getValueInReferenceFrame(t,r,c[d]),l(u)&&(c[d++]=u);let h=!l(o)||q.lessThanOrEquals(o,t)||q.greaterThanOrEquals(o,n),p=0,g=i.length,f=i[p],y=n,x=!1,S,C,V;for(;p<g;){if(!h&&q.greaterThanOrEquals(f,o)&&(u=e.getValueInReferenceFrame(o,r,c[d]),l(u)&&(c[d++]=u),h=!0),q.greaterThan(f,t)&&q.lessThan(f,y)&&!f.equals(o)&&(u=e.getValueInReferenceFrame(f,r,c[d]),l(u)&&(c[d++]=u)),p<g-1){if(s>0&&!x){let L=i[p+1],Z=q.secondsDifference(L,f);x=Z>s,x&&(S=Math.ceil(Z/s),C=0,V=Z/Math.max(S,2),S=Math.max(S-1,1))}if(x&&C<S){f=q.addSeconds(f,V,new q),C++;continue}}x=!1,p++,f=i[p]}return u=e.getValueInReferenceFrame(n,r,c[d]),l(u)&&(c[d++]=u),d}function Oit(e,t,n,i,o,r,s,a){let c,d=0,u=s,h=t,p=!l(i)||q.lessThanOrEquals(i,t)||q.greaterThanOrEquals(i,n);for(;q.lessThan(h,n);)!p&&q.greaterThanOrEquals(h,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(h,o,a[u]),l(c)&&(a[u]=c,u++),d++,h=q.addSeconds(t,r*d,new q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function Bit(e,t,n,i,o,r,s,a){let c,d=0,u=s,h=t,p=Math.max(r,60),g=!l(i)||q.lessThanOrEquals(i,t)||q.greaterThanOrEquals(i,n);for(;q.lessThan(h,n);)!g&&q.greaterThanOrEquals(h,i)&&(g=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(h,o,a[u]),l(c)&&(a[u]=c,u++),d++,h=q.addSeconds(t,p*d,new q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function Yit(e,t,n,i,o,r,s,a){e4.start=t,e4.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let h=d.get(u);if(!Rn.intersect(h,e4,kpe).isEmpty){let p=h.start;h.isStartIncluded||(h.isStopIncluded?p=h.stop:p=q.addSeconds(h.start,q.secondsDifference(h.stop,h.start)/2,new q));let g=e.getValueInReferenceFrame(p,o,a[c]);l(g)&&(a[c]=g,c++)}}return c}function zit(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function Hit(e,t,n,i,o,r,s,a){$Q.start=t,$Q.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let h=d.get(u);if(!Rn.intersect(h,$Q,kpe).isEmpty){let p=h.start,g=h.stop,f=t;q.greaterThan(p,f)&&(f=p);let y=n;q.lessThan(g,y)&&(y=g),c=Upe(h.data,f,y,i,o,r,c,a)}}return c}function Upe(e,t,n,i,o,r,s,a){for(;e instanceof $b;)e=e.resolvedProperty;if(e instanceof Ca){let c=e._property._times;s=Dit(e,t,n,c,i,o,r,s,a)}else e instanceof KX?s=Oit(e,t,n,i,o,r,s,a):e instanceof Sa?s=Hit(e,t,n,i,o,r,s,a):e instanceof e0?s=Yit(e,t,n,i,o,r,s,a):e instanceof el||e instanceof Nf&&J.isConstant(e)?s=zit(e,t,n,i,o,r,s,a):s=Bit(e,t,n,i,o,r,s,a);return s}function Dpe(e,t,n,i,o,r,s){l(s)||(s=[]);let a=Upe(e,t,n,i,o,r,0,s);return s.length=a,s}var Kit=new $;function ow(e,t){this._unusedIndexes=[],this._polylineCollection=new fh,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}ow.prototype.update=function(e){if(this._referenceFrame===Di.INERTIAL){let t=Ft.computeIcrfToCentralBodyFixedMatrix(e,Kit);F.fromRotationTranslation(t,m.ZERO,this._polylineCollection.modelMatrix)}};ow.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,d=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(d){let h=J.getValueOrUndefined(i._leadTime,e),p=J.getValueOrUndefined(i._trailTime,e),g=n._availability,f=l(g),y=l(h),x=l(p);if(d=f||y&&x,d){if(x&&(r=q.addSeconds(e,-p,new q)),y&&(s=q.addSeconds(e,h,new q)),f){let S=g.start,C=g.stop;(!x||q.greaterThan(S,r))&&(r=S),(!y||q.lessThan(C,s))&&(s=C)}d=q.lessThan(r,s)}}if(!d){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let h=this._unusedIndexes;if(h.length>0){let g=h.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=J.getValueOrDefault(i._resolution,e,kit);c.show=!0,c.positions=Dpe(o,r,s,e,this._referenceFrame,u,c.positions.slice()),c.material=$o.getValue(e,i._material,c.material),c.width=J.getValueOrDefault(i._width,e,Uit),c.distanceDisplayCondition=J.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};ow.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)};ow.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),me(this)};function gy(e,t){t.collectionChanged.addEventListener(gy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new It,this._onCollectionChanged(t,t.values,[],[])}gy.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,d=Di.FIXED;this._scene.mode===oe.SCENE3D&&(d=a.referenceFrame);let u=this._updaters[d];if(c===u&&l(u)){u.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(u)||(u=new ow(this._scene,d),u.update(e),this._updaters[d]=u),r.updater=u,l(u)&&u.updateObject(e,r)}return!0};gy.prototype.isDestroyed=function(){return!1};gy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(gy.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return me(this)};gy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new Npe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Npe(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};gy._subSample=Dpe;var rw=gy;var hyi=_(T(),1);var Ope=D.WHITE,Bpe=D.BLACK,Ype=0,zpe=1,Hpe=0,Kpe=Br.NONE,Jpe=new D,Jit=new m,Qpe=new D,jpe=new Ot,qpe=new Ot,$pe=new At;function ebe(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 yy(e,t){t.collectionChanged.addEventListener(yy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new It,this._onCollectionChanged(t,t.values,[],[])}yy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,d=r.billboard,u=J.getValueOrDefault(a._heightReference,e,Ke.NONE),h=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),p;if(h&&(p=J.getValueOrUndefined(s._position,e,Jit),h=l(p)),!h){sw(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,f=!1;if(u!==Ke.NONE&&!l(d)?(l(c)&&(sw(r,s,n),c=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,g=!0,f=m.equals(d.position,p)&&d.heightReference===u):u===Ke.NONE&&!l(c)&&(l(d)&&(sw(r,s,n),d=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,jpe),c.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,qpe),c.color=J.getValueOrDefault(a._color,e,Ope,Jpe),c.outlineColor=J.getValueOrDefault(a._outlineColor,e,Bpe,Qpe),c.outlineWidth=J.getValueOrDefault(a._outlineWidth,e,Ype),c.pixelSize=J.getValueOrDefault(a._pixelSize,e,zpe),c.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,$pe),c.disableDepthTestDistance=J.getValueOrDefault(a._disableDepthTestDistance,e,Hpe),c.splitDirection=J.getValueOrDefault(a._splitDirection,e,Kpe);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,jpe),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,qpe),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,$pe),d.disableDepthTestDistance=J.getValueOrDefault(a._disableDepthTestDistance,e,Hpe),d.splitDirection=J.getValueOrDefault(a._splitDirection,e,Kpe),d.heightReference=u;let y=J.getValueOrDefault(a._color,e,Ope,Jpe),x=J.getValueOrDefault(a._outlineColor,e,Bpe,Qpe),S=Math.round(J.getValueOrDefault(a._outlineWidth,e,Ype)),C=Math.max(1,Math.round(J.getValueOrDefault(a._pixelSize,e,zpe)));if(S>0?(d.scale=1,g=g||S!==r.outlineWidth||C!==r.pixelSize||!D.equals(y,r.color)||!D.equals(x,r.outlineColor)):(d.scale=C/50,C=50,g=g||S!==r.outlineWidth||!D.equals(y,r.color)||!D.equals(x,r.outlineColor)),g){r.color=D.clone(y,r.color),r.outlineColor=D.clone(x,r.outlineColor),r.pixelSize=C,r.outlineWidth=S;let V=y.alpha,L=y.toCssColorString(),Z=x.toCssColorString(),E=JSON.stringify([L,C,Z,S]);d.setImage(E,bT(V,L,Z,S,C))}f&&d._updateClamping()}}return!0};yy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return ut.FAILED;if(l(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};yy.prototype.isDestroyed=function(){return!1};yy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(yy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return me(this)};yy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new ebe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new ebe(r)):(sw(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],sw(s.get(r.id),r,a),s.remove(r.id)};function sw(e,t,n){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 aw=yy;var Sxi=_(T(),1);var Oyi=_(T(),1);var Qit=new jn(0),EU={},tbe=new D,jit=new zt(D.WHITE),qit=new jn(!0),$it=new jn(Cn.DISABLED),eot=new jn(new At),tot=new jn(On.BOTH);function not(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function iot(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Eh(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Eh.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new be,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 not,this._groundGeometryOptions=new iot,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=er.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Eh.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&J.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Eh.prototype.isOutlineVisible=function(e){return!1};Eh.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Eh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Dn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof zt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,tbe)),l(a)||(a=D.WHITE),s.color=Kt.fromColor(a)),this.clampToGround?new Xt({id:t,geometry:new Jx(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof zt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,tbe)),l(a)||(a=D.WHITE),s.depthFailColor=Kt.fromColor(a)),new Xt({id:t,geometry:new qp(this._geometryOptions),attributes:s}))};Eh.prototype.createOutlineGeometryInstance=function(e){};Eh.prototype.isDestroyed=function(){return!1};Eh.prototype.destroy=function(){this._entitySubscription(),me(this)};Eh.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(Oe.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=o.material??jit,d=c instanceof zt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??qit,this._shadowsProperty=o.shadows??$it,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??eot,this._classificationTypeProperty=o.classificationType??tot,this._fillEnabled=!0,this._zIndex=a??Qit;let u=o.width,h=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!J.isConstant(u)||!J.isConstant(h)||!J.isConstant(g)||!J.isConstant(p)||!J.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let f=this._geometryOptions,y=r.getValue(Oe.MINIMUM_VALUE,f.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let x;d&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof zt)?x=is.VERTEX_FORMAT:x=ya.VERTEX_FORMAT,f.vertexFormat=x,f.positions=y,f.width=l(u)?u.getValue(Oe.MINIMUM_VALUE):void 0,f.arcType=l(h)?h.getValue(Oe.MINIMUM_VALUE):void 0,f.granularity=l(g)?g.getValue(Oe.MINIMUM_VALUE):void 0;let S=this._groundGeometryOptions;S.positions=y,S.width=f.width,S.arcType=f.arcType,S.granularity=f.granularity,this._clampToGround=l(p)?p.getValue(Oe.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&Vt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Eh.prototype.createDynamicUpdater=function(e,t){return new cw(e,t,this)};var AV={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function cw(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 nbe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=EU[n];!l(i)||i.isDestroyed()?(i=new fh,EU[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}cw.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=J.getValueOrUndefined(o,e,this._positions);t._clampToGround=J.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=J.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=J.getValueOrDefault(i._arcType,e,on.GEODESIC),t._groundGeometryOptions.granularity=J.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!J.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let h=t.fillMaterialProperty,p;if(h instanceof zt)p=new is;else{let g=$o.getValue(e,h,this._material);p=new ya({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new zm({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),J.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=nbe(this);if(!n.isShowing||!n.isAvailable(e)||!J.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=on.GEODESIC;c=J.getValueOrDefault(i._arcType,e,c);let d=t._scene.globe,u=t._scene.ellipsoid;c!==on.NONE&&l(d)&&(AV.ellipsoid=u,AV.positions=r,AV.granularity=J.getValueOrUndefined(i._granularity,e),AV.height=wi.extractHeights(r,u),c===on.GEODESIC?r=wi.generateCartesianArc(AV):r=wi.generateCartesianRhumbArc(AV)),a.show=!0,a.positions=r.slice(),a.material=$o.getValue(e,t.fillMaterialProperty,a.material),a.width=J.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=J.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};cw.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 de.clone(n.boundingSphere,e),ut.DONE}return l(t)&&!t.ready?ut.PENDING:ut.DONE}else{let t=nbe(this);if(t.show&&t.positions.length>0)return de.fromPoints(t.positions,e),ut.DONE}return ut.FAILED};cw.prototype.isDestroyed=function(){return!1};cw.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=EU[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete EU[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),me(this)};var lw=Eh;var rxi=_(T(),1);var oot=new D,rot=new At,sot=new At;function Ih(e,t,n,i,o){let r;n instanceof zt?r=is:r=ya,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new It,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new It,this.material=void 0,this.updatersWithAttributes=new It,this.attributes=new It,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Ih.prototype.onMaterialChanged,this),this.subscriptions=new It,this.showsUpdated=new It,this.zIndex=i,this._asynchronous=o}Ih.prototype.onMaterialChanged=function(){this.invalidated=!0};Ih.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof zt&&t instanceof zt?!0:l(t)&&t.equals(n)};Ih.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!J.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Ih.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};Ih.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new zm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===ya&&(this.material=$o.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===ya&&(this.material=$o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),h=this.attributes.get(u.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,h)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,x=J.getValueOrDefault(y,e,D.WHITE,oot);D.equals(h._lastColor,x)||(h._lastColor=D.clone(x,h._lastColor),h.color=Kt.toValue(x,h.color))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=Sn.toValue(p,h.show));let f=c.distanceDisplayConditionProperty;if(!J.isConstant(f)){let y=J.getValueOrDefault(f,e,sot,rot);At.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=At.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Dn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Ih.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id);if(!s)continue;let a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Sn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Ih.prototype.contains=function(e){return this.updaters.contains(e.id)};Ih.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Ih.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 MV(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}MV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=J.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new Ih(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};MV.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}}};MV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};MV.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};MV.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 dw=MV;var aot=[];function ibe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function obe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof zt?1:2);let r;l(i)&&(r=i+o*Cn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof zt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function kf(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 It,this._removedObjects=new It,this._changedObjects=new It;let o,r=Cn.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 im(n,is,void 0,!1,o),this._materialBatches[o]=new om(n,ya,void 0,!1,o),this._colorBatches[o+r]=new im(n,is,is,!1,o),this._materialBatches[o+r]=new om(n,ya,is,!1,o),this._colorBatches[o+r*2]=new im(n,is,ya,!1,o),this._materialBatches[o+r*2]=new om(n,ya,ya,!1,o);this._dynamicBatch=new wT(n,i);let s=On.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new dw(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new It,this._updaters=new It,this._entityCollection=t,t.collectionChanged.addEventListener(kf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,aot)}kf.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaters.get(d),u.entity===c?(ibe(this,u),obe(this,e,u)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaters.get(d),ibe(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new lw(c,this._scene),this._updaters.set(d,u),obe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(kf._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)h=p[a].update(e)&&h;return h};var cot=[],lot=new de;kf.prototype.getBoundingSphere=function(e,t){let n=cot,i=lot,o=0,r=ut.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);if(!c)return ut.FAILED;for(let d=0;d<a;d++){if(r=s[d].getBoundingSphere(c,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=de.clone(i,n[o]),o++)}return o===0?ut.FAILED:(n.length=o,de.fromBoundingSpheres(n,t),ut.DONE)};kf.prototype.isDestroyed=function(){return!1};kf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(kf.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(),me(this)};kf._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)};kf.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var uw=kf;function Kl(e){$c.initializeTerrainHeights(),zm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new dr,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??Kl.defaultVisualizersCallback;let i=!1,o=new ml,r=new ml;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let d=0,u=n.length;d<u;d++)this._onDataSourceAdded(n,n.get(d));let s=new wv;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let d=this,u=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),d._removeDefaultDataSourceListener=void 0,d._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(u),c=n.dataSourceAdded.addEventListener(u)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var NV=[];Kl.registerVisualizer=function(e){NV.includes(e)||NV.push(e)};Kl.unregisterVisualizer=function(e){if(NV.includes(e)){let t=NV.indexOf(e);NV.splice(t,1)}};Kl.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new OI(t,i),new tw(e,i,n._primitives,n._groundPrimitives),new nw(t,i),new iw(e,i),new Iv(e,i),new aw(t,i),new rw(e,i),new uw(e,i,n._primitives,n._groundPrimitives),...NV.map(o=>new o(e,i))]};Object.defineProperties(Kl.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}}});Kl.prototype.isDestroyed=function(){return!1};Kl.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)),me(this)};Kl.prototype.update=function(e){if(!ui.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};Kl.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var dot=[],uot=new de;Kl.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return ut.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let g=p.get(i);if(g.entities.contains(e)){r=g;break}}}if(!l(r))return ut.FAILED;let s=dot,a=uot,c=0,d=ut.DONE,u=r._visualizers,h=u.length;for(i=0;i<h;i++){let p=u[i];if(l(p.getBoundingSphere)){if(d=u[i].getBoundingSphere(e,a),!t&&d===ut.PENDING)return ut.PENDING;d===ut.DONE&&(s[c]=de.clone(a,s[c]),c++)}}return c===0?ut.FAILED:(s.length=c,de.fromBoundingSpheres(s,n),ut.DONE)};Kl.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new ml),s=o.add(new Yv);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Kl.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let d=0;d<c;d++)a[d].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Kl.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var mw=Kl;var o_i=_(T(),1);var rbe=new $,sbe=new $,abe=new $,mot=new F,IU=new m,cbe=new m,t4=new m,n4=new m,lbe=new m,dbe=new m,hot=new we,fot=new m,pot=new $,kV=new q,bot=1.25;function got(e,t,n,i,o,r,s,a,c,d){let u=e.scene.mode,h=o.getValue(c,e._lastCartesian);if(l(h)){let p=!1,g=!1,f,y,x;if(u===oe.SCENE3D){q.addSeconds(c,.001,kV);let P=o.getValue(kV,IU);if(l(P)||(q.addSeconds(c,-.001,kV),P=o.getValue(kV,IU),g=!0),l(P)){let W=Ft.computeFixedToIcrfMatrix(c,rbe),v=Ft.computeFixedToIcrfMatrix(kV,sbe),A;!l(W)||!l(v)?(A=Ft.computeTemeToPseudoFixedMatrix(c,abe),W=$.transpose(A,rbe),v=Ft.computeTemeToPseudoFixedMatrix(kV,sbe),$.transpose(v,v)):A=$.transpose(W,abe);let b=$.multiplyByVector(W,h,lbe),R=$.multiplyByVector(v,P,dbe);m.subtract(b,R,n4);let G=m.magnitude(n4)*1e3,I=X.GRAVITATIONALPARAMETER,w=-I/(G*G-2*I/m.magnitude(b));w<0||w>bot*d.maximumRadius?(f=cbe,m.normalize(h,f),m.negate(f,f),x=m.clone(m.UNIT_Z,t4),y=m.cross(x,f,IU),m.magnitude(y)>X.EPSILON7&&(m.normalize(f,f),m.normalize(y,y),x=m.cross(f,y,t4),m.normalize(x,x),p=!0)):m.equalsEpsilon(h,P,X.EPSILON7)||(x=cbe,m.normalize(b,x),m.normalize(R,R),y=m.cross(x,R,t4),g&&(y=m.multiplyByScalar(y,-1,y)),m.equalsEpsilon(y,m.ZERO,X.EPSILON7)||(f=m.cross(y,x,IU),$.multiplyByVector(A,f,f),$.multiplyByVector(A,y,y),$.multiplyByVector(A,x,x),m.normalize(f,f),m.normalize(y,y),m.normalize(x,x),p=!0))}}l(e.boundingSphere)&&(h=e.boundingSphere.center);let S,C,V;i&&(S=m.clone(t.position,n4),C=m.clone(t.direction,lbe),V=m.clone(t.up,dbe));let L=mot,Z;l(s)&&(Z=s.getValue(c,hot));let E=r.getValue(c,fot);if(a===tb.INERTIAL&&l(Z))F.fromTranslationQuaternionRotationScale(h,Z,m.ONE,L);else if(a===tb.VELOCITY&&l(E)){let P=Ft.rotationMatrixFromPositionVelocity(h,E,d,pot);F.fromRotationTranslation(P,h,L)}else a===tb.ENU||!p?Ft.eastNorthUpToFixedFrame(h,d,L):(L[0]=f.x,L[1]=f.y,L[2]=f.z,L[3]=0,L[4]=y.x,L[5]=y.y,L[6]=y.z,L[7]=0,L[8]=x.x,L[9]=x.y,L[10]=x.z,L[11]=0,L[12]=h.x,L[13]=h.y,L[14]=h.z,L[15]=0);t._setTransform(L),i&&(m.clone(S,t.position),m.clone(C,t.direction),m.clone(V,t.up),m.cross(C,V,t.right))}if(n){let p=u===oe.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function hw(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ne.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._velocityProperty=new n0(e.position,!0),this._offset3D=new m}Object.defineProperties(hw,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});hw.defaultOffset3D=new m(-14e3,3500,3500);var NT=new Gu,yot=new m;hw.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,d=r.orientation,u=r!==this._lastEntity,h=o!==this._mode,p=n.camera,g=u||h,f=!0;if(u){let y=r.viewFrom,x=l(y);if(!x&&l(t)){NT.pitch=-X.PI_OVER_FOUR,NT.range=0;let S=a.getValue(e,yot);if(l(S))if(p.getCameraDistance)NT.range=p.getCameraDistance(),NT.heading=p.heading,NT.pitch=p.pitch;else{let C=2-1/Math.max(1,m.magnitude(S)/i.maximumRadius);NT.pitch*=C}p.viewBoundingSphere(t,NT),this.boundingSphere=t,g=!1,f=!1}else(!x||!l(y.getValue(e,this._offset3D)))&&m.clone(hw._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&m.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,got(this,p,g,f,a,c,d,s,e,i)};var fw=hw;var RSi=_(T(),1);var HTi=_(T(),1);var s_i=_(T(),1);function AU(e){return MU(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function MU(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?MU(n):n),[])}var ube=[0,1,2,3].concat(...AU([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function br(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,d=e.stat_desc.max_length,u,h,p,g,f,y,x=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<573;u++)h=o.heap[u],g=r[r[h*2+1]*2+1]+1,g>d&&(g=d,x++),r[h*2+1]=g,!(h>e.max_code)&&(o.bl_count[g]++,f=0,h>=c&&(f=a[h-c]),y=r[h*2],o.opt_len+=y*(g+f),s&&(o.static_len+=y*(s[h*2+1]+f)));if(x!==0){do{for(g=d-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[d]--,x-=2}while(x>0);for(g=d;g!==0;g--)for(h=o.bl_count[g];h!==0;)p=o.heap[--u],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),h--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,d,u,h;for(d=1;d<=15;d++)a[d]=c=c+s[d-1]<<1;for(u=0;u<=r;u++)h=o[u*2+1],h!==0&&(o[u*2]=n(a[h]++,h))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,d,u=-1,h;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=u=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)h=o.heap[++o.heap_len]=u<2?++u:0,r[h*2]=1,o.depth[h]=0,o.opt_len--,s&&(o.static_len-=s[h*2+1]);for(e.max_code=u,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);h=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),d=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=d,r[h*2]=r[c*2]+r[d*2],o.depth[h]=Math.max(o.depth[c],o.depth[d])+1,r[c*2+1]=r[d*2+1]=h,o.heap[1]=h++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}br._length_code=[0,1,2,3,4,5,6,7].concat(...AU([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));br.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];br.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];br.d_code=function(e){return e<256?ube[e]:ube[256+(e>>>7)]};br.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];br.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];br.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];br.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Ya(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var xot=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],_ot=AU([[144,8],[112,9],[24,7],[8,8]]);Ya.static_ltree=MU(xot.map((e,t)=>[e,_ot[t]]));var Tot=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],Sot=AU([[30,5]]);Ya.static_dtree=MU(Tot.map((e,t)=>[e,Sot[t]]));Ya.static_l_desc=new Ya(Ya.static_ltree,br.extra_lbits,257,286,15);Ya.static_d_desc=new Ya(Ya.static_dtree,br.extra_dbits,0,30,15);Ya.static_bl_desc=new Ya(null,br.extra_blbits,0,19,7);var Cot=9,Vot=8;function Uf(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var hbe=0,wU=1,kT=2,Xh=[new Uf(0,0,0,0,hbe),new Uf(4,4,8,4,wU),new Uf(4,5,16,8,wU),new Uf(4,6,32,32,wU),new Uf(4,4,16,16,kT),new Uf(8,16,32,32,kT),new Uf(8,16,128,128,kT),new Uf(8,32,128,256,kT),new Uf(32,128,258,1024,kT),new Uf(32,258,258,4096,kT)],XU=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],sm=0,WU=1,pw=2,PU=3,Lot=32,i4=42,vU=113,bw=666,o4=8,Rot=0,r4=1,Zot=2,Wr=3,FU=258,Yd=FU+Wr+1;function mbe(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function Got(){let e=this,t,n,i,o,r,s,a,c,d,u,h,p,g,f,y,x,S,C,V,L,Z,E,P,W,v,A,b,R,G,I,w,M,O,k=new br,B=new br,N=new br;e.depth=[];let z,K,te,H,j,ee;e.bl_count=[],e.heap=[],w=[],M=[],O=[];function pe(){d=2*r,h[g-1]=0;for(let Me=0;Me<g-1;Me++)h[Me]=0;A=Xh[b].max_lazy,G=Xh[b].good_length,I=Xh[b].nice_length,v=Xh[b].max_chain,Z=0,S=0,P=0,C=W=Wr-1,L=0,p=0}function _e(){let Me;for(Me=0;Me<286;Me++)w[Me*2]=0;for(Me=0;Me<30;Me++)M[Me*2]=0;for(Me=0;Me<19;Me++)O[Me*2]=0;w[256*2]=1,e.opt_len=e.static_len=0,K=te=0}function ae(){k.dyn_tree=w,k.stat_desc=Ya.static_l_desc,B.dyn_tree=M,B.stat_desc=Ya.static_d_desc,N.dyn_tree=O,N.stat_desc=Ya.static_bl_desc,j=0,ee=0,H=8,_e()}e.pqdownheap=function(Me,at){let et=e.heap,qe=et[at],lt=at<<1;for(;lt<=e.heap_len&&(lt<e.heap_len&&mbe(Me,et[lt+1],et[lt],e.depth)&<++,!mbe(Me,qe,et[lt],e.depth));)et[at]=et[lt],at=lt,lt<<=1;et[at]=qe};function ye(Me,at){let et=-1,qe,lt=Me[0*2+1],Bt=0,xn=7,no=4;lt===0&&(xn=138,no=3),Me[(at+1)*2+1]=65535;for(let zi=0;zi<=at;zi++)qe=lt,lt=Me[(zi+1)*2+1],!(++Bt<xn&&qe==lt)&&(Bt<no?O[qe*2]+=Bt:qe!==0?(qe!=et&&O[qe*2]++,O[16*2]++):Bt<=10?O[17*2]++:O[18*2]++,Bt=0,et=qe,lt===0?(xn=138,no=3):qe==lt?(xn=6,no=3):(xn=7,no=4))}function Se(){let Me;for(ye(w,k.max_code),ye(M,B.max_code),N.build_tree(e),Me=18;Me>=3&&O[br.bl_order[Me]*2+1]===0;Me--);return e.opt_len+=3*(Me+1)+5+5+4,Me}function Ee(Me){e.pending_buf[e.pending++]=Me}function Ie(Me){Ee(Me&255),Ee(Me>>>8&255)}function Fe(Me){Ee(Me>>8&255),Ee(Me&255&255)}function ve(Me,at){let et,qe=at;ee>16-qe?(et=Me,j|=et<<ee&65535,Ie(j),j=et>>>16-ee,ee+=qe-16):(j|=Me<<ee&65535,ee+=qe)}function ct(Me,at){let et=Me*2;ve(at[et]&65535,at[et+1]&65535)}function Je(Me,at){let et,qe=-1,lt,Bt=Me[0*2+1],xn=0,no=7,zi=4;for(Bt===0&&(no=138,zi=3),et=0;et<=at;et++)if(lt=Bt,Bt=Me[(et+1)*2+1],!(++xn<no&<==Bt)){if(xn<zi)do ct(lt,O);while(--xn!==0);else lt!==0?(lt!=qe&&(ct(lt,O),xn--),ct(16,O),ve(xn-3,2)):xn<=10?(ct(17,O),ve(xn-3,3)):(ct(18,O),ve(xn-11,7));xn=0,qe=lt,Bt===0?(no=138,zi=3):lt==Bt?(no=6,zi=3):(no=7,zi=4)}}function bt(Me,at,et){let qe;for(ve(Me-257,5),ve(at-1,5),ve(et-4,4),qe=0;qe<et;qe++)ve(O[br.bl_order[qe]*2+1],3);Je(w,Me-1),Je(M,at-1)}function Qe(){ee==16?(Ie(j),j=0,ee=0):ee>=8&&(Ee(j&255),j>>>=8,ee-=8)}function Tt(){ve(r4<<1,3),ct(256,Ya.static_ltree),Qe(),1+H+10-ee<9&&(ve(r4<<1,3),ct(256,Ya.static_ltree),Qe()),H=7}function ft(Me,at){let et,qe,lt;if(e.dist_buf[K]=Me,e.lc_buf[K]=at&255,K++,Me===0?w[at*2]++:(te++,Me--,w[(br._length_code[at]+256+1)*2]++,M[br.d_code(Me)*2]++),(K&8191)===0&&b>2){for(et=K*8,qe=Z-S,lt=0;lt<30;lt++)et+=M[lt*2]*(5+br.extra_dbits[lt]);if(et>>>=3,te<Math.floor(K/2)&&et<Math.floor(qe/2))return!0}return K==z-1}function gt(Me,at){let et,qe,lt=0,Bt,xn;if(K!==0)do et=e.dist_buf[lt],qe=e.lc_buf[lt],lt++,et===0?ct(qe,Me):(Bt=br._length_code[qe],ct(Bt+256+1,Me),xn=br.extra_lbits[Bt],xn!==0&&(qe-=br.base_length[Bt],ve(qe,xn)),et--,Bt=br.d_code(et),ct(Bt,at),xn=br.extra_dbits[Bt],xn!==0&&(et-=br.base_dist[Bt],ve(et,xn)));while(lt<K);ct(256,Me),H=Me[256*2+1]}function En(){ee>8?Ie(j):ee>0&&Ee(j&255),j=0,ee=0}function cn(Me,at,et){En(),H=8,et&&(Ie(at),Ie(~at)),e.pending_buf.set(c.subarray(Me,Me+at),e.pending),e.pending+=at}function Ce(Me,at,et){ve((Rot<<1)+(et?1:0),3),cn(Me,at,!0)}function Le(Me,at,et){let qe,lt,Bt=0;b>0?(k.build_tree(e),B.build_tree(e),Bt=Se(),qe=e.opt_len+3+7>>>3,lt=e.static_len+3+7>>>3,lt<=qe&&(qe=lt)):qe=lt=at+5,at+4<=qe&&Me!=-1?Ce(Me,at,et):lt==qe?(ve((r4<<1)+(et?1:0),3),gt(Ya.static_ltree,Ya.static_dtree)):(ve((Zot<<1)+(et?1:0),3),bt(k.max_code+1,B.max_code+1,Bt+1),gt(w,M)),_e(),et&&En()}function St(Me){Le(S>=0?S:-1,Z-S,Me),S=Z,t.flush_pending()}function mn(){let Me,at,et,qe;do{if(qe=d-P-Z,qe===0&&Z===0&&P===0)qe=r;else if(qe==-1)qe--;else if(Z>=r+r-Yd){c.set(c.subarray(r,r+r),0),E-=r,Z-=r,S-=r,Me=g,et=Me;do at=h[--et]&65535,h[et]=at>=r?at-r:0;while(--Me!==0);Me=r,et=Me;do at=u[--et]&65535,u[et]=at>=r?at-r:0;while(--Me!==0);qe+=r}if(t.avail_in===0)return;Me=t.read_buf(c,Z+P,qe),P+=Me,P>=Wr&&(p=c[Z]&255,p=(p<<x^c[Z+1]&255)&y)}while(P<Yd&&t.avail_in!==0)}function to(Me){let at=65535,et;for(at>i-5&&(at=i-5);;){if(P<=1){if(mn(),P===0&&Me==0)return sm;if(P===0)break}if(Z+=P,P=0,et=S+at,(Z===0||Z>=et)&&(P=Z-et,Z=et,St(!1),t.avail_out===0)||Z-S>=r-Yd&&(St(!1),t.avail_out===0))return sm}return St(Me==4),t.avail_out===0?Me==4?pw:sm:Me==4?PU:WU}function He(Me){let at=v,et=Z,qe,lt,Bt=W,xn=Z>r-Yd?Z-(r-Yd):0,no=I,zi=a,ms=Z+FU,lr=c[et+Bt-1],Gi=c[et+Bt];W>=G&&(at>>=2),no>P&&(no=P);do if(qe=Me,!(c[qe+Bt]!=Gi||c[qe+Bt-1]!=lr||c[qe]!=c[et]||c[++qe]!=c[et+1])){et+=2,qe++;do;while(c[++et]==c[++qe]&&c[++et]==c[++qe]&&c[++et]==c[++qe]&&c[++et]==c[++qe]&&c[++et]==c[++qe]&&c[++et]==c[++qe]&&c[++et]==c[++qe]&&c[++et]==c[++qe]&&et<ms);if(lt=FU-(ms-et),et=ms-FU,lt>Bt){if(E=Me,Bt=lt,lt>=no)break;lr=c[et+Bt-1],Gi=c[et+Bt]}}while((Me=u[Me&zi]&65535)>xn&&--at!==0);return Bt<=P?Bt:P}function yr(Me){let at=0,et;for(;;){if(P<Yd){if(mn(),P<Yd&&Me==0)return sm;if(P===0)break}if(P>=Wr&&(p=(p<<x^c[Z+(Wr-1)]&255)&y,at=h[p]&65535,u[Z&a]=h[p],h[p]=Z),at!==0&&(Z-at&65535)<=r-Yd&&R!=2&&(C=He(at)),C>=Wr)if(et=ft(Z-E,C-Wr),P-=C,C<=A&&P>=Wr){C--;do Z++,p=(p<<x^c[Z+(Wr-1)]&255)&y,at=h[p]&65535,u[Z&a]=h[p],h[p]=Z;while(--C!==0);Z++}else Z+=C,C=0,p=c[Z]&255,p=(p<<x^c[Z+1]&255)&y;else et=ft(0,c[Z]&255),P--,Z++;if(et&&(St(!1),t.avail_out===0))return sm}return St(Me==4),t.avail_out===0?Me==4?pw:sm:Me==4?PU:WU}function cr(Me){let at=0,et,qe;for(;;){if(P<Yd){if(mn(),P<Yd&&Me==0)return sm;if(P===0)break}if(P>=Wr&&(p=(p<<x^c[Z+(Wr-1)]&255)&y,at=h[p]&65535,u[Z&a]=h[p],h[p]=Z),W=C,V=E,C=Wr-1,at!==0&&W<A&&(Z-at&65535)<=r-Yd&&(R!=2&&(C=He(at)),C<=5&&(R==1||C==Wr&&Z-E>4096)&&(C=Wr-1)),W>=Wr&&C<=W){qe=Z+P-Wr,et=ft(Z-1-V,W-Wr),P-=W-1,W-=2;do++Z<=qe&&(p=(p<<x^c[Z+(Wr-1)]&255)&y,at=h[p]&65535,u[Z&a]=h[p],h[p]=Z);while(--W!==0);if(L=0,C=Wr-1,Z++,et&&(St(!1),t.avail_out===0))return sm}else if(L!==0){if(et=ft(0,c[Z-1]&255),et&&St(!1),Z++,P--,t.avail_out===0)return sm}else L=1,Z++,P--}return L!==0&&(et=ft(0,c[Z-1]&255),L=0),St(Me==4),t.avail_out===0?Me==4?pw:sm:Me==4?PU:WU}function ma(Me){return Me.total_in=Me.total_out=0,Me.msg=null,e.pending=0,e.pending_out=0,n=vU,o=0,ae(),pe(),0}e.deflateInit=function(Me,at,et,qe,lt,Bt){return qe||(qe=o4),lt||(lt=Vot),Bt||(Bt=0),Me.msg=null,at==-1&&(at=6),lt<1||lt>Cot||qe!=o4||et<9||et>15||at<0||at>9||Bt<0||Bt>2?-2:(Me.dstate=e,s=et,r=1<<s,a=r-1,f=lt+7,g=1<<f,y=g-1,x=Math.floor((f+Wr-1)/Wr),c=new Uint8Array(r*2),u=[],h=[],z=1<<lt+6,e.pending_buf=new Uint8Array(z*4),i=z*4,e.dist_buf=new Uint16Array(z),e.lc_buf=new Uint8Array(z),b=at,R=Bt,ma(Me))},e.deflateEnd=function(){return n!=i4&&n!=vU&&n!=bw?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,h=null,u=null,c=null,e.dstate=null,n==vU?-3:0)},e.deflateParams=function(Me,at,et){let qe=0;return at==-1&&(at=6),at<0||at>9||et<0||et>2?-2:(Xh[b].func!=Xh[at].func&&Me.total_in!==0&&(qe=Me.deflate(1)),b!=at&&(b=at,A=Xh[b].max_lazy,G=Xh[b].good_length,I=Xh[b].nice_length,v=Xh[b].max_chain),R=et,qe)},e.deflateSetDictionary=function(Me,at,et){let qe=et,lt,Bt=0;if(!at||n!=i4)return-2;if(qe<Wr)return 0;for(qe>r-Yd&&(qe=r-Yd,Bt=et-qe),c.set(at.subarray(Bt,Bt+qe),0),Z=qe,S=qe,p=c[0]&255,p=(p<<x^c[1]&255)&y,lt=0;lt<=qe-Wr;lt++)p=(p<<x^c[lt+(Wr-1)]&255)&y,u[lt&a]=h[p],h[p]=lt;return 0},e.deflate=function(Me,at){let et,qe,lt,Bt,xn;if(at>4||at<0)return-2;if(!Me.next_out||!Me.next_in&&Me.avail_in!==0||n==bw&&at!=4)return Me.msg=XU[4],-2;if(Me.avail_out===0)return Me.msg=XU[7],-5;if(t=Me,Bt=o,o=at,n==i4&&(qe=o4+(s-8<<4)<<8,lt=(b-1&255)>>1,lt>3&&(lt=3),qe|=lt<<6,Z!==0&&(qe|=Lot),qe+=31-qe%31,n=vU,Fe(qe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&at<=Bt&&at!=4)return t.msg=XU[7],-5;if(n==bw&&t.avail_in!==0)return Me.msg=XU[7],-5;if(t.avail_in!==0||P!==0||at!=0&&n!=bw){switch(xn=-1,Xh[b].func){case hbe:xn=to(at);break;case wU:xn=yr(at);break;case kT:xn=cr(at);break;default:}if((xn==pw||xn==PU)&&(n=bw),xn==sm||xn==pw)return t.avail_out===0&&(o=-1),0;if(xn==WU){if(at==1)Tt();else if(Ce(0,0,!1),at==3)for(et=0;et<g;et++)h[et]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return at!=4?0:1}}function fbe(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}fbe.prototype={deflateInit(e,t){let n=this;return n.dstate=new Got,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function pbe(e){let t=this,n=new fbe,i=Eot(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let d,u,h=0,p=0,g=0,f=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,d=n.deflate(o),d!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?f.push(new Uint8Array(r)):f.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=h&&(c(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return f.length>1?(u=new Uint8Array(g),f.forEach(function(y){u.set(y,p),p+=y.length})):u=f[0]?new Uint8Array(f[0]):new Uint8Array,u}},t.flush=function(){let a,c,d=0,u=0,h=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&h.push(r.slice(0,n.next_out_index)),u+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(u),h.forEach(function(p){c.set(p,d),d+=p.length}),c}}function Eot(e){return e+5*(Math.floor(e/16383)+1)}var c_i=_(T(),1);var zd=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],wbe=1440,Iot=0,Xot=4,Wot=9,Pot=5,vot=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],wot=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Fot=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Aot=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],Mot=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Not=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],xy=15;function l4(){let e=this,t,n,i,o,r,s;function a(d,u,h,p,g,f,y,x,S,C,V){let L,Z,E,P,W,v,A,b,R,G,I,w,M,O,k;G=0,W=h;do i[d[u+G]]++,G++,W--;while(W!==0);if(i[0]==h)return y[0]=-1,x[0]=0,0;for(b=x[0],v=1;v<=xy&&i[v]===0;v++);for(A=v,b<v&&(b=v),W=xy;W!==0&&i[W]===0;W--);for(E=W,b>W&&(b=W),x[0]=b,O=1<<v;v<W;v++,O<<=1)if((O-=i[v])<0)return-3;if((O-=i[W])<0)return-3;for(i[W]+=O,s[1]=v=0,G=1,M=2;--W!==0;)s[M]=v+=i[G],M++,G++;W=0,G=0;do(v=d[u+G])!==0&&(V[s[v]++]=W),G++;while(++W<h);for(h=s[E],s[0]=W=0,G=0,P=-1,w=-b,r[0]=0,I=0,k=0;A<=E;A++)for(L=i[A];L--!==0;){for(;A>w+b;){if(P++,w+=b,k=E-w,k=k>b?b:k,(Z=1<<(v=A-w))>L+1&&(Z-=L+1,M=A,v<k))for(;++v<k&&!((Z<<=1)<=i[++M]);)Z-=i[M];if(k=1<<v,C[0]+k>wbe)return-3;r[P]=I=C[0],C[0]+=k,P!==0?(s[P]=W,o[0]=v,o[1]=b,v=W>>>w-b,o[2]=I-r[P-1]-v,S.set(o,(r[P-1]+v)*3)):y[0]=I}for(o[1]=A-w,G>=h?o[0]=192:V[G]<p?(o[0]=V[G]<256?0:96,o[2]=V[G++]):(o[0]=f[V[G]-p]+16+64,o[2]=g[V[G++]-p]),Z=1<<A-w,v=W>>>w;v<k;v+=Z)S.set(o,(I+v)*3);for(v=1<<A-1;(W&v)!==0;v>>>=1)W^=v;for(W^=v,R=(1<<w)-1;(W&R)!=s[P];)P--,w-=b,R=(1<<w)-1}return O!==0&&E!=1?-5:0}function c(d){let u;for(t||(t=[],n=[],i=new Int32Array(xy+1),o=[],r=new Int32Array(xy),s=new Int32Array(xy+1)),n.length<d&&(n=[]),u=0;u<d;u++)n[u]=0;for(u=0;u<xy+1;u++)i[u]=0;for(u=0;u<3;u++)o[u]=0;r.set(i.subarray(0,xy),0),s.set(i.subarray(0,xy+1),0)}e.inflate_trees_bits=function(d,u,h,p,g){let f;return c(19),t[0]=0,f=a(d,0,19,19,null,null,h,u,p,t,n),f==-3?g.msg="oversubscribed dynamic bit lengths tree":(f==-5||u[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",f=-3),f},e.inflate_trees_dynamic=function(d,u,h,p,g,f,y,x,S){let C;return c(288),t[0]=0,C=a(h,0,d,257,Fot,Aot,f,p,x,t,n),C!=0||p[0]===0?(C==-3?S.msg="oversubscribed literal/length tree":C!=-4&&(S.msg="incomplete literal/length tree",C=-3),C):(c(288),C=a(h,d,u,0,Mot,Not,y,g,x,t,n),C!=0||g[0]===0&&d>257?(C==-3?S.msg="oversubscribed distance tree":C==-5?(S.msg="incomplete distance tree",C=-3):C!=-4&&(S.msg="empty distance tree with lengths",C=-3),C):0)}}l4.inflate_trees_fixed=function(e,t,n,i){return e[0]=Wot,t[0]=Pot,n[0]=vot,i[0]=wot,0};var NU=0,bbe=1,gbe=2,ybe=3,xbe=4,_be=5,Tbe=6,s4=7,Sbe=8,kU=9;function kot(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,d=0,u=0,h,p=0,g,f=0;function y(x,S,C,V,L,Z,E,P){let W,v,A,b,R,G,I,w,M,O,k,B,N,z,K,te;I=P.next_in_index,w=P.avail_in,R=E.bitb,G=E.bitk,M=E.write,O=M<E.read?E.read-M-1:E.end-M,k=zd[x],B=zd[S];do{for(;G<20;)w--,R|=(P.read_byte(I++)&255)<<G,G+=8;if(W=R&k,v=C,A=V,te=(A+W)*3,(b=v[te])===0){R>>=v[te+1],G-=v[te+1],E.win[M++]=v[te+2],O--;continue}do{if(R>>=v[te+1],G-=v[te+1],(b&16)!==0){for(b&=15,N=v[te+2]+(R&zd[b]),R>>=b,G-=b;G<15;)w--,R|=(P.read_byte(I++)&255)<<G,G+=8;W=R&B,v=L,A=Z,te=(A+W)*3,b=v[te];do if(R>>=v[te+1],G-=v[te+1],(b&16)!==0){for(b&=15;G<b;)w--,R|=(P.read_byte(I++)&255)<<G,G+=8;if(z=v[te+2]+(R&zd[b]),R>>=b,G-=b,O-=N,M>=z)K=M-z,M-K>0&&2>M-K?(E.win[M++]=E.win[K++],E.win[M++]=E.win[K++],N-=2):(E.win.set(E.win.subarray(K,K+2),M),M+=2,K+=2,N-=2);else{K=M-z;do K+=E.end;while(K<0);if(b=E.end-K,N>b){if(N-=b,M-K>0&&b>M-K)do E.win[M++]=E.win[K++];while(--b!==0);else E.win.set(E.win.subarray(K,K+b),M),M+=b,K+=b,b=0;K=0}}if(M-K>0&&N>M-K)do E.win[M++]=E.win[K++];while(--N!==0);else E.win.set(E.win.subarray(K,K+N),M),M+=N,K+=N,N=0;break}else if((b&64)===0)W+=v[te+2],W+=R&zd[b],te=(A+W)*3,b=v[te];else return P.msg="invalid distance code",N=P.avail_in-w,N=G>>3<N?G>>3:N,w+=N,I-=N,G-=N<<3,E.bitb=R,E.bitk=G,P.avail_in=w,P.total_in+=I-P.next_in_index,P.next_in_index=I,E.write=M,-3;while(!0);break}if((b&64)===0){if(W+=v[te+2],W+=R&zd[b],te=(A+W)*3,(b=v[te])===0){R>>=v[te+1],G-=v[te+1],E.win[M++]=v[te+2],O--;break}}else return(b&32)!==0?(N=P.avail_in-w,N=G>>3<N?G>>3:N,w+=N,I-=N,G-=N<<3,E.bitb=R,E.bitk=G,P.avail_in=w,P.total_in+=I-P.next_in_index,P.next_in_index=I,E.write=M,1):(P.msg="invalid literal/length code",N=P.avail_in-w,N=G>>3<N?G>>3:N,w+=N,I-=N,G-=N<<3,E.bitb=R,E.bitk=G,P.avail_in=w,P.total_in+=I-P.next_in_index,P.next_in_index=I,E.write=M,-3)}while(!0)}while(O>=258&&w>=10);return N=P.avail_in-w,N=G>>3<N?G>>3:N,w+=N,I-=N,G-=N<<3,E.bitb=R,E.bitk=G,P.avail_in=w,P.total_in+=I-P.next_in_index,P.next_in_index=I,E.write=M,0}e.init=function(x,S,C,V,L,Z){t=NU,d=x,u=S,h=C,p=V,g=L,f=Z,i=null},e.proc=function(x,S,C){let V,L,Z,E=0,P=0,W=0,v,A,b,R;for(W=S.next_in_index,v=S.avail_in,E=x.bitb,P=x.bitk,A=x.write,b=A<x.read?x.read-A-1:x.end-A;;)switch(t){case NU:if(b>=258&&v>=10&&(x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,C=y(d,u,h,p,g,f,x,S),W=S.next_in_index,v=S.avail_in,E=x.bitb,P=x.bitk,A=x.write,b=A<x.read?x.read-A-1:x.end-A,C!=0)){t=C==1?s4:kU;break}r=d,i=h,o=p,t=bbe;case bbe:for(V=r;P<V;){if(v!==0)C=0;else return x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);v--,E|=(S.read_byte(W++)&255)<<P,P+=8}if(L=(o+(E&zd[V]))*3,E>>>=i[L+1],P-=i[L+1],Z=i[L],Z===0){s=i[L+2],t=Tbe;break}if((Z&16)!==0){a=Z&15,n=i[L+2],t=gbe;break}if((Z&64)===0){r=Z,o=L/3+i[L+2];break}if((Z&32)!==0){t=s4;break}return t=kU,S.msg="invalid literal/length code",C=-3,x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);case gbe:for(V=a;P<V;){if(v!==0)C=0;else return x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);v--,E|=(S.read_byte(W++)&255)<<P,P+=8}n+=E&zd[V],E>>=V,P-=V,r=u,i=g,o=f,t=ybe;case ybe:for(V=r;P<V;){if(v!==0)C=0;else return x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);v--,E|=(S.read_byte(W++)&255)<<P,P+=8}if(L=(o+(E&zd[V]))*3,E>>=i[L+1],P-=i[L+1],Z=i[L],(Z&16)!==0){a=Z&15,c=i[L+2],t=xbe;break}if((Z&64)===0){r=Z,o=L/3+i[L+2];break}return t=kU,S.msg="invalid distance code",C=-3,x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);case xbe:for(V=a;P<V;){if(v!==0)C=0;else return x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);v--,E|=(S.read_byte(W++)&255)<<P,P+=8}c+=E&zd[V],E>>=V,P-=V,t=_be;case _be:for(R=A-c;R<0;)R+=x.end;for(;n!==0;){if(b===0&&(A==x.end&&x.read!==0&&(A=0,b=A<x.read?x.read-A-1:x.end-A),b===0&&(x.write=A,C=x.inflate_flush(S,C),A=x.write,b=A<x.read?x.read-A-1:x.end-A,A==x.end&&x.read!==0&&(A=0,b=A<x.read?x.read-A-1:x.end-A),b===0)))return x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);x.win[A++]=x.win[R++],b--,R==x.end&&(R=0),n--}t=NU;break;case Tbe:if(b===0&&(A==x.end&&x.read!==0&&(A=0,b=A<x.read?x.read-A-1:x.end-A),b===0&&(x.write=A,C=x.inflate_flush(S,C),A=x.write,b=A<x.read?x.read-A-1:x.end-A,A==x.end&&x.read!==0&&(A=0,b=A<x.read?x.read-A-1:x.end-A),b===0)))return x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);C=0,x.win[A++]=s,b--,t=NU;break;case s4:if(P>7&&(P-=8,v++,W--),x.write=A,C=x.inflate_flush(S,C),A=x.write,b=A<x.read?x.read-A-1:x.end-A,x.read!=x.write)return x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);t=Sbe;case Sbe:return C=1,x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);case kU:return C=-3,x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C);default:return C=-2,x.bitb=E,x.bitk=P,S.avail_in=v,S.total_in+=W-S.next_in_index,S.next_in_index=W,x.write=A,x.inflate_flush(S,C)}},e.free=function(){}}var Cbe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],UV=0,a4=1,Vbe=2,Lbe=3,Rbe=4,Zbe=5,UU=6,DU=7,Gbe=8,UT=9;function Uot(e,t){let n=this,i=UV,o=0,r=0,s=0,a,c=[0],d=[0],u=new kot,h=0,p=new Int32Array(wbe*3),g=0,f=new l4;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(y,x){x&&(x[0]=g),i==UU&&u.free(y),i=UV,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(y,x){let S,C,V;return C=y.next_out_index,V=n.read,S=(V<=n.write?n.write:n.end)-V,S>y.avail_out&&(S=y.avail_out),S!==0&&x==-5&&(x=0),y.avail_out-=S,y.total_out+=S,y.next_out.set(n.win.subarray(V,V+S),C),C+=S,V+=S,V==n.end&&(V=0,n.write==n.end&&(n.write=0),S=n.write-V,S>y.avail_out&&(S=y.avail_out),S!==0&&x==-5&&(x=0),y.avail_out-=S,y.total_out+=S,y.next_out.set(n.win.subarray(V,V+S),C),C+=S,V+=S),y.next_out_index=C,n.read=V,x},n.proc=function(y,x){let S,C,V,L,Z,E,P,W;for(L=y.next_in_index,Z=y.avail_in,C=n.bitb,V=n.bitk,E=n.write,P=E<n.read?n.read-E-1:n.end-E;;){let v,A,b,R,G,I,w,M;switch(i){case UV:for(;V<3;){if(Z!==0)x=0;else return n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);Z--,C|=(y.read_byte(L++)&255)<<V,V+=8}switch(S=C&7,h=S&1,S>>>1){case 0:C>>>=3,V-=3,S=V&7,C>>>=S,V-=S,i=a4;break;case 1:v=[],A=[],b=[[]],R=[[]],l4.inflate_trees_fixed(v,A,b,R),u.init(v[0],A[0],b[0],0,R[0],0),C>>>=3,V-=3,i=UU;break;case 2:C>>>=3,V-=3,i=Lbe;break;case 3:return C>>>=3,V-=3,i=UT,y.msg="invalid block type",x=-3,n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x)}break;case a4:for(;V<32;){if(Z!==0)x=0;else return n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);Z--,C|=(y.read_byte(L++)&255)<<V,V+=8}if((~C>>>16&65535)!=(C&65535))return i=UT,y.msg="invalid stored block lengths",x=-3,n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);o=C&65535,C=V=0,i=o!==0?Vbe:h!==0?DU:UV;break;case Vbe:if(Z===0||P===0&&(E==n.end&&n.read!==0&&(E=0,P=E<n.read?n.read-E-1:n.end-E),P===0&&(n.write=E,x=n.inflate_flush(y,x),E=n.write,P=E<n.read?n.read-E-1:n.end-E,E==n.end&&n.read!==0&&(E=0,P=E<n.read?n.read-E-1:n.end-E),P===0)))return n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);if(x=0,S=o,S>Z&&(S=Z),S>P&&(S=P),n.win.set(y.read_buf(L,S),E),L+=S,Z-=S,E+=S,P-=S,(o-=S)!==0)break;i=h!==0?DU:UV;break;case Lbe:for(;V<14;){if(Z!==0)x=0;else return n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);Z--,C|=(y.read_byte(L++)&255)<<V,V+=8}if(r=S=C&16383,(S&31)>29||(S>>5&31)>29)return i=UT,y.msg="too many length or distance symbols",x=-3,n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);if(S=258+(S&31)+(S>>5&31),!a||a.length<S)a=[];else for(W=0;W<S;W++)a[W]=0;C>>>=14,V-=14,s=0,i=Rbe;case Rbe:for(;s<4+(r>>>10);){for(;V<3;){if(Z!==0)x=0;else return n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);Z--,C|=(y.read_byte(L++)&255)<<V,V+=8}a[Cbe[s++]]=C&7,C>>>=3,V-=3}for(;s<19;)a[Cbe[s++]]=0;if(c[0]=7,S=f.inflate_trees_bits(a,c,d,p,y),S!=0)return x=S,x==-3&&(a=null,i=UT),n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);s=0,i=Zbe;case Zbe:for(;S=r,!(s>=258+(S&31)+(S>>5&31));){let O,k;for(S=c[0];V<S;){if(Z!==0)x=0;else return n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);Z--,C|=(y.read_byte(L++)&255)<<V,V+=8}if(S=p[(d[0]+(C&zd[S]))*3+1],k=p[(d[0]+(C&zd[S]))*3+2],k<16)C>>>=S,V-=S,a[s++]=k;else{for(W=k==18?7:k-14,O=k==18?11:3;V<S+W;){if(Z!==0)x=0;else return n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);Z--,C|=(y.read_byte(L++)&255)<<V,V+=8}if(C>>>=S,V-=S,O+=C&zd[W],C>>>=W,V-=W,W=s,S=r,W+O>258+(S&31)+(S>>5&31)||k==16&&W<1)return a=null,i=UT,y.msg="invalid bit length repeat",x=-3,n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);k=k==16?a[W-1]:0;do a[W++]=k;while(--O!==0);s=W}}if(d[0]=-1,G=[],I=[],w=[],M=[],G[0]=9,I[0]=6,S=r,S=f.inflate_trees_dynamic(257+(S&31),1+(S>>5&31),a,G,I,w,M,p,y),S!=0)return S==-3&&(a=null,i=UT),x=S,n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);u.init(G[0],I[0],p,w[0],p,M[0]),i=UU;case UU:if(n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,(x=u.proc(n,y,x))!=1)return n.inflate_flush(y,x);if(x=0,u.free(y),L=y.next_in_index,Z=y.avail_in,C=n.bitb,V=n.bitk,E=n.write,P=E<n.read?n.read-E-1:n.end-E,h===0){i=UV;break}i=DU;case DU:if(n.write=E,x=n.inflate_flush(y,x),E=n.write,P=E<n.read?n.read-E-1:n.end-E,n.read!=n.write)return n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);i=Gbe;case Gbe:return x=1,n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);case UT:return x=-3,n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x);default:return x=-2,n.bitb=C,n.bitk=V,y.avail_in=Z,y.total_in+=L-y.next_in_index,y.next_in_index=L,n.write=E,n.inflate_flush(y,x)}}},n.free=function(y){n.reset(y,null),n.win=null,p=null},n.set_dictionary=function(y,x,S){n.win.set(y.subarray(x,x+S),0),n.read=n.write=S},n.sync_point=function(){return i==a4?1:0}}var Dot=32,Oot=8,Bot=0,Ebe=1,Ibe=2,Xbe=3,Wbe=4,Pbe=5,c4=6,gw=7,vbe=12,_y=13,Yot=[0,0,255,255];function zot(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=gw,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new Uot(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==Xot?-5:0,o=-5;;)switch(s.mode){case Bot:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=Oot){s.mode=_y,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=_y,n.msg="invalid win size",s.marker=5;break}s.mode=Ebe;case Ebe:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=_y,n.msg="incorrect header check",s.marker=5;break}if((r&Dot)===0){s.mode=gw;break}s.mode=Ibe;case Ibe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=Xbe;case Xbe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=Wbe;case Wbe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=Pbe;case Pbe:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=c4,2);case c4:return s.mode=_y,n.msg="need dictionary",s.marker=0,-2;case gw:if(o=s.blocks.proc(n,o),o==-3){s.mode=_y,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=vbe;case vbe:return n.avail_in=0,1;case _y:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=c4)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=gw,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=_y&&(c.mode=_y,c.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=c.marker;i!==0&&r<4;)n.read_byte(o)==Yot[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,c.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=gw,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function Fbe(){}Fbe.prototype={inflateInit(e){let t=this;return t.istate=new zot,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};function Abe(e){let t=this,n=new Fbe,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=Iot,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let d=[],u,h,p=0,g=0,f=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),u=n.inflate(o),s&&u===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(u!==0&&u!==1)throw new Error("inflating: "+n.msg);if((s||u===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?d.push(new Uint8Array(r)):d.push(r.subarray(0,n.next_out_index))),f+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return d.length>1?(h=new Uint8Array(f),d.forEach(function(y){h.set(y,g),g+=y.length})):h=d[0]?new Uint8Array(d[0]):new Uint8Array,h}},t.flush=function(){n.inflateEnd()}}var g_i=_(T(),1);var d_i=_(T(),1);var DT="/",d4=new Date(2107,11,31),u4=new Date(1980,0,1),Zi=void 0,Hd="undefined",s0="function";var m_i=_(T(),1);var yw=class{constructor(t){return class extends TransformStream{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var Hot=64,Mbe=2;try{typeof navigator!=Hd&&navigator.hardwareConcurrency&&(Mbe=navigator.hardwareConcurrency)}catch{}var Kot={chunkSize:512*1024,maxWorkers:Mbe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Zi,CompressionStreamNative:typeof CompressionStream!=Hd&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Hd&&DecompressionStream},Sy=Object.assign({},Kot);function xw(){return Sy}function OU(e){return Math.max(e.chunkSize,Hot)}function DV(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:d,DecompressionStream:u,workerScripts:h}=e;if(Ty("baseURL",t),Ty("chunkSize",n),Ty("maxWorkers",i),Ty("terminateWorkerTimeout",o),Ty("useCompressionStream",r),Ty("useWebWorkers",s),a&&(Sy.CompressionStream=new yw(a)),c&&(Sy.DecompressionStream=new yw(c)),Ty("CompressionStream",d),Ty("DecompressionStream",u),h!==Zi){let{deflate:p,inflate:g}=h;if((p||g)&&(Sy.workerScripts||(Sy.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");Sy.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");Sy.workerScripts.inflate=g}}}function Ty(e,t){t!==Zi&&(Sy[e]=t)}var x_i=_(T(),1);var uTi=_(T(),1);var nTi=_(T(),1);var $_i=_(T(),1);var V_i=_(T(),1);var T_i=_(T(),1),Nbe=[];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;Nbe[e]=t}var a0=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^Nbe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var _w=class extends TransformStream{constructor(){let t,n=new a0;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};var O_i=_(T(),1);var Z_i=_(T(),1);function OV(e){if(typeof TextEncoder==Hd){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 E_i=_(T(),1),hl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=hl.getPartial(n);return i===32?e.concat(t):hl._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+hl.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]=hl.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=hl.getPartial(o);return i.push(hl.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},Tw={bytes:{fromBits(e){let n=hl.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(hl.partial(8*(n&3),i)),t}}},kbe={};kbe.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=Tw.utf8String.toBits(e));let n=t._buffer=hl.concat(t._buffer,e),i=t._length,o=t._length=i+hl.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=hl.concat(t,[hl.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let d=0;d<16;d++)i[d]=e[d];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=t._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));let u=t._S(5,o)+t._f(d,r,s,a)+c+i[d]+t._key[Math.floor(d/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var m4={};m4.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let d=s[r-1];(r%o===0||o===8&&r%o===4)&&(d=n[d>>>24]<<24^n[d>>16&255]<<16^n[d>>8&255]<<8^n[d&255],r%o===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^d}for(let d=0;r;d++,r--){let u=s[d&3?r:r-4];r<=4||d<4?a[d]=u:a[d]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,d;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[u]=h,i[h]=u,d=o[c=o[a=o[u]]];let p=d*16843009^c*65537^a*257^u*16843008,g=o[h]*257^h*16843008;for(let f=0;f<4;f++)e[f][u]=g=g<<24^g>>>8,t[f][h]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],d=r[3],u=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],f=e[t?1:3]^n[3],y=4,x,S,C;for(let V=0;V<i;V++)x=s[h>>>24]^a[p>>16&255]^c[g>>8&255]^d[f&255]^n[y],S=s[p>>>24]^a[g>>16&255]^c[f>>8&255]^d[h&255]^n[y+1],C=s[g>>>24]^a[f>>16&255]^c[h>>8&255]^d[p&255]^n[y+2],f=s[f>>>24]^a[h>>16&255]^c[p>>8&255]^d[g&255]^n[y+3],y+=4,h=x,p=S,g=C;for(let V=0;V<4;V++)o[t?3&-V:V]=u[h>>>24]<<24^u[p>>16&255]<<16^u[g>>8&255]<<8^u[f&255]^n[y++],x=h,h=p,p=g,g=f,f=x;return o}};var Ube={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}},h4={};h4.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=hl.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return hl.clamp(t,o)}};var Cy={importKey(e){return new Cy.hmacSha1(Tw.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,d,u=new ArrayBuffer(o),h=new DataView(u),p=0,g=hl;for(t=Tw.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(g.concat(t,[d])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)h.setInt32(p,r[a]),p+=4}return u.slice(0,i/8)}};Cy.hmacSha1=class{constructor(e){let t=this,n=t._hash=kbe.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 A_i=_(T(),1);var Jot=typeof crypto!=Hd&&typeof crypto.getRandomValues==s0,Vy="Invalid password",OT="Invalid signature",c0="zipjs-abort-check-password";function BU(e){return Jot?crypto.getRandomValues(e):Ube.getRandomValues(e)}var BV=16,Qot="raw",Bbe={name:"PBKDF2"},jot={name:"HMAC"},qot="SHA-1",$ot=Object.assign({hash:jot},Bbe),f4=Object.assign({iterations:1e3,hash:{name:qot}},Bbe),ert=["deriveBits"],Cw=[8,12,16],Sw=[16,24,32],Ly=10,trt=[0,0,0,0],HU=typeof crypto!=Hd,Rw=HU&&crypto.subtle,Ybe=HU&&typeof Rw!=Hd,Df=Tw.bytes,nrt=m4.aes,irt=h4.ctrGladman,ort=Cy.hmacSha1,Dbe=HU&&Ybe&&typeof Rw.importKey==s0,Obe=HU&&Ybe&&typeof Rw.deriveBits==s0,YU=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:Kbe(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:h,ready:p}=c;d?(await rrt(c,u,d,am(s,0,Cw[u]+2)),s=am(s,Cw[u]+2),r?a.error(new Error(c0)):h()):await p;let g=new Uint8Array(s.length-Ly-(s.length-Ly)%BV);a.enqueue(zbe(c,s,g,0,Ly,!0))},async flush(s){let{signed:a,ctr:c,hmac:d,pending:u,ready:h}=this;if(d&&c){await h;let p=am(u,0,u.length-Ly),g=am(u,u.length-Ly),f=new Uint8Array;if(p.length){let y=Lw(Df,p);d.update(y);let x=c.update(y);f=Vw(Df,x)}if(a){let y=am(Vw(Df,d.digest()),0,Ly);for(let x=0;x<Ly;x++)if(y[x]!=g[x])throw new Error(OT)}s.enqueue(f)}}})}},zU=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:Kbe(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:d,resolveReady:u,ready:h}=a,p=new Uint8Array;c?(p=await srt(a,d,c),u()):await h;let g=new Uint8Array(p.length+r.length-r.length%BV);g.set(p,0),s.enqueue(zbe(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:d}=this;if(a&&s){await d;let u=new Uint8Array;if(c.length){let h=s.update(Lw(Df,c));a.update(h),u=Vw(Df,h)}o.signature=Vw(Df,a.digest()).slice(0,Ly),r.enqueue(p4(u,o.signature))}}}),o=this}};function zbe(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,d=t.length-o;c.length&&(t=p4(c,t),n=lrt(n,d-d%BV));let u;for(u=0;u<=d-BV;u+=BV){let h=Lw(Df,am(t,u,u+BV));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(Vw(Df,p),u+i)}return e.pending=am(t,u),n}async function rrt(e,t,n,i){let o=await Hbe(e,t,n,am(i,0,Cw[t])),r=am(i,Cw[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(Vy)}async function srt(e,t,n){let i=BU(new Uint8Array(Cw[t])),o=await Hbe(e,t,n,i);return p4(i,o)}async function Hbe(e,t,n,i){e.password=null;let o=await art(Qot,n,$ot,!1,ert),r=await crt(Object.assign({salt:i},f4),o,8*(Sw[t]*2+2)),s=new Uint8Array(r),a=Lw(Df,am(s,0,Sw[t])),c=Lw(Df,am(s,Sw[t],Sw[t]*2)),d=am(s,Sw[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new irt(new nrt(a),Array.from(trt)),hmac:new ort(c)}),d}async function art(e,t,n,i,o){if(Dbe)try{return await Rw.importKey(e,t,n,i,o)}catch{return Dbe=!1,Cy.importKey(t)}else return Cy.importKey(t)}async function crt(e,t,n){if(Obe)try{return await Rw.deriveBits(e,t,n)}catch{return Obe=!1,Cy.pbkdf2(t,e.salt,f4.iterations,n)}else return Cy.pbkdf2(t,e.salt,f4.iterations,n)}function Kbe(e,t){return t===Zi?OV(e):t}function p4(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 lrt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function am(e,t,n){return e.subarray(t,n)}function Vw(e,t){return e.fromBits(t)}function Lw(e,t){return e.toBits(t)}var H_i=_(T(),1);var YV=12,KU=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),qbe(this,t)},transform(o,r){let s=this;if(s.password){let a=Jbe(s,o.subarray(0,YV));if(s.password=null,a[YV-1]!=s.passwordVerification)throw new Error(Vy);o=o.subarray(YV)}i?r.error(new Error(c0)):r.enqueue(Jbe(s,o))}})}},JU=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),qbe(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=BU(new Uint8Array(YV));c[YV-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(Qbe(r,c),0),a=YV}else s=new Uint8Array(i.length),a=0;s.set(Qbe(r,i),a),o.enqueue(s)}})}};function Jbe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=$be(e)^t[i],b4(e,n[i]);return n}function Qbe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=$be(e)^t[i],b4(e,t[i]);return n}function qbe(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new a0(n[0]),crcKey2:new a0(n[2])});for(let i=0;i<t.length;i++)b4(e,t.charCodeAt(i))}function b4(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=jbe(Math.imul(jbe(i+e0e(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function $be(e){let t=e.keys[2]|2;return e0e(Math.imul(t,t^1)>>>8)}function e0e(e){return e&255}function jbe(e){return e&4294967295}var t0e="deflate-raw",QU=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:d,level:u}=t,h=this,p,g,f=n0e(super.readable);(!s||c)&&d&&(p=new _w,f=Of(f,p)),r&&(f=o0e(f,a,{level:u,chunkSize:n},o,i)),s&&(c?f=Of(f,new JU(t)):(g=new zU(t),f=Of(f,g))),i0e(h,f,()=>{let y;s&&!c&&(y=g.signature),(!s||c)&&d&&(y=new DataView(p.value.buffer).getUint32(0)),h.signature=y})}},jU=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:d,useCompressionStream:u}=t,h,p,g=n0e(super.readable);s&&(r?g=Of(g,new KU(t)):(p=new YU(t),g=Of(g,p))),d&&(g=o0e(g,u,{chunkSize:n},o,i)),(!s||r)&&a&&(h=new _w,g=Of(g,h)),i0e(this,g,()=>{if((!s||r)&&a){let f=new DataView(h.value.buffer);if(c!=f.getUint32(0,!1))throw new Error(OT)}})}};function n0e(e){return Of(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function i0e(e,t,n){t=Of(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function o0e(e,t,n,i,o){try{let r=t&&i?i:o;e=Of(e,new r(t0e,n))}catch{if(t)try{e=Of(e,new o(t0e,n))}catch{return e}else return e}return e}function Of(e,t){return e.pipeThrough(t)}var r0e="message",s0e="start",a0e="pull",g4="data",c0e="ack",y4="close",eD="deflate",tD="inflate";var qU=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(eD)?r=QU:o.startsWith(tD)&&(r=jU);let s=0,a=0,c=new r(t,n),d=super.readable,u=new TransformStream({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),h=new TransformStream({transform(p,g){p&&p.length&&(s+=p.length,g.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return d.pipeThrough(u).pipeThrough(c).pipeThrough(h)}})}},$U=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var sTi=_(T(),1);var u0e=typeof Worker!=Hd;var zV=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:d},u){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new $U(r.chunkSize)).pipeThrough(new _4(n,s),{signal:h}),writable:i,options:Object.assign({},o),scripts:d,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:f}=t;g?(f?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,u(t)}}),(a&&u0e?drt:m0e)(t,r)}},_4=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await x4(n,o)},async transform(a,c){s+=a.length,i&&await x4(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await x4(r,s)}})}};async function x4(e,...t){try{await e(...t)}catch{}}function m0e(e,t){return{run:()=>urt(e,t)}}function drt(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=frt(e.scripts[0],n,e)}catch{return u0e=!1,m0e(e,t)}Object.assign(e,{worker:o,interface:{run:()=>mrt(e,{chunkSize:i})}})}return e.interface}async function urt({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new qU(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}finally{i()}}async function mrt(e,t){let n,i,o=new Promise((p,g)=>{n=p,i=g});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:d}=hrt(e.writable),u=nD({type:s0e,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);u||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let h=await o;return u||await c.getWriter().close(),await d,h}function hrt(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 l0e=!0,d0e=!0;function frt(e,t,n){let i={type:"module"},o,r;typeof e==s0&&(e=e());try{o=new URL(e,t)}catch{o=e}if(l0e)try{r=new Worker(o)}catch{l0e=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(r0e,s=>prt(s,n)),r}function nD(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=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&&d0e?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{d0e=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function prt({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:d,rejectResult:u,onTaskFinished:h}=t;try{if(s){let{message:g,stack:f,code:y,name:x}=s,S=new Error(g);Object.assign(S,{stack:f,code:y,name:x}),p(S)}else{if(n==a0e){let{value:g,done:f}=await a.read();nD({type:g4,value:g,done:f,messageId:o},t)}n==g4&&(await c.ready,await c.write(new Uint8Array(i)),nD({type:c0e,messageId:o},t)),n==y4&&p(null,r)}}catch(g){nD({type:y4,messageId:o},t),p(g)}function p(g,f){g?u(g):d(f),c&&c.releaseLock(),h()}}var BT=[],T4=[];var h0e=0;async function iD(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:c,signed:d,encrypted:u}=n,{workerScripts:h,maxWorkers:p}=i;t.transferStreams=o||o===Zi;let g=!c&&!d&&!u&&!t.transferStreams;return t.useWebWorkers=!g&&(r||r===Zi&&i.useWebWorkers),t.scripts=t.useWebWorkers&&h?h[a]:[],n.useCompressionStream=s||s===Zi&&i.useCompressionStream,(await f()).run();async function f(){let x=BT.find(S=>!S.busy);if(x)return f0e(x),new zV(x,e,t,y);if(BT.length<p){let S={indexWorker:h0e};return h0e++,BT.push(S),new zV(S,e,t,y)}else return new Promise(S=>T4.push({resolve:S,stream:e,workerOptions:t}))}function y(x){if(T4.length){let[{resolve:S,stream:C,workerOptions:V}]=T4.splice(0,1);S(new zV(x,C,V,y))}else x.worker?(f0e(x),brt(x,t)):BT=BT.filter(S=>S!=x)}}function brt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{BT=BT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function f0e(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var pTi=_(T(),1);var grt="Writer iterator completed too soon",yrt="text/plain";var xrt="Content-Type";var _rt=64*1024,V4="writable",HV=class{constructor(){this.size=0}init(){this.initialized=!0}},oD=class extends HV{get readable(){let t=this,{chunkSize:n=_rt}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this;o.enqueue(await za(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},S4=class extends HV{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,V4,{get(){return n}})}writeUint8Array(){}};var rD=class extends S4{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length>2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},l0=class extends oD{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return s.byteLength>n&&(s=s.slice(t,o)),new Uint8Array(s)}},Zw=class extends HV{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([xrt,t]),Object.defineProperty(n,V4,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},sD=class extends l0{constructor(t){super(new Blob([t],{type:yrt}))}},aD=class extends Zw{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var C4=class extends oD{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;c>=r[a].size;)c-=r[a].size,a++;let d=r[a],u=d.size;if(c+n<=u)s=await za(d,c,n);else{let h=u-c;s=new Uint8Array(n),s.set(await za(d,c,h)),s.set(await o.readUint8Array(t+h,n-h,i),h)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},cD=class extends HV{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(u){let{availableSize:h}=i;if(s)u.length>=h?(await c(u.slice(0,h)),await d(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(u.slice(h))):await c(u);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(grt);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Yf(o),r=p.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await d()}});Object.defineProperty(i,V4,{get(){return a}});async function c(u){let h=u.length;h&&(await s.ready,await s.write(u),o.size+=h,i.size+=h,i.availableSize-=h)}async function d(){r.size=o.size,await s.close()}}};async function Yf(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function lD(e){return Array.isArray(e)&&(e=new C4(e)),e instanceof ReadableStream&&(e={readable:e}),e}function dD(e){e.writable===Zi&&typeof e.next==s0&&(e=new cD(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Zi&&(t.size=0),e instanceof cD||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function za(e,t,n,i){return e.readUint8Array(t,n,i)}var XTi=_(T(),1);var _Ti=_(T(),1);var gTi=_(T(),1),p0e="\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(""),Trt=p0e.length==256;function b0e(e){if(Trt){let t="";for(let n=0;n<e.length;n++)t+=p0e[e[n]];return t}else return new TextDecoder().decode(e)}function Gw(e,t){return t&&t.trim().toLowerCase()=="cp437"?b0e(e):new TextDecoder(t).decode(e)}var STi=_(T(),1),L4="filename",R4="rawFilename",Z4="comment",G4="rawComment",E4="uncompressedSize",I4="compressedSize",X4="offset",uD="diskNumberStart",KV="lastModDate",mD="rawLastModDate",Ew="lastAccessDate",g0e="rawLastAccessDate",Iw="creationDate",y0e="rawCreationDate",W4="internalFileAttribute",P4="internalFileAttributes",v4="externalFileAttribute",w4="externalFileAttributes",F4="msDosCompatible",hD="zip64",A4="encrypted",M4="version",N4="versionMadeBy",k4="zipCrypto",U4="directory",D4="executable",Srt=[L4,R4,I4,E4,KV,mD,Z4,G4,Ew,Iw,X4,uD,uD,W4,P4,v4,w4,F4,hD,A4,M4,N4,k4,U4,D4,"bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],Ry=class{constructor(t){Srt.forEach(n=>this[n]=t[n])}};var O4="File format is not recognized",Rrt="End of central directory not found",Zrt="End of Zip64 central directory locator not found",Grt="Central directory header not found",Ert="Local file header not found",Irt="Zip64 extra field not found",Xrt="File contains encrypted entry",Wrt="Encryption method not supported",x0e="Compression method not supported",_0e="Split zip file",T0e="utf-8",S0e="cp437",Prt=[[E4,4294967295],[I4,4294967295],[X4,4294967295],[uD,65535]],vrt={[65535]:{getValue:Cs,bytes:4},[4294967295]:{getValue:fD,bytes:8}},CD=class{constructor(t,n={}){Object.assign(this,{reader:lD(t),options:n,config:xw()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Yf(i),(i.size===Zi||!i.readUint8Array)&&(i=new l0(await new Response(i.readable).blob()),await Yf(i)),i.size<22)throw new Error(O4);i.chunkSize=OU(o);let r=await Nrt(i,101010256,i.size,22,65535*16);if(!r){let A=await za(i,0,4),b=Ra(A);throw Cs(b)==134695760?new Error(_0e):new Error(Rrt)}let s=Ra(r),a=Cs(s,12),c=Cs(s,16),d=r.offset,u=La(s,20),h=d+22+u,p=La(s,4),g=i.lastDiskNumber||0,f=La(s,6),y=La(s,8),x=0,S=0;if(c==4294967295||a==4294967295||y==65535||f==65535){let A=await za(i,r.offset-20,20),b=Ra(A);if(Cs(b,0)==117853008){c=fD(b,8);let R=await za(i,c,56,-1),G=Ra(R),I=r.offset-20-56;if(Cs(G,0)!=101075792&&c!=I){let w=c;c=I,x=c-w,R=await za(i,c,56,-1),G=Ra(R)}if(Cs(G,0)!=101075792)throw new Error(Zrt);p==65535&&(p=Cs(G,16)),f==65535&&(f=Cs(G,20)),y==65535&&(y=fD(G,32)),a==4294967295&&(a=fD(G,40)),c-=a}}if(c>=i.size&&(x=i.size-c-a-22,c=i.size-a-22),g!=p)throw new Error(_0e);if(c<0)throw new Error(O4);let C=0,V=await za(i,c,a,f),L=Ra(V);if(a){let A=r.offset-a;if(Cs(L,C)!=33639248&&c!=A){let b=c;c=A,x+=c-b,V=await za(i,c,a,f),L=Ra(V)}}let Z=r.offset-c-(i.lastDiskOffset||0);if(a!=Z&&Z>=0&&(a=Z,V=await za(i,c,a,f),L=Ra(V)),c<0||c>=i.size)throw new Error(O4);let E=fl(n,t,"filenameEncoding"),P=fl(n,t,"commentEncoding");for(let A=0;A<y;A++){let b=new Y4(i,o,n.options);if(Cs(L,C)!=33639248)throw new Error(Grt);V0e(b,L,C+6);let R=!!b.bitFlag.languageEncodingFlag,G=C+46,I=G+b.filenameLength,w=I+b.extraFieldLength,M=La(L,C+4),O=M>>8==0,k=M>>8==3,B=V.subarray(G,I),N=La(L,C+32),z=w+N,K=V.subarray(w,z),te=R,H=R,j=Cs(L,C+38),ee=O&&(JV(L,C+38)&16)==16||k&&(j>>16&16384)==16384||B.length&&B[B.length-1]==DT.charCodeAt(0),pe=k&&(j>>16&73)==73,_e=Cs(L,C+42)+x;Object.assign(b,{versionMadeBy:M,msDosCompatible:O,compressedSize:0,uncompressedSize:0,commentLength:N,directory:ee,offset:_e,diskNumberStart:La(L,C+34),internalFileAttributes:La(L,C+36),externalFileAttributes:j,rawFilename:B,filenameUTF8:te,commentUTF8:H,rawExtraField:V.subarray(I,w),executable:pe}),b.internalFileAttribute=b.internalFileAttributes,b.externalFileAttribute=b.externalFileAttributes;let ae=fl(n,t,"decodeText")||Gw,ye=te?T0e:E||S0e,Se=H?T0e:P||S0e,Ee=ae(B,ye);Ee===Zi&&(Ee=Gw(B,ye));let Ie=ae(K,Se);Ie===Zi&&(Ie=Gw(K,Se)),Object.assign(b,{rawComment:K,filename:Ee,comment:Ie,directory:ee||Ee.endsWith(DT)}),S=Math.max(_e,S),L0e(b,b,L,C+6),b.zipCrypto=b.encrypted&&!b.extraFieldAES;let Fe=new Ry(b);Fe.getData=(ct,Je)=>b.getData(ct,Fe,Je),C=z;let{onprogress:ve}=t;if(ve)try{await ve(A+1,y,new Ry(b))}catch{}yield Fe}let W=fl(n,t,"extractPrependedData"),v=fl(n,t,"extractAppendedData");return W&&(n.prependedData=S>0?await za(i,0,S):new Uint8Array),n.comment=u?await za(i,d+22,u):new Uint8Array,v&&(n.appendedData=h<i.size?await za(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 Y4=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:c,compressionMethod:d,config:u,bitFlag:h,signature:p,rawLastModDate:g,uncompressedSize:f,compressedSize:y}=o,x=n.localDirectory={},S=await za(r,s,30,a),C=Ra(S),V=fl(o,i,"password"),L=fl(o,i,"rawPassword"),Z=fl(o,i,"passThrough");if(V=V&&V.length&&V,L=L&&L.length&&L,c&&c.originalCompressionMethod!=99)throw new Error(x0e);if(d!=0&&d!=8&&!Z)throw new Error(x0e);if(Cs(C,0)!=67324752)throw new Error(Ert);V0e(x,C,4),x.rawExtraField=x.extraFieldLength?await za(r,s+30+x.filenameLength,x.extraFieldLength,a):new Uint8Array,L0e(o,x,C,4,!0),Object.assign(n,{lastAccessDate:x.lastAccessDate,creationDate:x.creationDate});let E=o.encrypted&&x.encrypted&&!Z,P=E&&!c;if(Z||(n.zipCrypto=P),E){if(!P&&c.strength===Zi)throw new Error(Wrt);if(!V&&!L)throw new Error(Xrt)}let W=s+30+x.filenameLength+x.extraFieldLength,v=y,A=r.readable;Object.assign(A,{diskNumberStart:a,offset:W,size:v});let b=fl(o,i,"signal"),R=fl(o,i,"checkPasswordOnly");R&&(t=new WritableStream),t=dD(t),await Yf(t,Z?y:f);let{writable:G}=t,{onstart:I,onprogress:w,onend:M}=i,O={options:{codecType:tD,password:V,rawPassword:L,zipCrypto:P,encryptionStrength:c&&c.strength,signed:fl(o,i,"checkSignature")&&!Z,passwordVerification:P&&(h.dataDescriptor?g>>>8&255:p>>>24&255),signature:p,compressed:d!=0&&!Z,encrypted:o.encrypted&&!Z,useWebWorkers:fl(o,i,"useWebWorkers"),useCompressionStream:fl(o,i,"useCompressionStream"),transferStreams:fl(o,i,"transferStreams"),checkPasswordOnly:R},config:u,streamOptions:{signal:b,size:v,onstart:I,onprogress:w,onend:M}},k=0;try{({outputSize:k}=await iD({readable:A,writable:G},O))}catch(B){if(!R||B.message!=c0)throw B}finally{let B=fl(o,i,"preventClose");G.size+=k,!B&&!G.locked&&await G.getWriter().close()}return R?Zi:t.getData?t.getData():G}};function V0e(e,t,n){let i=e.rawBitFlag=La(t,n+2),o=(i&1)==1,r=Cs(t,n+6);Object.assign(e,{encrypted:o,version:La(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:krt(r),filenameLength:La(t,n+22),extraFieldLength:La(t,n+24)})}function L0e(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=Ra(new Uint8Array(r)),c=0;try{for(;c<r.length;){let S=La(a,c),C=La(a,c+2);s.set(S,{type:S,data:r.slice(c+4,c+4+C)}),c+=4+C}}catch{}let d=La(n,i+4);Object.assign(t,{signature:Cs(n,i+10),uncompressedSize:Cs(n,i+18),compressedSize:Cs(n,i+14)});let u=s.get(1);u&&(wrt(u,t),t.extraFieldZip64=u);let h=s.get(28789);h&&(C0e(h,L4,R4,t,e),t.extraFieldUnicodePath=h);let p=s.get(25461);p&&(C0e(p,Z4,G4,t,e),t.extraFieldUnicodeComment=p);let g=s.get(39169);g?(Frt(g,t,d),t.extraFieldAES=g):t.compressionMethod=d;let f=s.get(10);f&&(Art(f,t),t.extraFieldNTFS=f);let y=s.get(21589);y&&(Mrt(y,t,o),t.extraFieldExtendedTimestamp=y);let x=s.get(6534);x&&(t.extraFieldUSDZ=x)}function wrt(e,t){t.zip64=!0;let n=Ra(e.data),i=Prt.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[s,a]=i[o];if(t[s]==a){let c=vrt[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(Irt)}}function C0e(e,t,n,i,o){let r=Ra(e.data),s=new a0;s.append(o[n]);let a=Ra(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Cs(r,1);Object.assign(e,{version:JV(r,0),[t]:Gw(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==Cs(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function Frt(e,t,n){let i=Ra(e.data),o=JV(i,4);Object.assign(e,{vendorVersion:JV(i,0),vendorId:JV(i,2),strength:o,originalCompressionMethod:n,compressionMethod:La(i,5)}),t.compressionMethod=e.compressionMethod}function Art(e,t){let n=Ra(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=La(n,i),s=La(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=Ra(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let d=B4(s),u=B4(a),h=B4(c),p={lastModDate:d,lastAccessDate:u,creationDate:h};Object.assign(e,p),Object.assign(t,p)}}catch{}}function Mrt(e,t,n){let i=Ra(e.data),o=JV(i,0),r=[],s=[];n?((o&1)==1&&(r.push(KV),s.push(mD)),(o&2)==2&&(r.push(Ew),s.push(g0e)),(o&4)==4&&(r.push(Iw),s.push(y0e))):e.data.length>=5&&(r.push(KV),s.push(mD));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=Cs(i,a);t[c]=e[c]=new Date(u*1e3);let h=s[d];e[h]=u}a+=4})}async function Nrt(e,t,n,i,o){let r=new Uint8Array(4),s=Ra(r);Urt(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(d){let u=n-d,h=await za(e,u,d);for(let p=h.length-i;p>=0;p--)if(h[p]==r[0]&&h[p+1]==r[1]&&h[p+2]==r[2]&&h[p+3]==r[3])return{offset:u+p,buffer:h.slice(p,p+i).buffer}}}function fl(e,t,n){return t[n]===Zi?e.options[n]:t[n]}function krt(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 B4(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function JV(e,t){return e.getUint8(t)}function La(e,t){return e.getUint16(t,!0)}function Cs(e,t){return e.getUint32(t,!0)}function fD(e,t){return Number(e.getBigUint64(t,!0))}function Urt(e,t,n){e.setUint32(t,n,!0)}function Ra(e){return new DataView(e.buffer)}var NTi=_(T(),1);var Yrt="File already exists",zrt="Zip file comment exceeds 64KB",Hrt="File entry comment exceeds 64KB",Krt="File entry name exceeds 64KB",E0e="Version exceeds 65535",Jrt="The strength must equal 1, 2, or 3",Qrt="Extra field type exceeds 65535",jrt="Extra field data exceeds 64KB",sj="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",qrt="Undefined uncompressed size",I0e=new Uint8Array([7,0,2,0,65,69,3,0,0]),ij=0,X0e=[],RD=class{constructor(t,n={}){t=dD(t);let i=t.availableSize!==Zi&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Zi&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:xw(),files:new Map,filenames:new Set,offset:n.offset===Zi?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;ij<s.maxWorkers?ij++:await new Promise(c=>X0e.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(Yrt);return o.filenames.add(t),a=$rt(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=X0e.shift();c?c():ij--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await cst(this,t,n),ji(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function $rt(e,t,n,i){t=t.trim();let o=ji(e,i,F4),r=ji(e,i,N4,o?20:768),s=ji(e,i,D4);if(r>65535)throw new Error(E0e);let a=ji(e,i,w4,0);a===0&&(a=ji(e,i,v4,0)),!i.directory&&t.endsWith(DT)&&(i.directory=!0),ji(e,i,U4)?(t.endsWith(DT)||(t+=DT),a===0&&(o?a=16:a=16384<<16)):!o&&a===0&&(s?a=493<<16:a=420<<16);let d=ji(e,i,"encodeText",OV),u=d(t);if(u===Zi&&(u=OV(t)),$i(u)>65535)throw new Error(Krt);let h=i.comment||"",p=d(h);if(p===Zi&&(p=OV(h)),$i(p)>65535)throw new Error(Hrt);let g=ji(e,i,M4,20);if(g>65535)throw new Error(E0e);let f=ji(e,i,KV,new Date),y=ji(e,i,Ew),x=ji(e,i,Iw),S=ji(e,i,P4,0);S===0&&(S=ji(e,i,W4,0));let C=ji(e,i,"passThrough"),V,L;C||(V=ji(e,i,"password"),L=ji(e,i,"rawPassword"));let Z=ji(e,i,"encryptionStrength",3),E=ji(e,i,k4),P=ji(e,i,"extendedTimestamp",!0),W=ji(e,i,"keepOrder",!0),v=ji(e,i,"level"),A=ji(e,i,"useWebWorkers"),b=ji(e,i,"bufferedWrite"),R=ji(e,i,"dataDescriptorSignature",!1),G=ji(e,i,"signal"),I=ji(e,i,"useUnicodeFileNames",!0),w=ji(e,i,"useCompressionStream"),M=ji(e,i,"compressionMethod"),O=ji(e,i,"dataDescriptor",!0),k=ji(e,i,hD);if(!E&&(V!==Zi||L!==Zi)&&!(Z>=1&&Z<=3))throw new Error(Jrt);let B=new Uint8Array,{extraField:N}=i;if(N){let Qe=0,Tt=0;N.forEach(ft=>Qe+=4+$i(ft)),B=new Uint8Array(Qe),N.forEach((ft,gt)=>{if(gt>65535)throw new Error(Qrt);if($i(ft)>65535)throw new Error(jrt);Ms(B,new Uint16Array([gt]),Tt),Ms(B,new Uint16Array([$i(ft)]),Tt+2),Ms(B,ft,Tt+4),Tt+=4+$i(ft)})}let z=0,K=0,te=0;if(C&&({uncompressedSize:te}=i,te===Zi))throw new Error(qrt);let H=k===!0;n&&(n=lD(n),await Yf(n),C?z=W0e(te):n.size===Zi?(O=!0,(k||k===Zi)&&(k=!0,te=z=4294967296)):(te=n.size,z=W0e(te)));let{diskOffset:j,diskNumber:ee,maxSize:pe}=e.writer,_e=H||te>4294967295,ae=H||z>4294967295,ye=H||e.offset+e.pendingEntriesSize-j>4294967295,Ee=ji(e,i,"supportZip64SplitFile",!0)&&H||ee+Math.ceil(e.pendingEntriesSize/pe)>65535;if(ye||_e||ae||Ee){if(k===!1||!W)throw new Error(sj);k=!0}k=k||!1;let Ie=ji(e,i,A4),{signature:Fe}=i;i=Object.assign({},i,{rawFilename:u,rawComment:p,version:g,versionMadeBy:r,lastModDate:f,lastAccessDate:y,creationDate:x,rawExtraField:B,zip64:k,zip64UncompressedSize:_e,zip64CompressedSize:ae,zip64Offset:ye,zip64DiskNumberStart:Ee,password:V,rawPassword:L,level:!w&&e.config.CompressionStream===Zi&&e.config.CompressionStreamNative===Zi?0:v,useWebWorkers:A,encryptionStrength:Z,extendedTimestamp:P,zipCrypto:E,bufferedWrite:b,keepOrder:W,useUnicodeFileNames:I,dataDescriptor:O,dataDescriptorSignature:R,signal:G,msDosCompatible:o,internalFileAttribute:S,internalFileAttributes:S,externalFileAttribute:a,externalFileAttributes:a,useCompressionStream:w,passThrough:C,encrypted:!!(V&&$i(V)||L&&$i(L))||C&&Ie,signature:Fe,compressionMethod:M});let ve=nst(i),ct=ost(i),Je=$i(ve.localHeaderArray,ct.dataDescriptorArray);K=Je+z,e.options.usdz&&(K+=K+64),e.pendingEntriesSize+=K;let bt;try{bt=await est(e,t,n,{headerInfo:ve,dataDescriptorInfo:ct,metadataSize:Je},i)}finally{e.pendingEntriesSize-=K}return Object.assign(bt,{name:t,comment:h,extraField:N}),new Ry(bt)}async function est(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:d}=o,{headerInfo:u}=i,{usdz:h}=e.options,p=Array.from(r.values()).pop(),g={},f,y,x,S,C,V,L;r.set(t,g);try{let W;a&&(W=p&&p.lock,Z()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!h?(V=new TransformStream,L=new Response(V.readable).blob(),V.writable.size=0,f=!0,e.bufferedWrites++,await Yf(s)):(V=s,await E()),await Yf(V);let{writable:v}=s,{diskOffset:A}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let R=new Uint8Array(4),G=Ha(R);qi(G,0,134695760),await zf(v,R),e.offset+=4}h&&ist(i,e.offset-A),f||(await W,await P(v));let{diskNumber:b}=s;if(C=!0,g.diskNumberStart=b,g=await tst(n,V,g,i,e.config,o),C=!1,r.set(t,g),g.filename=t,f){await V.writable.getWriter().close();let R=await L;await W,await E(),S=!0,c||(R=await sst(g,R,v,o)),await P(v),g.diskNumberStart=s.diskNumber,A=s.diskOffset,await R.stream().pipeTo(v,{preventClose:!0,preventAbort:!0,signal:d}),v.size+=R.size,S=!1}if(g.offset=e.offset-A,g.zip64)ast(g,o);else if(g.offset>4294967295)throw new Error(sj);return e.offset+=g.size,g}catch(W){if(f&&S||!f&&C){if(e.hasCorruptedEntries=!0,W)try{W.corruptedEntry=!0}catch{}f?e.offset+=V.writable.size:e.offset=V.writable.size}throw r.delete(t),W}finally{f&&e.bufferedWrites--,x&&x(),y&&y()}function Z(){g.lock=new Promise(W=>x=W)}async function E(){e.writerLocked=!0;let{lockWriter:W}=e;e.lockWriter=new Promise(v=>y=()=>{e.writerLocked=!1,v()}),await W}async function P(W){$i(u.localHeaderArray)>s.availableSize&&(s.availableSize=0,await zf(W,new Uint8Array))}}async function tst(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{localHeaderArray:u,headerArray:h,lastModDate:p,rawLastModDate:g,encrypted:f,compressed:y,version:x,compressionMethod:S,rawExtraFieldExtendedTimestamp:C,extraFieldExtendedTimestampFlag:V,rawExtraFieldNTFS:L,rawExtraFieldAES:Z}=a,{dataDescriptorArray:E}=c,{rawFilename:P,lastAccessDate:W,creationDate:v,password:A,rawPassword:b,level:R,zip64:G,zip64UncompressedSize:I,zip64CompressedSize:w,zip64Offset:M,zip64DiskNumberStart:O,zipCrypto:k,dataDescriptor:B,directory:N,executable:z,versionMadeBy:K,rawComment:te,rawExtraField:H,useWebWorkers:j,onstart:ee,onprogress:pe,onend:_e,signal:ae,encryptionStrength:ye,extendedTimestamp:Se,msDosCompatible:Ee,internalFileAttributes:Ie,externalFileAttributes:Fe,useCompressionStream:ve,passThrough:ct}=s,Je={lock:i,versionMadeBy:K,zip64:G,directory:!!N,executable:!!z,filenameUTF8:!0,rawFilename:P,commentUTF8:!0,rawComment:te,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:L,rawExtraFieldAES:Z,rawExtraField:H,extendedTimestamp:Se,msDosCompatible:Ee,internalFileAttributes:Ie,externalFileAttributes:Fe,diskNumberStart:n},{signature:bt,uncompressedSize:Qe}=s,Tt=0;ct||(Qe=0);let{writable:ft}=t;if(e){e.chunkSize=OU(r),await zf(ft,u);let En=e.readable,cn=En.size=e.size,Ce={options:{codecType:eD,level:R,rawPassword:b,password:A,encryptionStrength:ye,zipCrypto:f&&k,passwordVerification:f&&k&&g>>8&255,signed:!ct,compressed:y&&!ct,encrypted:f&&!ct,useWebWorkers:j,useCompressionStream:ve,transferStreams:!1},config:r,streamOptions:{signal:ae,size:cn,onstart:ee,onprogress:pe,onend:_e}},Le=await iD({readable:En,writable:ft},Ce);Tt=Le.outputSize,ct||(Qe=Le.inputSize,bt=Le.signature),ft.size+=Qe}else await zf(ft,u);let gt;if(G){let En=4;I&&(En+=8),w&&(En+=8),M&&(En+=8),O&&(En+=4),gt=new Uint8Array(En)}else gt=new Uint8Array;return rst({signature:bt,rawExtraFieldZip64:gt,compressedSize:Tt,uncompressedSize:Qe,headerInfo:a,dataDescriptorInfo:c},s),B&&await zf(ft,E),Object.assign(Je,{uncompressedSize:Qe,compressedSize:Tt,lastModDate:p,rawLastModDate:g,creationDate:v,lastAccessDate:W,encrypted:f,zipCrypto:k,size:d+Tt,compressionMethod:S,version:x,headerArray:h,signature:bt,rawExtraFieldZip64:gt,extraFieldExtendedTimestampFlag:V,zip64UncompressedSize:I,zip64CompressedSize:w,zip64Offset:M,zip64DiskNumberStart:O}),Je}function nst(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:d,directory:u,rawExtraField:h,encryptionStrength:p,extendedTimestamp:g,encrypted:f}=e,{version:y,compressionMethod:x}=e,S=!u&&(r>0||r===Zi&&x!==0),C;if(f&&!a){C=new Uint8Array($i(I0e)+2);let M=Ha(C);co(M,0,39169),Ms(C,I0e,2),rj(M,8,p)}else C=new Uint8Array;let V,L,Z;if(g){L=new Uint8Array(9+(i?4:0)+(o?4:0));let M=Ha(L);co(M,0,21589),co(M,2,$i(L)-4),Z=1+(i?2:0)+(o?4:0),rj(M,4,Z);let O=5;qi(M,O,Math.floor(n.getTime()/1e3)),O+=4,i&&(qi(M,O,Math.floor(i.getTime()/1e3)),O+=4),o&&qi(M,O,Math.floor(o.getTime()/1e3));try{V=new Uint8Array(36);let k=Ha(V),B=oj(n);co(k,0,10),co(k,2,32),co(k,8,1),co(k,10,24),Jl(k,12,B),Jl(k,20,oj(i)||B),Jl(k,28,oj(o)||B)}catch{V=new Uint8Array}}else V=L=new Uint8Array;let E=0;c&&(E=E|2048),d&&(E=E|8),x===Zi&&(x=S?8:0),x==8&&(r>=1&&r<3&&(E=E|6),r>=3&&r<5&&(E=E|1),r===9&&(E=E|2)),s&&(y=y>45?y:45),f&&(E=E|1,a||(y=y>51?y:51,C[9]=x,x=99));let P=new Uint8Array(26),W=Ha(P);co(W,0,y),co(W,2,E),co(W,4,x);let v=new Uint32Array(1),A=Ha(v),b;n<u4?b=u4:n>d4?b=d4:b=n,co(A,0,(b.getHours()<<6|b.getMinutes())<<5|b.getSeconds()/2),co(A,2,(b.getFullYear()-1980<<4|b.getMonth()+1)<<5|b.getDate());let R=v[0];qi(W,6,R),co(W,22,$i(t));let G=$i(C,L,V,h);co(W,24,G);let I=new Uint8Array(30+$i(t)+G),w=Ha(I);return qi(w,0,67324752),Ms(I,P,4),Ms(I,t,30),Ms(I,C,30+$i(t)),Ms(I,L,30+$i(t,C)),Ms(I,V,30+$i(t,C,L)),Ms(I,h,30+$i(t,C,L,V)),{localHeaderArray:I,headerArray:P,headerView:W,lastModDate:n,rawLastModDate:R,encrypted:f,compressed:S,version:y,compressionMethod:x,extraFieldExtendedTimestampFlag:Z,rawExtraFieldExtendedTimestamp:L,rawExtraFieldNTFS:V,rawExtraFieldAES:C,extraFieldLength:G}}function ist(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ha(i),s=64-(t+$i(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Ha(a);co(c,0,6534),co(c,2,s-2);let d=i;n.localHeaderArray=i=new Uint8Array($i(d)+s),Ms(i,d),Ms(i,a,$i(d)),r=Ha(i),co(r,28,o+s),e.metadataSize+=s}function ost(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=Ha(o),i&&(s=4,qi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function rst(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:d}=s,{dataDescriptorView:u,dataDescriptorOffset:h}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:f,zipCrypto:y,dataDescriptor:x}=t;if((!d||y)&&n!==Zi&&(qi(c,10,n),x&&qi(u,h,n)),p){let S=Ha(i);co(S,0,1),co(S,2,$i(i)-4);let C=4;g&&(qi(c,18,4294967295),Jl(S,C,BigInt(r)),C+=8),f&&(qi(c,14,4294967295),Jl(S,C,BigInt(o))),x&&(Jl(u,h+4,BigInt(o)),Jl(u,h+12,BigInt(r)))}else qi(c,14,o),qi(c,18,r),x&&(qi(u,h+4,o),qi(u,h+8,r))}async function sst(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&qi(r,14,e.signature),e.zip64?(qi(r,18,4294967295),qi(r,22,4294967295)):(qi(r,18,e.compressedSize),qi(r,22,e.uncompressedSize)),await zf(n,new Uint8Array(o)),t.slice(o.byteLength)}function ast(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,d=Ha(n),u=4;r&&(u+=8),s&&(u+=8),a&&(Jl(d,u,BigInt(i)),u+=8),c&&qi(d,u,o)}async function cst(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,d=0,u=e.offset-r,h=i.size;for(let[,Z]of i){let{rawFilename:E,rawExtraFieldZip64:P,rawExtraFieldAES:W,rawComment:v,rawExtraFieldNTFS:A,rawExtraField:b,extendedTimestamp:R,extraFieldExtendedTimestampFlag:G,lastModDate:I}=Z,w;if(R){w=new Uint8Array(9);let M=Ha(w);co(M,0,21589),co(M,2,5),rj(M,4,G),qi(M,5,Math.floor(I.getTime()/1e3))}else w=new Uint8Array;Z.rawExtraFieldCDExtendedTimestamp=w,d+=46+$i(E,v,P,W,A,w,b)}let p=new Uint8Array(d),g=Ha(p);await Yf(o);let f=0;for(let[Z,E]of Array.from(i.values()).entries()){let{offset:P,rawFilename:W,rawExtraFieldZip64:v,rawExtraFieldAES:A,rawExtraFieldCDExtendedTimestamp:b,rawExtraFieldNTFS:R,rawExtraField:G,rawComment:I,versionMadeBy:w,headerArray:M,zip64:O,zip64UncompressedSize:k,zip64CompressedSize:B,zip64DiskNumberStart:N,zip64Offset:z,internalFileAttributes:K,externalFileAttributes:te,diskNumberStart:H,uncompressedSize:j,compressedSize:ee}=E,pe=$i(v,A,b,R,G);qi(g,c,33639248),co(g,c+4,w);let _e=Ha(M);k||qi(_e,18,j),B||qi(_e,14,ee),Ms(p,M,c+6),co(g,c+30,pe),co(g,c+32,$i(I)),co(g,c+34,O&&N?65535:H),co(g,c+36,K),te&&qi(g,c+38,te),qi(g,c+42,O&&z?4294967295:P),Ms(p,W,c+46),Ms(p,v,c+46+$i(W)),Ms(p,A,c+46+$i(W,v)),Ms(p,b,c+46+$i(W,v,A)),Ms(p,R,c+46+$i(W,v,A,b)),Ms(p,G,c+46+$i(W,v,A,b,R)),Ms(p,I,c+46+$i(W)+pe);let ae=46+$i(W,I)+pe;if(c-f>o.availableSize&&(o.availableSize=0,await zf(s,p.slice(f,c)),f=c),c+=ae,n.onprogress)try{await n.onprogress(Z+1,i.size,new Ry(E))}catch{}}await zf(s,f?p.slice(f):p);let y=o.diskNumber,{availableSize:x}=o;x<22&&y++;let S=ji(e,n,hD);if(u>4294967295||d>4294967295||h>65535||y>65535){if(S===!1)throw new Error(sj);S=!0}let C=new Uint8Array(S?98:22),V=Ha(C);c=0,S&&(qi(V,0,101075792),Jl(V,4,BigInt(44)),co(V,12,45),co(V,14,45),qi(V,16,y),qi(V,20,a),Jl(V,24,BigInt(h)),Jl(V,32,BigInt(h)),Jl(V,40,BigInt(d)),Jl(V,48,BigInt(u)),qi(V,56,117853008),Jl(V,64,BigInt(u)+BigInt(d)),qi(V,72,y+1),ji(e,n,"supportZip64SplitFile",!0)&&(y=65535,a=65535),h=65535,u=4294967295,d=4294967295,c+=76),qi(V,c,101010256),co(V,c+4,y),co(V,c+6,a),co(V,c+8,h),co(V,c+10,h),qi(V,c+12,d),qi(V,c+16,u);let L=$i(t);if(L)if(L<=65535)co(V,c+20,L);else throw new Error(zrt);await zf(s,C),L&&await zf(s,t)}async function zf(e,t){let n=e.getWriter();try{await n.ready,e.size+=$i(t),await n.write(t)}finally{n.releaseLock()}}function oj(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function ji(e,t,n,i){let o=t[n]===Zi?e.options[n]:t[n];return o===Zi?i:o}function W0e(e){return e+5*(Math.floor(e/16383)+1)}function rj(e,t,n){e.setUint8(t,n)}function co(e,t,n){e.setUint16(t,n,!0)}function qi(e,t,n){e.setUint32(t,n,!0)}function Jl(e,t,n){e.setBigUint64(t,n,!0)}function Ms(e,t,n){e.set(t,n)}function Ha(e){return new DataView(e.buffer)}function $i(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}DV({Deflate:pbe,Inflate:Abe});var aj=32,lst="http://www.opengis.net/kml/2.2",Ph="http://www.google.com/kml/ext/2.2",dst="http://www.w3.org/2000/xmlns/";function ZD(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var ust=/^data:image\/([^,;]+)/;ZD.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Re){if(e=Re.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(ust);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 mst(e,t){return function(n){e._files[t]=n}}ZD.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new ce("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(mst(this,r))}return o};Object.defineProperties(ZD.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function GD(e){this._time=e}GD.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};GD.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return zT(n)};GD.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function cj(){this._ids={},this._styles={},this._count=0}cj.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};cj.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 F0e(){this._ids={}}F0e.prototype.get=function(e){if(!l(e))return this.get(Hn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function lj(e){e=e??Y.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=lj._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(dst,"xmlns:gx",Ph);let a=r.createElement("Document");s.appendChild(a),M0e(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?hst(u,c.files):{kml:u,externalFiles:c.files}})}function hst(e,t){let n=sn("ThirdParty/Workers/z-worker-pako.js");DV({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new Zw,o=new RD(i);return o.add("doc.kml",new sD(e)).then(function(){let r=Object.keys(t);return A0e(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function A0e(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new l0(n[o])).then(function(){return A0e(e,t,n,i+1)})}lj._createState=function(e){let t=e.entities,n=new cj,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===Oe.MINIMUM_VALUE?r.stop===Oe.MAXIMUM_VALUE?r=new Rn:q.addSeconds(r.stop,-10*s,r.start):r.stop===Oe.MAXIMUM_VALUE&&q.addSeconds(r.start,10*s,r.stop);let a=new ZD(e.modelCallback);return{kmlDoc:document.implementation.createDocument(lst,"kml"),ellipsoid:e.ellipsoid??ne.default,idManager:new F0e,styleCache:n,externalFileHandler:a,time:o,valueGetter:new GD(o),sampleDuration:s,defaultAvailability:new Or([r])}};function M0e(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,d,u;for(let h=0;h<a;++h){let p=n[h];c=[],d=[],u=[],fst(e,p,d,u),pst(e,p.polyline,d,u),w0e(e,p.rectangle,d,u,c),w0e(e,p.polygon,d,u,c),xst(e,p,p.model,d,u);let g,f=p.availability;l(f)&&(g=i.createElement("TimeSpan"),q.equals(f.start,Oe.MINIMUM_VALUE)||g.appendChild(bn(i,"begin",q.toIso8601(f.start))),q.equals(f.stop,Oe.MAXIMUM_VALUE)||g.appendChild(bn(i,"end",q.toIso8601(f.stop))));for(let S=0;S<c.length;++S){let C=c[S];C.setAttribute("id",s.get(p.id)),C.appendChild(bn(i,"name",p.name)),C.appendChild(bn(i,"visibility",p.show)),C.appendChild(bn(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C)}let y=d.length;if(y>0){let S=i.createElement("Placemark");S.setAttribute("id",s.get(p.id));let C=p.name,V=p.label;if(l(V)){let Z=i.createElement("LabelStyle"),E=r.get(V.text);C=l(E)&&E.length>0?E:C;let P=r.getColor(V.fillColor);l(P)&&(Z.appendChild(bn(i,"color",P)),Z.appendChild(bn(i,"colorMode","normal")));let W=r.get(V.scale);l(W)&&Z.appendChild(bn(i,"scale",W)),u.push(Z)}S.appendChild(bn(i,"name",C)),S.appendChild(bn(i,"visibility",p.show)),S.appendChild(bn(i,"description",p.description)),l(g)&&S.appendChild(g),t.appendChild(S);let L=u.length;if(L>0){let Z=i.createElement("Style");for(let E=0;E<L;++E)Z.appendChild(u[E]);S.appendChild(bn(i,"styleUrl",o.get(Z)))}if(d.length===1)S.appendChild(d[0]);else if(d.length>1){let Z=i.createElement("MultiGeometry");for(let E=0;E<y;++E)Z.appendChild(d[E]);S.appendChild(Z)}}let x=p._children;if(x.length>0){let S=i.createElement("Folder");S.setAttribute("id",s.get(p.id)),S.appendChild(bn(i,"name",p.name)),S.appendChild(bn(i,"visibility",p.show)),S.appendChild(bn(i,"description",p.description)),t.appendChild(S),M0e(e,S,x)}}}var Ql=new m,pl=new he,Wh=new q;function fst(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){N0e(e,t,a,n,i);return}s.get(c,void 0,Ql);let d=bn(o,"coordinates",YT(Ql,r)),u=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(HT(e,a.heightReference)),u.appendChild(h),u.appendChild(d),n.push(u);let p=a instanceof gc?U0e(e,a):k0e(e,a);i.push(p)}function N0e(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof Sa?(c=d.intervals,u=!1):c=t.availability??e.defaultAvailability;let h=n instanceof ab,p,g,f,y=[];for(p=0;p<c.length;++p){let S=c.get(p),C=u?d:S.data,V=r.createElement("altitudeMode");C instanceof Nf?(C=C._value,V.appendChild(HT(e,Ke.CLAMP_TO_GROUND))):l(n)?V.appendChild(HT(e,n.heightReference)):V.appendChild(HT(e,Ke.NONE));let L=[],Z=[];if(C.isConstant){a.get(C,void 0,Ql);let P=bn(r,"coordinates",YT(Ql,s));L.push(q.toIso8601(S.start)),Z.push(P),L.push(q.toIso8601(S.stop)),Z.push(P)}else if(C instanceof Ca)for(f=C._property._times,g=0;g<f.length;++g)L.push(q.toIso8601(f[g])),C.getValueInReferenceFrame(f[g],Di.FIXED,Ql),Z.push(YT(Ql,s));else if(C instanceof Ud){f=C._times;let P=C._values;for(g=0;g<f.length;++g)L.push(q.toIso8601(f[g])),m.fromArray(P,g*3,Ql),Z.push(YT(Ql,s))}else{let P=e.sampleDuration;S.start.clone(Wh),S.isStartIncluded||q.addSeconds(Wh,P,Wh);let W=S.stop;for(;q.lessThan(Wh,W);)C.getValue(Wh,Ql),L.push(q.toIso8601(Wh)),Z.push(YT(Ql,s)),q.addSeconds(Wh,P,Wh);S.isStopIncluded&&q.equals(Wh,W)&&(C.getValue(Wh,Ql),L.push(q.toIso8601(Wh)),Z.push(YT(Ql,s)))}let E=r.createElementNS(Ph,"Track");E.appendChild(V);for(let P=0;P<L.length;++P){let W=bn(r,"when",L[P]),v=bn(r,"coord",Z[P],Ph);E.appendChild(W),E.appendChild(v)}h&&E.appendChild(D0e(e,n)),y.push(E)}if(y.length===1)i.push(y[0]);else if(y.length>1){let S=r.createElementNS(Ph,"MultiTrack");for(p=0;p<y.length;++p)S.appendChild(y[p]);i.push(S)}if(l(n)&&!h){let S=n instanceof gc?U0e(e,n):k0e(e,n);o.push(S)}let x=t.path;if(l(x)){let S=a.get(x.width),C=x.material;if(l(C)||l(S)){let V=r.createElement("LineStyle");l(S)&&V.appendChild(bn(r,"width",S)),dj(e,C,V),o.push(V)}}}function k0e(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(bn(n,"color",r)),o.appendChild(bn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(bn(n,"scale",s/aj)),o}function U0e(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(bn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(bn(n,"x",g.x,Ph)),p.appendChild(bn(n,"y",g.y,Ph)),p.appendChild(bn(n,"w",g.width,Ph)),p.appendChild(bn(n,"h",g.height,Ph))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(bn(n,"color",a)),r.appendChild(bn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(bn(n,"scale",c));let d=i.get(t.pixelOffset);if(l(d)){c=c??1,U.divideByScalar(d,c,d);let p=i.get(t.width,aj),g=i.get(t.height,aj),f=i.get(t.horizontalOrigin,_i.CENTER);f===_i.CENTER?d.x-=p*.5:f===_i.RIGHT&&(d.x-=p);let y=i.get(t.verticalOrigin,Mn.CENTER);y===Mn.TOP?d.y+=g:y===Mn.CENTER&&(d.y+=g*.5);let x=n.createElement("hotSpot");x.setAttribute("x",-d.x),x.setAttribute("y",d.y),x.setAttribute("xunits","pixels"),x.setAttribute("yunits","pixels"),r.appendChild(x)}let u=i.get(t.rotation),h=i.get(t.alignedAxis);return l(u)&&m.equals(m.UNIT_Z,h)&&(u=X.toDegrees(-u),u===0&&(u=360),r.appendChild(bn(n,"heading",u))),r}function pst(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),d=s.get(t.clampToGround,!1),u;d?(a.appendChild(bn(o,"tessellate",!0)),u=o.createTextNode("clampToGround")):u=o.createTextNode("absolute"),c.appendChild(u),a.appendChild(c);let h=t.positions,p=s.get(h),g=bn(o,"coordinates",YT(p,r));a.appendChild(g);let f=s.get(t.zIndex);d&&l(f)&&a.appendChild(bn(o,"drawOrder",f,Ph)),n.push(a);let y=o.createElement("LineStyle"),x=s.get(t.width);l(x)&&y.appendChild(bn(o,"width",x)),dj(e,t.material,y),i.push(y)}function bst(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],d=[le.northeast,le.southeast,le.southwest,le.northwest];for(let g=0;g<4;++g)d[g](a,pl),c.push(`${X.toDegrees(pl.longitude)},${X.toDegrees(pl.latitude)},${r}`);let u=bn(i,"coordinates",c.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),h.appendChild(p),[h]}function v0e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)he.fromCartesian(t[u],r,pl),s.push(`${X.toDegrees(pl.longitude)},${X.toDegrees(pl.latitude)},${i?pl.height:n}`);let c=bn(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function gst(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,d=o.get(c),u=Array.isArray(d)?d:d.positions,h=i.createElement("outerBoundaryIs");h.appendChild(v0e(e,u,r,s)),a.push(h);let p=d.holes;if(l(p)){let g=p.length;for(let f=0;f<g;++f){let y=i.createElement("innerBoundaryIs");y.appendChild(v0e(e,p[f].positions,r,s)),a.push(y)}}return a}function w0e(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Qm;if(a&&s.getMaterialType(t.material)==="Image"){yst(e,t,o);return}let c=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&c.appendChild(bn(r,"extrude",!0));let u=a?bst(e,t,d):gst(e,t,d),h=u.length;for(let x=0;x<h;++x)c.appendChild(u[x]);let p=r.createElement("altitudeMode");p.appendChild(HT(e,t.heightReference)),c.appendChild(p),n.push(c);let g=r.createElement("PolyStyle"),f=s.get(t.fill,!1);f&&g.appendChild(bn(r,"fill",f)),dj(e,t.material,g);let y=s.get(t.outline,!1);if(y){g.appendChild(bn(r,"outline",y));let x=r.createElement("LineStyle"),S=s.get(t.outlineWidth,1);x.appendChild(bn(r,"width",S));let C=s.getColor(t.outlineColor,D.BLACK);x.appendChild(bn(r,"color",C)),x.appendChild(bn(r,"colorMode","normal")),i.push(x)}i.push(g)}function yst(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(HT(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(bn(i,"altitude",c));let d=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(bn(i,"north",X.toDegrees(d.north))),u.appendChild(bn(i,"south",X.toDegrees(d.south))),u.appendChild(bn(i,"east",X.toDegrees(d.east))),u.appendChild(bn(i,"west",X.toDegrees(d.west))),s.appendChild(u);let h=o.get(t.material),p=r.texture(h.image),g=i.createElement("Icon");g.appendChild(bn(i,"href",p)),s.appendChild(g);let f=h.color;l(f)&&s.appendChild(bn(i,"color",zT(h.color))),n.push(s)}function D0e(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let d=n.createElement("scale");d.appendChild(bn(n,"x",s)),d.appendChild(bn(n,"y",s)),d.appendChild(bn(n,"z",s)),r.appendChild(d)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(bn(n,"href",c)),r.appendChild(a),r}function xst(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){N0e(e,t,n,i,o);return}let d=D0e(e,n),u=r.createElement("altitudeMode");u.appendChild(HT(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,Ql),he.fromCartesian(Ql,s,pl);let h=r.createElement("Location");h.appendChild(bn(r,"longitude",X.toDegrees(pl.longitude))),h.appendChild(bn(r,"latitude",X.toDegrees(pl.latitude))),h.appendChild(bn(r,"altitude",pl.height)),d.appendChild(h),i.push(d)}function dj(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,d;switch(a){case"Image":s=zT(D.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=zT(r.color);break;case"PolylineOutline":s=zT(r.color),c=zT(r.outlineColor),d=r.outlineWidth,n.appendChild(bn(i,"outerColor",c,Ph)),n.appendChild(bn(i,"outerWidth",d,Ph));break;case"Stripe":s=zT(r.oddColor);break}l(s)&&(n.appendChild(bn(i,"color",s)),n.appendChild(bn(i,"colorMode","normal")))}function HT(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,Ke.NONE),r;switch(o){case Ke.NONE:r=n.createTextNode("absolute");break;case Ke.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case Ke.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function YT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)he.fromCartesian(e[o],t,pl),i.push(`${X.toDegrees(pl.longitude)},${X.toDegrees(pl.latitude)},${pl.height}`);return i.join(" ")}function bn(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 zT(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 uj=lj;var jCi=_(T(),1);var bCi=_(T());var vSi=_(T());var XSi=_(T());var GSi=_(T());function mj(e){return e}function ED(e){if(e==null)return mj;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var d=2,u=a.length,h=new Array(u);for(h[0]=(t+=a[0])*i+r,h[1]=(n+=a[1])*o+s;d<u;)h[d]=a[d],++d;return h}}var kSi=_(T());var FSi=_(T());function O0e(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function hj(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return B0e(e,n)})}:B0e(e,t)}function B0e(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=fj(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 fj(e,t){var n=ED(e.transform),i=e.arcs;function o(u,h){h.length&&h.pop();for(var p=i[u<0?~u:u],g=0,f=p.length;g<f;++g)h.push(n(p[g],g));u<0&&O0e(h,f)}function r(u){return n(u)}function s(u){for(var h=[],p=0,g=u.length;p<g;++p)o(u[p],h);return h.length<2&&h.push(h[0]),h}function a(u){for(var h=s(u);h.length<4;)h.push(h[0]);return h}function c(u){return u.map(a)}function d(u){var h=u.type,p;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(d)};case"Point":p=r(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(r);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=c(u.arcs);break;case"MultiPolygon":p=u.arcs.map(c);break;default:return null}return{type:h,coordinates:p}}return d(t)}var zSi=_(T());var DSi=_(T());var QSi=_(T());var nCi=_(T());var qSi=_(T());var lCi=_(T());var rCi=_(T());function ID(e){return m.fromDegrees(e[0],e[1],e[2])}var pj={"urn:ogc:def:crs:OGC:1.3:CRS84":ID,"EPSG:4326":ID,"urn:ogc:def:crs:EPSG::4326":ID},Y0e={},z0e={},bj=48,gj,yj=D.ROYALBLUE,xj=D.YELLOW,_j=2,Tj=D.fromBytes(255,255,0,100),Sj=!1,Vst={small:24,medium:48,large:64},Lst=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function H0e(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Lst.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${H0e(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 Rst(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function Zst(e,t){return new jm(Rst(H0e,e,t),!0)}function XD(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Hn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let h=u.toLowerCase();if(d>1&&h==="title"){d=1,s=u;break}else d>2&&h==="name"?(d=2,s=u):d>3&&/title/i.test(u)?(d=3,s=u):d>4&&/name/i.test(u)&&(d=4,s=u)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new jn(c):n(r,s))}return o}function Cj(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var K0e={Feature:Q0e,FeatureCollection:Gst,GeometryCollection:j0e,LineString:nge,MultiLineString:ige,MultiPoint:ege,MultiPolygon:sge,Point:$0e,Polygon:rge,Topology:age},J0e={GeometryCollection:j0e,LineString:nge,MultiLineString:ige,MultiPoint:ege,MultiPolygon:sge,Point:$0e,Polygon:rge,Topology:age};function Q0e(e,t,n,i,o){if(t.geometry===null){XD(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ce("feature.geometry is required.");let r=t.geometry.type,s=J0e[r];if(!l(s))throw new ce(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Gst(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)Q0e(e,r[s],void 0,i,o)}function j0e(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],d=c.type,u=J0e[d];if(!l(u))throw new ce(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function q0e(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=D.fromCssColorString(g)),a=Vst[c["marker-size"]]??a;let f=c["marker-symbol"];l(f)&&(r=f)}let d;l(r)?r.length===1?d=e._pinBuilder.fromText(r.toUpperCase(),s,a):d=e._pinBuilder.fromMakiIconId(r,s,a):d=e._pinBuilder.fromColor(s,a);let u=new gc;u.verticalOrigin=new jn(Mn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=Ke.CLAMP_TO_GROUND);let h=XD(t,e._entityCollection,o.describe);h.billboard=u,h.position=new el(n(i));let p=Promise.resolve(d).then(function(g){u.image=new jn(g)}).catch(function(){u.image=new jn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function $0e(e,t,n,i,o){q0e(e,t,i,n.coordinates,o)}function ege(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)q0e(e,t,i,r[s],o)}function tge(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let u=a["stroke-width"];l(u)&&(s=new jn(u));let h,p=a.stroke;l(p)&&(h=D.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(h)||(h=r.color.getValue().clone()),h.alpha=g),l(h)&&(r=new zt(h))}let c=XD(t,e._entityCollection,o.describe),d=new xc;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new jn(Cj(i,n)),d.arcType=on.RHUMB}function nge(e,t,n,i,o){tge(e,t,i,n.coordinates,o)}function ige(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)tge(e,t,i,r[s],o)}function oge(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new jn(g));let f,y=c.stroke;l(y)&&(f=D.fromCssColorString(y));let x=c["stroke-opacity"];l(x)&&x!==1&&(l(f)||(f=r.getValue().clone()),f.alpha=x),l(f)&&(r=new jn(f));let S,C=c.fill,V=s.color.getValue();l(C)&&(S=D.fromCssColorString(C),S.alpha=V.alpha),x=c["fill-opacity"],l(x)&&x!==V.alpha&&(l(S)||(S=V.clone()),S.alpha=x),l(S)&&(s=new zt(S))}let d=new Jm;d.outline=new jn(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=on.RHUMB;let u=[];for(let g=1,f=i.length;g<f;g++)u.push(new Na(Cj(i[g],n)));let h=i[0];d.hierarchy=new jn(new Na(Cj(h,n),u)),h[0].length>2?d.perPositionHeight=new jn(!0):o.clampToGround||(d.height=0);let p=XD(t,e._entityCollection,o.describe);p.polygon=d}function rge(e,t,n,i,o){oge(e,t,i,n.coordinates,o)}function sge(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)oge(e,t,i,r[s],o)}function age(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=hj(n,n.objects[r]),a=K0e[s.type];a(e,s,s,i,o)}}function Zy(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new oa(this),this._promises=[],this._pinBuilder=new Qp,this._entityCluster=new Md,this._credit=void 0,this._resourceCredits=[]}Zy.load=function(e,t){return new Zy().load(e,t)};Object.defineProperties(Zy,{markerSize:{get:function(){return bj},set:function(e){bj=e}},markerSymbol:{get:function(){return gj},set:function(e){gj=e}},markerColor:{get:function(){return yj},set:function(e){yj=e}},stroke:{get:function(){return xj},set:function(e){xj=e}},strokeWidth:{get:function(){return _j},set:function(e){_j=e}},fill:{get:function(){return Tj},set:function(e){Tj=e}},clampToGround:{get:function(){return Sj},set:function(e){Sj=e}},crsNames:{get:function(){return pj}},crsLinkHrefs:{get:function(){return Y0e}},crsLinkTypes:{get:function(){return z0e}}});Object.defineProperties(Zy.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}}});Zy.prototype.load=function(e,t){return cge(this,e,t,!0)};Zy.prototype.process=function(e,t){return cge(this,e,t,!1)};function cge(e,t,n,i){Jr.setLoading(e,!0),n=n??Y.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new Gt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Re){t=Re.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return n={describe:n.describe??Zst,markerSize:n.markerSize??bj,markerSymbol:n.markerSymbol??gj,markerColor:n.markerColor??yj,strokeWidthProperty:new jn(n.strokeWidth??_j),strokeMaterialProperty:new zt(n.stroke??xj),fillMaterialProperty:new zt(n.fill??Tj),clampToGround:n.clampToGround??Sj},Promise.resolve(r).then(function(a){return Est(e,a,n,s,i)}).catch(function(a){throw Jr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Zy.prototype.update=function(e){return!0};function Est(e,t,n,i,o){let r;l(i)&&(r=Yp(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=K0e[t.type];if(!l(s))throw new ce(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?ID:null;if(l(a)){if(!l(a.properties))throw new ce("crs.properties is undefined.");let d=a.properties;if(a.type==="name"){if(c=pj[d.name],!l(c))throw new ce(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=Y0e[d.href];if(l(u)||(u=z0e[d.type]),!l(u))throw new ce(`Unable to resolve crs link: ${JSON.stringify(d)}`);c=u(d)}else if(a.type==="EPSG"){if(c=pj[`EPSG:${d.code}`],!l(c))throw new ce(`Unknown crs EPSG code: ${d.code}`)}else throw new ce(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(d){return o&&e._entityCollection.removeAll(),d!==null&&s(e,t,t,d,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Jr.setLoading(e,!1),e})})}var Gy=Zy;var $Ci=_(T(),1);function Ist(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Pn=Ist;var OLi=_(T(),1);var iLi=_(T());var UVi=_(T());var t1i=_(T()),lge="4.1.0";var i1i=_(T());function Xst(e){return e===void 0}function Kd(e){return typeof e=="boolean"}function dge(e,t){for(var n in t)t.hasOwnProperty(n)&&Xst(e[n])&&(e[n]=t[n]);return e}function uge(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 zo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function Ey(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Hf(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var S1i=_(T());var l1i=_(T());var s1i=_(T()),Iy=/[A-Za-z]/,ra=/[\d]/;var Jd=/\s/,WD=/['"]/,mge=/[\x00-\x1F\x7F]/,hge=/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,Wst=/\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,Pst=/\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,vst=hge+Wst+Pst,fge=/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,o1i=new RegExp("[".concat(hge+fge,"]")),Vj=vst+fge,vh=new RegExp("[".concat(Vj,"]"));var PD=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(Jd):[],o=t.split(Jd),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(Jd):[],o=t.split(Jd),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();var u1i=_(T());function pge(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(C){var V={},L=C,Z=L.match(/^([a-z]+):\/\//i);return Z&&(V.scheme=Z[1],L=L.substr(Z[0].length)),Z=L.match(/^(.*?)(?=(\?|#|\/|$))/i),Z&&(V.host=Z[1],L=L.substr(Z[0].length)),Z=L.match(/^\/(.*?)(?=(\?|#|$))/i),Z&&(V.path=Z[1],L=L.substr(Z[0].length)),Z=L.match(/^\?(.*?)(?=(#|$))/i),Z&&(V.query=Z[1],L=L.substr(Z[0].length)),Z=L.match(/^#(.*?)$/i),Z&&(V.fragment=Z[1]),V},s=function(C){var V="";return C.scheme&&C.host&&(V+=C.scheme+"://"),C.host&&(V+=C.host),C.path&&(V+="/"+C.path),C.query&&(V+="?"+C.query),C.fragment&&(V+="#"+C.fragment),V},a=function(C,V){var L=V/2,Z=Math.ceil(L),E=-1*Math.floor(L),P="";return E<0&&(P=C.substr(E)),C.substr(0,Z)+n+P};if(e.length<=t)return e;var c=t-o,d=r(e);if(d.query){var u=d.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);u&&(d.query=d.query.substr(0,u[1].length),e=s(d))}if(e.length<=t||(d.host&&(d.host=d.host.replace(/^www\./,""),e=s(d)),e.length<=t))return e;var h="";if(d.host&&(h+=d.host),h.length>=c)return d.host.length==t?(d.host.substr(0,t-o)+n).substr(0,c+i):a(h,c).substr(0,c+i);var p="";if(d.path&&(p+="/"+d.path),d.query&&(p+="?"+d.query),p)if((h+p).length>=c){if((h+p).length==t)return(h+p).substr(0,t);var g=c-h.length;return(h+a(p,g)).substr(0,c+i)}else h+=p;if(d.fragment){var f="#"+d.fragment;if((h+f).length>=c){if((h+f).length==t)return(h+f).substr(0,t);var y=c-h.length;return(h+a(f,y)).substr(0,c+i)}else h+=f}if(d.scheme&&d.host){var x=d.scheme+"://";if((h+x).length<c)return(x+h).substr(0,t)}if(h.length<=t)return h;var S="";return c>0&&(S=h.substr(-1*Math.floor(c/2))),(h.substr(0,Math.ceil(c/2))+n+S).substr(0,c+i)}var h1i=_(T());function bge(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,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var b1i=_(T());function gge(e,t,n){return uge(e,t,n)}var yge=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 PD({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?pge(t,i):o==="middle"?bge(t,i):gge(t,i)},e}();var RVi=_(T());var A1i=_(T());var V1i=_(T(),1),Lj=function(e,t){return Lj=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])},Lj(e,t)};function Kf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Lj(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var sa=function(){return sa=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},sa.apply(this,arguments)};var R1i=_(T()),Jf=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 W1i=_(T());var G1i=_(T()),wst="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bentley|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|lipsy|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",xge=new RegExp("^"+wst+"$");var Fst=/[\/?#]/,Ast=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,_ge=/[?!:,.;^]/,Rj=/https?:\/\//i,Tge=new RegExp("^"+Rj.source,"i"),Sge=new RegExp(_ge.source+"$"),Mst=/^(javascript|vbscript):/i,Nst=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,kst=/^(?:\/\/)?([^/#?:]+)/;function QV(e){return Iy.test(e)}function Zj(e){return Iy.test(e)||ra.test(e)||e==="+"||e==="-"||e==="."}function d0(e){return vh.test(e)}function vD(e){return e==="_"||d0(e)}function Gj(e){return vh.test(e)||Ast.test(e)||_ge.test(e)}function wD(e){return Fst.test(e)}function Ej(e){return xge.test(e.toLowerCase())}function Cge(e){if(Mst.test(e))return!1;var t=e.match(Nst);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!Iy.test(i))}function Vge(e){var t=e.match(kst);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!Ej(o)}var Ust=/^(?:(?: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]?)$/,Dst=/[:/?#]/;function Lge(e){var t=e.split(Dst,1)[0];return Ust.test(t)}var Ost=/^(https?:\/\/)?(www\.)?/i,Bst=/^\/\//,Rge=function(e){Kf(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=Hst(n)),this.stripPrefix.scheme&&(n=Yst(n)),this.stripPrefix.www&&(n=zst(n)),this.stripTrailingSlash&&(n=Kst(n)),this.decodePercentEncoding&&(n=Jst(n)),n},t}(Jf);function Yst(e){return e.replace(Tge,"")}function zst(e){return e.replace(Ost,"$1")}function Hst(e){return e.replace(Bst,"")}function Kst(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function Jst(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 U1i=_(T());var Zge=/^mailto:/i,Qst=new RegExp("[".concat(Vj,"!#$%&'*+/=?^_`{|}~-]"));function Gge(e){return vh.test(e)}function FD(e){return Qst.test(e)}function Ege(e){var t=e.split(".").pop()||"";return Ej(t)}var Y1i=_(T());var Ige=function(e){Kf(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}(Jf);var K1i=_(T());function Ij(e){return e==="_"||vh.test(e)}function Xge(e){return e.length<=140}var Wge=["twitter","facebook","instagram","tiktok","youtube"];var $1i=_(T());var Pge=function(e){Kf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:throw Hf(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}(Jf);var tVi=_(T()),jst={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/},qst=/[-\w.]/;function Xj(e){return qst.test(e)}function vge(e,t){var n=jst[t];return n.test(e)}var wge=["twitter","instagram","soundcloud","tiktok","youtube"];var sVi=_(T());var Fge=function(e){Kf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:throw Hf(this.serviceName),new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Jf);var cVi=_(T()),$st=/[-. ]/,eat=/[-. ()]/,tat=/[,;]/,nat=/(?:(?:(?:(\+)?\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]+#?)*/,iat=/(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})/,oat=new RegExp("^".concat(nat.source,"|").concat(iat.source,"$"));function Wj(e){return $st.test(e)}function AD(e){return tat.test(e)}function Age(e){var t=e.charAt(0)==="+"||eat.test(e);return t&&oat.test(e)}var mVi=_(T());var Mge=function(e){Kf(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}(Jf);function Uge(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],d=e.length,u=[],h=0;h<d;h++){var p=e.charAt(h);if(u.length===0)S(p);else{for(var g=u.length-1;g>=0;g--){var f=u[g];switch(f.state){case 11:P(f,p);break;case 12:W(f,p);break;case 0:C(f,p);break;case 1:V(f,p);break;case 2:L(f,p);break;case 3:Z(f,p);break;case 4:E(f,p);break;case 5:v(f,p);break;case 6:A(f,p);break;case 7:b(f,p);break;case 13:R(f,p);break;case 14:G(f,p);break;case 8:I(f,p);break;case 9:w(f,p);break;case 10:M(f,p);break;case 15:O(f,p);break;case 16:k(f,p);break;case 17:B(f,p);break;case 18:N(f,p);break;case 19:z(f,p);break;case 20:K(f,p);break;case 21:te(f,p);break;case 22:H(f,p);break;case 23:j(f,p);break;case 24:ee(f,p);break;case 25:pe(f,p);break;case 26:_e(f,p);break;case 27:ae(f,p);break;case 28:ye(f,p);break;case 29:Se(f,p);break;case 30:Ee(f,p);break;case 31:Ie(f,p);break;case 32:ve(f,p);break;case 33:ct(f,p);break;case 34:Je(f,p);break;case 35:bt(f,p);break;case 36:Qe(f,p);break;case 37:Fe(f,p);break;case 38:Tt(f,p);break;case 39:ft(f,p);break;case 40:gt(f,p);break;case 41:En(f,p);break;default:Hf(f.state)}}if(h>0&&QV(p)){var y=e.charAt(h-1);!QV(y)&&!u.some(uat)&&u.push(MD(h,0))}}}for(var x=u.length-1;x>=0;x--)u.forEach(function(Ce){return cn(Ce)});return c;function S(Ce){if(Ce==="#")u.push(lat(h,28));else if(Ce==="@")u.push(dat(h,30));else if(Ce==="/")u.push(Pj(h,11));else if(Ce==="+")u.push(vj(h,37));else if(Ce==="(")u.push(vj(h,32));else{if(ra.test(Ce)&&(u.push(vj(h,38)),u.push(aat(h,13))),Gge(Ce)){var Le=Ce.toLowerCase()==="m"?15:22;u.push(cat(h,Le))}QV(Ce)&&u.push(MD(h,0)),vh.test(Ce)&&u.push(Pj(h,5))}}function C(Ce,Le){Le===":"?Ce.state=2:Le==="-"?Ce.state=1:Zj(Le)||zo(u,Ce)}function V(Ce,Le){Le==="-"||(Le==="/"?(zo(u,Ce),u.push(Pj(h,11))):Zj(Le)?Ce.state=0:zo(u,Ce))}function L(Ce,Le){Le==="/"?Ce.state=3:Le==="."?zo(u,Ce):d0(Le)?(Ce.state=5,QV(Le)&&u.push(MD(h,0))):zo(u,Ce)}function Z(Ce,Le){Le==="/"?Ce.state=4:Gj(Le)?(Ce.state=10,Ce.acceptStateReached=!0):cn(Ce)}function E(Ce,Le){Le==="/"?Ce.state=10:d0(Le)?(Ce.state=5,Ce.acceptStateReached=!0):zo(u,Ce)}function P(Ce,Le){Le==="/"?Ce.state=12:zo(u,Ce)}function W(Ce,Le){d0(Le)?Ce.state=5:zo(u,Ce)}function v(Ce,Le){Le==="."?Ce.state=7:Le==="-"?Ce.state=6:Le===":"?Ce.state=8:wD(Le)?Ce.state=10:vD(Le)||cn(Ce)}function A(Ce,Le){Le==="-"||(Le==="."?cn(Ce):d0(Le)?Ce.state=5:cn(Ce))}function b(Ce,Le){Le==="."?cn(Ce):d0(Le)?(Ce.state=5,Ce.acceptStateReached=!0):cn(Ce)}function R(Ce,Le){Le==="."?Ce.state=14:Le===":"?Ce.state=8:ra.test(Le)||(wD(Le)?Ce.state=10:vh.test(Le)?zo(u,Ce):cn(Ce))}function G(Ce,Le){ra.test(Le)?(Ce.octetsEncountered++,Ce.octetsEncountered===4&&(Ce.acceptStateReached=!0),Ce.state=13):cn(Ce)}function I(Ce,Le){ra.test(Le)?Ce.state=9:cn(Ce)}function w(Ce,Le){ra.test(Le)||(wD(Le)?Ce.state=10:cn(Ce))}function M(Ce,Le){Gj(Le)||cn(Ce)}function O(Ce,Le){Le.toLowerCase()==="a"?Ce.state=16:H(Ce,Le)}function k(Ce,Le){Le.toLowerCase()==="i"?Ce.state=17:H(Ce,Le)}function B(Ce,Le){Le.toLowerCase()==="l"?Ce.state=18:H(Ce,Le)}function N(Ce,Le){Le.toLowerCase()==="t"?Ce.state=19:H(Ce,Le)}function z(Ce,Le){Le.toLowerCase()==="o"?Ce.state=20:H(Ce,Le)}function K(Ce,Le){Le.toLowerCase()===":"?Ce.state=21:H(Ce,Le)}function te(Ce,Le){FD(Le)?Ce.state=22:zo(u,Ce)}function H(Ce,Le){Le==="."?Ce.state=23:Le==="@"?Ce.state=24:FD(Le)?Ce.state=22:zo(u,Ce)}function j(Ce,Le){Le==="."?zo(u,Ce):Le==="@"?zo(u,Ce):FD(Le)?Ce.state=22:zo(u,Ce)}function ee(Ce,Le){d0(Le)?Ce.state=25:zo(u,Ce)}function pe(Ce,Le){Le==="."?Ce.state=27:Le==="-"?Ce.state=26:vD(Le)||cn(Ce)}function _e(Ce,Le){Le==="-"||Le==="."?cn(Ce):vD(Le)?Ce.state=25:cn(Ce)}function ae(Ce,Le){Le==="."||Le==="-"?cn(Ce):d0(Le)?(Ce.state=25,Ce.acceptStateReached=!0):cn(Ce)}function ye(Ce,Le){Ij(Le)?(Ce.state=29,Ce.acceptStateReached=!0):zo(u,Ce)}function Se(Ce,Le){Ij(Le)||cn(Ce)}function Ee(Ce,Le){Xj(Le)?(Ce.state=31,Ce.acceptStateReached=!0):zo(u,Ce)}function Ie(Ce,Le){Xj(Le)||(vh.test(Le)?zo(u,Ce):cn(Ce))}function Fe(Ce,Le){ra.test(Le)?Ce.state=38:(zo(u,Ce),S(Le))}function ve(Ce,Le){ra.test(Le)?Ce.state=33:zo(u,Ce),S(Le)}function ct(Ce,Le){ra.test(Le)?Ce.state=34:zo(u,Ce)}function Je(Ce,Le){ra.test(Le)?Ce.state=35:zo(u,Ce)}function bt(Ce,Le){Le===")"?Ce.state=36:zo(u,Ce)}function Qe(Ce,Le){ra.test(Le)?Ce.state=38:Wj(Le)?Ce.state=39:zo(u,Ce)}function Tt(Ce,Le){Ce.acceptStateReached=!0,AD(Le)?Ce.state=40:Le==="#"?Ce.state=41:ra.test(Le)||(Le==="("?Ce.state=32:Wj(Le)?Ce.state=39:(cn(Ce),QV(Le)&&u.push(MD(h,0))))}function ft(Ce,Le){ra.test(Le)?Ce.state=38:Le==="("?Ce.state=32:(cn(Ce),S(Le))}function gt(Ce,Le){AD(Le)||(Le==="#"?Ce.state=41:ra.test(Le)?Ce.state=38:cn(Ce))}function En(Ce,Le){AD(Le)?Ce.state=40:ra.test(Le)?zo(u,Ce):cn(Ce)}function cn(Ce){if(zo(u,Ce),!!Ce.acceptStateReached){var Le=Ce.startIdx,St=e.slice(Ce.startIdx,h);if(St=sat(St),Ce.type==="url"){var mn=e.charAt(Ce.startIdx-1);if(mn==="@")return;var to=Ce.matchType;if(to==="scheme"){var He=Rj.exec(St);if(He&&(Le=Le+He.index,St=St.slice(He.index)),!Cge(St))return}else if(to==="tld"){if(!Vge(St))return}else if(to==="ipV4"){if(!Lge(St))return}else Hf(to);c.push(new Rge({tagBuilder:n,matchedText:St,offset:Le,urlMatchType:to,url:St,protocolRelativeMatch:St.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(Ce.type==="email")Ege(St)&&c.push(new Ige({tagBuilder:n,matchedText:St,offset:Le,email:St.replace(Zge,"")}));else if(Ce.type==="hashtag")Xge(St)&&c.push(new Pge({tagBuilder:n,matchedText:St,offset:Le,serviceName:s,hashtag:St.slice(1)}));else if(Ce.type==="mention")vge(St,a)&&c.push(new Fge({tagBuilder:n,matchedText:St,offset:Le,serviceName:a,mention:St.slice(1)}));else if(Ce.type==="phone"){if(St=St.replace(/ +$/g,""),Age(St)){var yr=St.replace(/[^0-9,;#]/g,"");c.push(new Mge({tagBuilder:n,matchedText:St,offset:Le,number:yr,plusSign:St.charAt(0)==="+"}))}}else Hf(Ce)}}}var rat=/[\(\{\[]/,Nge=/[\)\}\]]/,kge={")":"(","}":"{","]":"["};function sat(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);rat.test(i)?t[i]++:Nge.test(i)&&t[kge[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),Nge.test(r)){var s=kge[r];if(t[s]<0)t[s]++,o--;else break}else if(Sge.test(r))o--;else break;return e.slice(0,o+1)}function MD(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function Pj(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function aat(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function cat(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function lat(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function dat(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function vj(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function uat(e){return e.type==="url"&&e.matchType==="scheme"}var XVi=_(T());function Dge(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Qf,c=0,d=e.length,u=0,h=0,p=a;c<d;){var g=e.charAt(c);switch(u){case 0:f(g);break;case 1:y(g);break;case 2:S(g);break;case 3:x(g);break;case 4:C(g);break;case 5:V(g);break;case 6:L(g);break;case 7:Z(g);break;case 8:E(g);break;case 9:P(g);break;case 10:W(g);break;case 11:v(g);break;case 12:A(g);break;case 13:b(g);break;case 14:R(g);break;case 15:G(g);break;case 16:I(g);break;case 17:w(g);break;case 18:M(g);break;case 19:O(g);break;case 20:k(g);break;default:Hf(u)}c++}h<c&&K();function f(j){j==="<"&&N()}function y(j){j==="!"?u=13:j==="/"?(u=2,p=new Qf(sa(sa({},p),{isClosing:!0}))):j==="<"?N():Iy.test(j)?(u=3,p=new Qf(sa(sa({},p),{isOpening:!0}))):(u=0,p=a)}function x(j){Jd.test(j)?(p=new Qf(sa(sa({},p),{name:te()})),u=4):j==="<"?N():j==="/"?(p=new Qf(sa(sa({},p),{name:te()})),u=12):j===">"?(p=new Qf(sa(sa({},p),{name:te()})),z()):!Iy.test(j)&&!ra.test(j)&&j!==":"&&B()}function S(j){j===">"?B():Iy.test(j)?u=3:B()}function C(j){Jd.test(j)||(j==="/"?u=12:j===">"?z():j==="<"?N():j==="="||WD.test(j)||mge.test(j)?B():u=5)}function V(j){Jd.test(j)?u=6:j==="/"?u=12:j==="="?u=7:j===">"?z():j==="<"?N():WD.test(j)&&B()}function L(j){Jd.test(j)||(j==="/"?u=12:j==="="?u=7:j===">"?z():j==="<"?N():WD.test(j)?B():u=5)}function Z(j){Jd.test(j)||(j==='"'?u=8:j==="'"?u=9:/[>=`]/.test(j)?B():j==="<"?N():u=10)}function E(j){j==='"'&&(u=11)}function P(j){j==="'"&&(u=11)}function W(j){Jd.test(j)?u=4:j===">"?z():j==="<"&&N()}function v(j){Jd.test(j)?u=4:j==="/"?u=12:j===">"?z():j==="<"?N():(u=4,H())}function A(j){j===">"?(p=new Qf(sa(sa({},p),{isClosing:!0})),z()):u=4}function b(j){e.substr(c,2)==="--"?(c+=2,p=new Qf(sa(sa({},p),{type:"comment"})),u=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Qf(sa(sa({},p),{type:"doctype"})),u=20):B()}function R(j){j==="-"?u=15:j===">"?B():u=16}function G(j){j==="-"?u=18:j===">"?B():u=16}function I(j){j==="-"&&(u=17)}function w(j){j==="-"?u=18:u=16}function M(j){j===">"?z():j==="!"?u=19:j==="-"||(u=16)}function O(j){j==="-"?u=17:j===">"?z():u=16}function k(j){j===">"?z():j==="<"&&N()}function B(){u=0,p=a}function N(){u=1,p=new Qf({idx:c})}function z(){var j=e.slice(h,p.idx);j&&o(j,h),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),B(),h=c+1}function K(){var j=e.slice(h,c);o(j,h),h=c+1}function te(){var j=p.idx+(p.isClosing?2:1);return e.slice(j,c).toLowerCase()}function H(){c--}}var Qf=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 mat=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=hat(t.urls),this.email=Kd(t.email)?t.email:this.email,this.phone=Kd(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Kd(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=fat(t.stripPrefix),this.stripTrailingSlash=Kd(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Kd(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&wge.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Wge.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=pat(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 Dge(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,d=s.split(c),u=a;d.forEach(function(h,p){if(p%2===0){var g=n.parseText(h,u);r.push.apply(r,g)}u+=h.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,d){return c.getOffset()-d.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||Ey(t,function(n){return n.getType()==="hashtag"}),this.email||Ey(t,function(n){return n.getType()==="email"}),this.phone||Ey(t,function(n){return n.getType()==="phone"}),this.mention||Ey(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||Ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Ey(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=Uge(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,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof PD)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new yge({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=lge,e}(),Oge=mat;function hat(e){return e==null&&(e=!0),Kd(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Kd(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Kd(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Kd(e.ipV4Matches)?e.ipV4Matches:!0}}function fat(e){return e==null&&(e=!0),Kd(e)?{scheme:e,www:e}:{scheme:Kd(e.scheme)?e.scheme:!0,www:Kd(e.www)?e.www:!0}}function pat(e){return typeof e=="number"?{length:e,location:"end"}:dge(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var BVi=_(T());var DVi=_(T());var $Vi=_(T());var ND=Oge;var qge;typeof DOMParser<"u"&&(qge=new DOMParser);var bat=new ND({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),kD=32,Bge=2414016,Yge=1,zge=16093e3,Hge=.1,gat=[null,void 0,"http://www.topografix.com/GPX/1/1"],Eo={gpx:gat};function yat(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 wj(e,t){let n=ww(e,"id");return n=l(n)?n:Hn(),t.getOrCreateEntity(n)}function Fj(e){let t=Kge(e,"lon"),n=Kge(e,"lat"),i=Pw(e,"ele",Eo.gpx);return m.fromDegrees(t,n,i)}function Kge(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 ww(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Xy(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Aj(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Pw(e,t,n){let i=Xy(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function jl(e,t,n){let i=Xy(e,t,n);if(l(i))return i.textContent.trim()}function $ge(e){let t=new gc;return t.width=kD,t.height=kD,t.scaleByDistance=new Ot(Bge,Yge,zge,Hge),t.pixelOffsetScaleByDistance=new Ot(Bge,Yge,zge,Hge),t.verticalOrigin=new jn(Mn.BOTTOM),t.image=e,t}function xat(){let e=new Km;return e.translucencyByDistance=new Ot(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=_i.LEFT,e.font="16px sans-serif",e.style=Oo.FILL_AND_OUTLINE,e}function eye(e){let t=new xc;return t.width=4,t.material=new dy,t.material.color=l(e)?e:D.RED,t.material.outlineWidth=2,t.material.outlineColor=D.BLACK,t}var Jge={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"}},vw;typeof document<"u"&&(vw=document.createElement("div"));function Mj(e,t){let n,i="",o=Object.keys(Jge),r=o.length;for(n=0;n<r;n++){let u=o[n],h=Jge[u];h.value=jl(e,h.tag,Eo.gpx)??"",l(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!l(i)||i==="")return;i=bat.link(i),vw.innerHTML=i;let s=vw.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=D.WHITE,c=D.BLACK,d='<div class="cesium-infoBox-description-lighter" style="';return d+="overflow:auto;",d+="word-wrap:break-word;",d+=`background-color:${a.toCssColorString()};`,d+=`color:${c.toCssColorString()};`,d+='">',d+=`${vw.innerHTML}</div>`,vw.innerHTML="",d}function tye(e,t,n,i){let o=Fj(t),r=wj(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",D.RED,kD);r.billboard=$ge(s);let a=jl(t,"name",Eo.gpx);r.name=a,r.label=xat(),r.label.text=a,r.description=Mj(t,r),i.clampToGround&&(r.billboard.heightReference=Ke.CLAMP_TO_GROUND,r.label.heightReference=Ke.CLAMP_TO_GROUND)}function _at(e,t,n,i){let o=wj(t,n);o.description=Mj(t,o);let r=Aj(t,"rtept",Eo.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)tye(e,r[a],n,i),s[a]=Fj(r[a]);o.polyline=eye(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Tat(e,t,n,i){let o=wj(t,n);o.description=Mj(t,o);let r=Aj(t,"trkseg",Eo.gpx),s=[],a=[],c,d=!0,u=new Ca;for(let h=0;h<r.length;h++)c=Sat(r[h]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let h=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",D.RED,kD);o.billboard=$ge(h),o.position=u,i.clampToGround&&(o.billboard.heightReference=Ke.CLAMP_TO_GROUND),o.availability=new Or,o.availability.addInterval(new Rn({start:a[0],stop:a[a.length-1]}))}o.polyline=eye(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Sat(e){let t={positions:[],times:[]},n=Aj(e,"trkpt",Eo.gpx),i;for(let o=0;o<n.length;o++){let r=Fj(n[o]);t.positions.push(r),i=jl(n[o],"time",Eo.gpx),l(i)&&t.times.push(q.fromIso8601(i))}return t}function Cat(e){let t=Xy(e,"metadata",Eo.gpx);if(l(t)){let n={name:jl(t,"name",Eo.gpx),desc:jl(t,"desc",Eo.gpx),author:Vat(t),copyright:Rat(t),link:nye(t),time:jl(t,"time",Eo.gpx),keywords:jl(t,"keywords",Eo.gpx),bounds:Zat(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 Vat(e){let t=Xy(e,"author",Eo.gpx);if(l(t)){let n={name:jl(t,"name",Eo.gpx),email:Lat(t),link:nye(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function Lat(e){let t=Xy(e,"email",Eo.gpx);if(l(t)){let n=jl(t,"id",Eo.gpx),i=jl(t,"domain",Eo.gpx);return`${n}@${i}`}}function nye(e){let t=Xy(e,"link",Eo.gpx);if(l(t)){let n={href:ww(t,"href"),text:jl(t,"text",Eo.gpx),mimeType:jl(t,"type",Eo.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function Rat(e){let t=Xy(e,"copyright",Eo.gpx);if(l(t)){let n={author:ww(t,"author"),year:jl(t,"year",Eo.gpx),license:jl(t,"license",Eo.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function Zat(e){let t=Xy(e,"bounds",Eo.gpx);if(l(t)){let n={minLat:Pw(t,"minlat",Eo.gpx),maxLat:Pw(t,"maxlat",Eo.gpx),minLon:Pw(t,"minlon",Eo.gpx),maxLon:Pw(t,"maxlon",Eo.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var Qge={wpt:tye,rte:_at,trk:Tat};function Gat(e,t,n,i){let o=Object.keys(Qge),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Qge[a],d=t.childNodes,u=d.length;for(let h=0;h<u;h++){let p=d[h];p.localName===a&&Eo.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function jge(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=ww(o,"version"),s=ww(o,"creator"),a,c=Cat(o);l(c)&&(a=c.name),o.localName==="gpx"?Gat(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),h=u.start,p=u.stop,g=q.equals(h,Oe.MINIMUM_VALUE),f=q.equals(p,Oe.MAXIMUM_VALUE);if(!g||!f){let x;g&&(x=new Date,x.setHours(0,0,0,0),h=q.fromDate(x)),f&&(x=new Date,x.setHours(24,0,0,0),p=q.fromDate(x)),d=new Sh,d.startTime=h,d.stopTime=p,d.currentTime=q.clone(h),d.clockRange=Mr.LOOP_STOP,d.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(q.secondsDifference(p,h)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),Eat(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==r&&(e._version=r,y=!0),d!==e._clock&&(y=!0,e._clock=d),y&&e._changed.raiseEvent(e),Jr.setLoading(e,!1),e}function Eat(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 Iat(e,t,n,i){i=i??Y.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof Re){n=Re.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?yat(r).then(function(s){let a,c;try{a=qge.parseFromString(s,"application/xml")}catch(d){c=d.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let d=l(c)?c:a.documentElement.firstChild.nodeValue;throw d||(d=a.body.innerText),new ce(d)}return jge(e,a,i)}):jge(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function jV(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new oa(this),this._entityCluster=new Md,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Qp}jV.load=function(e,t){return new jV().load(e,t)};Object.defineProperties(jV.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}}});jV.prototype.update=function(e){return!0};jV.prototype.load=function(e,t){if(!l(e))throw new fe("data is required.");t=t??Y.EMPTY_OBJECT,Jr.setLoading(this,!0);let n=this._name,i=this;return Iat(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=q.equals(s,Oe.MINIMUM_VALUE),d=q.equals(a,Oe.MAXIMUM_VALUE);if(!c||!d){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=q.fromDate(h)),d&&(h=new Date,h.setHours(24,0,0,0),a=q.fromDate(h)),o=new Sh,o.startTime=s,o.stopTime=a,o.currentTime=q.clone(s),o.clockRange=Mr.LOOP_STOP,o.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(q.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Jr.setLoading(i,!1),i}).catch(function(o){return Jr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var Fw=jV;var YLi=_(T(),1);function Xat(e,t){this.position=e,this.headingPitchRoll=t}var Aw=Xat;var _Zi=_(T(),1);var Dw=_(cd(),1);var HLi=_(T(),1);function Wat(e,t){this.position=e,this.headingPitchRange=t}var Mw=Wat;var jLi=_(T(),1);function UD(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new be,this.tourEnd=new be,this.entryStart=new be,this.entryEnd=new be,this._activeEntries=[]}UD.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};UD.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;oye.call(this,e,t,function(i){n.playlistIndex=0,i||iye(n._activeEntries),n.tourEnd.raiseEvent(i)})};UD.prototype.stop=function(){iye(this._activeEntries)};function iye(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function oye(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=Pat.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function Pat(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++,oye.call(this,e,t,n)}}var Nw=UD;var iRi=_(T(),1);function DD(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}DD.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 de(this.view.position);t.flyToBoundingSphere(o,i)}};DD.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};DD.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=kr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=Rt(t,e)),t};var kw=DD;var sRi=_(T(),1);function Nj(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Nj.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Nj.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var Uw=Nj;var fye={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=nx(t),fye[t]}},zj;typeof DOMParser<"u"&&(zj=new DOMParser);var vat=new ND({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Wy=32,rye=2414016,sye=1,aye=16093e3,cye=.1,lye=[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"],dye=["http://www.google.com/kml/ext/2.2"],wat=["http://www.w3.org/2005/Atom"],Pe={kml:lye,gx:dye,atom:wat,kmlgx:lye.concat(dye)},Hj={Document:Vye,Folder:ect,Placemark:tct,NetworkLink:dct,GroundOverlay:act,PhotoOverlay:Zye,ScreenOverlay:sct,Tour:ict};function jf(e){this._dataSource=e,this._deferred=Cl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(jf.prototype,{dataSource:{get:function(){return this._dataSource}}});jf.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};jf.prototype.addPromise=function(e){this._promises.push(e)};jf.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};jf.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=qd._getTimestamp()),this._process(e)};jf.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=qd._getTimestamp(),e._process(!0)},0)};jf.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]};jf.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};jf.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=Hj[i.localName];if(l(o)&&(Pe.kml.indexOf(i.namespaceURI)!==-1||Pe.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||qd._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Fat(e){let t=e.slice(0,Math.min(4,e.size)),n=Cl(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function Aat(e){let t=Cl(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function pye(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function bye(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function Mat(e,t){return Promise.resolve(e.getData(new aD)).then(function(n){n=pye(n),n=bye(n),t.kml=zj.parseFromString(n,"application/xml")})}function kj(e,t){let n=fye.detectFromFilename(e.filename)??"application/octet-stream";return Promise.resolve(e.getData(new rD(n))).then(function(i){t[e.filename]=i})}function Qd(e,t,n,i){let o=i.keys,r=new Dw.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],d=c.getAttribute(n);if(l(d)){let h=new Dw.default(d).absoluteTo(r).toString(),p=o.indexOf(h);if(p!==-1){let g=o[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function jd(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=Kj(a,i);l(c)&&s.setAttribute(n,c.url)}}function gye(e,t,n){let i=Ns(e,"id");i=l(i)&&i.length!==0?i:Hn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Hn(),l(n)&&(i=n+i)),o=t.add(new er({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new fct),o}function Ow(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function zD(e,t){if(!l(e))return m.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return m.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,m.fromDegrees(i,o,r,t)}function OD(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=zD(n[s],t);return o}function Py(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 Ns(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Ai(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function uye(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function wh(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ni(e,t,n){let i=Ai(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function vn(e,t,n){let i=Ai(e,t,n);if(l(i))return i.textContent.trim()}function Fh(e,t,n){let i=Ai(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function Kj(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 Re({url:o});else{let r=new Dw.default(t.getUrlComponent()),s=new Dw.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Re({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var ql={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Bj(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?(ql.maximumRed=r,ql.red=void 0):(ql.maximumRed=void 0,ql.red=0),o>0?(ql.maximumGreen=o,ql.green=void 0):(ql.maximumGreen=void 0,ql.green=0),i>0?(ql.maximumBlue=i,ql.blue=void 0):(ql.maximumBlue=void 0,ql.blue=0),ql.alpha=n,D.fromRandom(ql)):new D(r,o,i,n)}function KT(e,t,n){let i=vn(e,t,n);if(l(i))return Bj(i,vn(e,"colorMode",n)==="random")}function Nat(e){let t=Ai(e,"TimeStamp",Pe.kmlgx),n=vn(t,"when",Pe.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=q.fromIso8601(n),o=new Or;return o.addInterval(new Rn({start:i,stop:Oe.MAXIMUM_VALUE})),o}function kat(e){let t=Ai(e,"TimeSpan",Pe.kmlgx);if(!l(t))return;let n,i=Ai(t,"begin",Pe.kmlgx),o=l(i)?q.fromIso8601(i.textContent):void 0,r=Ai(t,"end",Pe.kmlgx),s=l(r)?q.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(q.lessThan(s,o)){let a=o;o=s,s=a}n=new Or,n.addInterval(new Rn({start:o,stop:s}))}else l(o)?(n=new Or,n.addInterval(new Rn({start:o,stop:Oe.MAXIMUM_VALUE}))):l(s)&&(n=new Or,n.addInterval(new Rn({start:Oe.MINIMUM_VALUE,stop:s})));return n}function yye(){let e=new gc;return e.width=Wy,e.height=Wy,e.scaleByDistance=new Ot(rye,sye,aye,cye),e.pixelOffsetScaleByDistance=new Ot(rye,sye,aye,cye),e}function Jj(){let e=new Jm;return e.outline=!0,e.outlineColor=D.WHITE,e}function xye(){let e=new Km;return e.translucencyByDistance=new Ot(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=_i.LEFT,e.font="16px sans-serif",e.style=Oo.FILL_AND_OUTLINE,e}function Qj(e,t,n,i,o){let r=vn(e,"href",Pe.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=ni(e,"x",Pe.gx)??0,d=ni(e,"y",Pe.gx)??0;c=Math.min(c/32,7),d=7-Math.min(d/32,7);let u=8*d+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=Kj(r,n,i);if(o){let a=vn(e,"refreshMode",Pe.kml),c=vn(e,"viewRefreshMode",Pe.kml);a==="onInterval"||a==="onExpire"?Vt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Vt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=vn(e,"viewBoundScale",Pe.kml)??1,u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=vn(e,"viewFormat",Pe.kml)??u,p=vn(e,"httpQuery",Pe.kml);l(h)&&s.setQueryParameters(ld(YD(h))),l(p)&&s.setQueryParameters(ld(YD(p)));let g=t._ellipsoid;return qj(s,t.camera,t.canvas,d,t._lastCameraView.bbox,g),s}return s}function Uat(e,t,n,i,o){let r=ni(t,"scale",Pe.kml),s=ni(t,"heading",Pe.kml),a=KT(t,"color",Pe.kml),c=Ai(t,"Icon",Pe.kml),d=Qj(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=ni(c,"x",Pe.gx),h=ni(c,"y",Pe.gx),p=ni(c,"w",Pe.gx),g=ni(c,"h",Pe.gx),f=Ai(t,"hotSpot",Pe.kml),y=Py(f,"x"),x=Py(f,"y"),S=Ns(f,"xunits"),C=Ns(f,"yunits"),V=n.billboard;l(V)||(V=yye(),n.billboard=V),V.image=d,V.scale=r,V.color=a,(l(u)||l(h)||l(p)||l(g))&&(V.imageSubRegion=new ze(u,h,p,g)),l(s)&&s!==0&&(V.rotation=X.toRadians(-s),V.alignedAxis=m.UNIT_Z),r=r??1;let L,Z;l(y)&&(S==="pixels"?L=-y*r:S==="insetPixels"?L=(y-Wy)*r:S==="fraction"&&(L=-y*Wy*r),L+=Wy*.5*r),l(x)&&(C==="pixels"?Z=x*r:C==="insetPixels"?Z=(-x+Wy)*r:C==="fraction"&&(Z=x*Wy*r),Z-=Wy*.5*r),(l(L)||l(Z))&&(V.pixelOffset=new U(L,Z))}function BD(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")Uat(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=xye(),n.label=c),c.scale=ni(a,"scale",Pe.kml)??c.scale,c.fillColor=KT(a,"color",Pe.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new xc,n.polyline=c),c.width=ni(a,"width",Pe.kml),c.material=KT(a,"color",Pe.kml),l(KT(a,"outerColor",Pe.gx))&&Vt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(ni(a,"outerWidth",Pe.gx))&&Vt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(ni(a,"physicalWidth",Pe.gx))&&Vt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Fh(a,"labelVisibility",Pe.gx))&&Vt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=Jj(),n.polygon=c),c.material=KT(a,"color",Pe.kml)??c.material,c.fill=Fh(a,"fill",Pe.kml)??c.fill,c.outline=Fh(a,"outline",Pe.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=Bj(vn(a,"bgColor",Pe.kml))??D.WHITE,d=Bj(vn(a,"textColor",Pe.kml))??D.BLACK,u=vn(a,"text",Pe.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:d,text:u}}else if(a.localName==="ListStyle"){let c=vn(a,"listItemType",Pe.kml);(c==="radioFolder"||c==="checkOffOnly")&&Vt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function Dat(e,t,n,i,o){let r=new er,s,a=-1,c=t.childNodes,d=c.length;for(let h=0;h<d;h++){let p=c[h];(p.localName==="Style"||p.localName==="StyleMap")&&(a=h)}if(a!==-1){let h=c[a];if(h.localName==="Style")BD(e,h,r,i,o);else{let p=wh(h,"Pair",Pe.kml);for(let g=0;g<p.length;g++){let f=p[g],y=vn(f,"key",Pe.kml);if(y==="normal"){let x=vn(f,"styleUrl",Pe.kml);if(l(x))s=n.getById(x),l(s)||(s=n.getById(`#${x}`)),l(s)&&r.merge(s);else{let S=Ai(f,"Style",Pe.kml);BD(e,S,r,i,o)}}else Vt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let u=vn(t,"styleUrl",Pe.kml);if(l(u)){let h=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),g=p[0];h=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(h),l(s)||(s=n.getById(`#${h}`)),l(s)&&r.merge(s)}return r}function Oat(e,t,n){return t.fetchXML().then(function(i){return _ye(e,i,n,t,!0)})}function _ye(e,t,n,i,o,r){let s,a,c,d,u=uye(t,"Style",Pe.kml);if(l(u)){let y=u.length;for(s=0;s<y;s++)d=u[s],a=Ns(d,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new er({id:a}),n.add(c),BD(e,d,c,i,r)))}let h=uye(t,"StyleMap",Pe.kml);if(l(h)){let y=h.length;for(s=0;s<y;s++){let x=h[s];if(a=Ns(x,"id"),l(a)){let S=wh(x,"Pair",Pe.kml);for(let C=0;C<S.length;C++){let V=S[C],L=vn(V,"key",Pe.kml);if(L==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let Z=vn(V,"styleUrl",Pe.kml);if(l(Z)){Z[0]!=="#"&&(Z=`#${Z}`),o&&l(i)&&(Z=i.getUrlComponent()+Z);let E=n.getById(Z);l(E)&&c.merge(E)}else d=Ai(V,"Style",Pe.kml),BD(e,d,c,i,r)}}else Vt(`kml-styleMap-${L}`,`KML - Unsupported StyleMap key: ${L}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),f=g.length;for(s=0;s<f;s++){let y=g[s].textContent;if(y[0]!=="#"){let x=y.split("#");if(x.length===2){let S=x[0],C=i.getDerivedResource({url:S});p.push(Oat(e,C,n))}}}return p}function jj(e,t,n){let i=new $b(e,t.id,["position"]),o=new Nf(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new xc,t.polyline.positions=new qb([i,o])}function Tye(e,t){return!l(e)&&!l(t)||e==="clampToGround"?Ke.CLAMP_TO_GROUND:e==="relativeToGround"?Ke.RELATIVE_TO_GROUND:e==="absolute"?Ke.NONE:t==="clampToSeaFloor"?(Vt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Ke.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Vt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Ke.RELATIVE_TO_GROUND):(l(e)?Vt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):Vt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Ke.CLAMP_TO_GROUND)}function Bat(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Vt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new Nf(e))}function Yat(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")&&Vt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function HD(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():xye(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():yye(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(D.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new U(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function Sye(e,t){let n=e.path;l(n)||(n=new cb,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function zat(e,t,n,i,o){let r=vn(n,"coordinates",Pe.kml),s=vn(n,"altitudeMode",Pe.kml),a=vn(n,"altitudeMode",Pe.gx),c=Fh(n,"extrude",Pe.kml),d=e._ellipsoid,u=zD(r,d);return i.position=u,HD(e,i,o,Tye(s,a)),c&&Ow(s,a)&&jj(t,i,o),!0}function mye(e,t,n,i,o){let r=Ai(n,"coordinates",Pe.kml),s=vn(n,"altitudeMode",Pe.kml),a=vn(n,"altitudeMode",Pe.gx),c=Fh(n,"extrude",Pe.kml),d=Fh(n,"tessellate",Pe.kml),u=Ow(s,a),h=ni(n,"drawOrder",Pe.gx),p=e._ellipsoid,g=OD(r,p),f=o.polyline;if(u&&c){let y=new lb;i.wall=y,y.positions=g;let x=o.polygon;l(x)&&(y.fill=x.fill,y.material=x.material),y.outline=!0,l(f)?(y.outlineColor=l(f.material)?f.material.color:D.WHITE,y.outlineWidth=f.width):l(x)&&(y.outlineColor=l(x.material)?x.material.color:D.WHITE)}else if(e._clampToGround&&!u&&d){let y=new xc;y.clampToGround=!0,i.polyline=y,y.positions=g,l(f)?(y.material=l(f.material)?f.material.color.getValue(Oe.MINIMUM_VALUE):D.WHITE,y.width=f.width??1):(y.material=D.WHITE,y.width=1),y.zIndex=h}else l(h)&&Vt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&Vt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=l(f)?f.clone():new xc,i.polyline=f,f.positions=Yat(g,s,a,p),(!d||u)&&(f.arcType=on.NONE);return!0}function Hat(e,t,n,i,o){let r=Ai(n,"outerBoundaryIs",Pe.kml),s=Ai(r,"LinearRing",Pe.kml),a=Ai(s,"coordinates",Pe.kml),c=e._ellipsoid,d=OD(a,c),u=Fh(n,"extrude",Pe.kml),h=vn(n,"altitudeMode",Pe.kml),p=vn(n,"altitudeMode",Pe.gx),g=Ow(h,p),f=l(o.polygon)?o.polygon.clone():Jj(),y=o.polyline;if(l(y)&&(f.outlineColor=l(y.material)?y.material.color:D.WHITE,f.outlineWidth=y.width),i.polygon=f,g?(f.perPositionHeight=!0,f.extrudedHeight=u?0:void 0):e._clampToGround||(f.height=0),l(d)){let x=new Na(d),S=wh(n,"innerBoundaryIs",Pe.kml);for(let C=0;C<S.length;C++){s=wh(S[C],"LinearRing",Pe.kml);for(let V=0;V<s.length;V++)a=Ai(s[V],"coordinates",Pe.kml),d=OD(a,c),l(d)&&x.holes.push(new Na(d))}f.hierarchy=x}return!0}function Kat(e,t,n,i,o){let r=vn(n,"altitudeMode",Pe.kml),s=vn(n,"altitudeMode",Pe.gx),a=wh(n,"coord",Pe.gx),c=wh(n,"angles",Pe.gx),d=wh(n,"when",Pe.kml),u=Fh(n,"extrude",Pe.kml),h=Ow(r,s),p=e._ellipsoid;c.length>0&&Vt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,d.length),f=[],y=[];for(let S=0;S<g;S++){let C=zD(a[S].textContent,p);f.push(C),y.push(q.fromIso8601(d[S].textContent))}let x=new Ca;return x.addSamples(y,f),i.position=x,HD(e,i,o,Tye(r,s)),Sye(i,o),i.availability=new Or,d.length>0&&i.availability.addInterval(new Rn({start:y[0],stop:y[y.length-1]})),h&&u&&jj(t,i,o),!0}function hye(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],h=new Ca;h.addSamples(e,t),n.intervals.addInterval(new Rn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:Bat(h,s,a)})),i.addInterval(new Rn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Rn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function Jat(e,t,n,i,o){let r=Fh(n,"interpolate",Pe.gx),s=wh(n,"Track",Pe.gx),a,c,d,u=!1,h=new t0,p=new Or,g=new Sa,f=e._ellipsoid;for(let y=0,x=s.length;y<x;y++){let S=s[y],C=wh(S,"when",Pe.kml),V=wh(S,"coord",Pe.gx),L=vn(S,"altitudeMode",Pe.kml),Z=vn(S,"altitudeMode",Pe.gx),E=Ow(L,Z),P=Fh(S,"extrude",Pe.kml),W=Math.min(V.length,C.length),v=[];a=[];for(let A=0;A<W;A++){let b=zD(V[A].textContent,f);v.push(b),a.push(q.fromIso8601(C[A].textContent))}r&&(l(c)&&hye([c,a[0]],[d,v[0]],g,p,h,!1,"absolute",void 0,!1),c=a[W-1],d=v[v.length-1]),hye(a,v,g,p,h,E&&P,L,Z,!0),u=u||E&&P}return i.availability=p,i.position=g,HD(e,i,o),Sye(i,o),u&&(jj(t,i,o),i.polyline.show=h),!0}var Cye={Point:zat,LineString:mye,LinearRing:mye,Polygon:Hat,Track:Kat,MultiTrack:Jat,MultiGeometry:Qat,Model:jat};function Qat(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,d=s.length;c<d;c++){let u=s.item(c),h=Cye[u.localName];if(l(h)){let p=gye(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,u,p,o)&&(a=!0)}}return a}function jat(e,t,n,i,o){return Vt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function qat(e,t){let n=Ai(e,"ExtendedData",Pe.kml);if(!l(n))return;l(Ai(n,"SchemaData",Pe.kml))&&Vt("kml-schemaData","KML - SchemaData is unsupported"),l(Ns(n,"xmlns:prefix"))&&Vt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=wh(n,"Data",Pe.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Ns(a,"name");l(c)&&(i[c]={displayName:vn(a,"displayName",Pe.kml),value:vn(a,"value",Pe.kml)})}}t.kml.extendedData=i}var xo;typeof document<"u"&&(xo=document.createElement("div"));function $at(e,t,n,i,o){let r,s,a,c=t.kml,d=c.extendedData,u=vn(e,"description",Pe.kml),h=t.balloonStyle??n.balloonStyle,p=D.WHITE,g=D.BLACK,f=u;l(h)&&(p=h.bgColor??D.WHITE,g=h.textColor??D.BLACK,f=h.text??u);let y;if(l(f)){if(f=f.replace("$[name]",t.name??""),f=f.replace("$[description]",u??""),f=f.replace("$[address]",c.address??""),f=f.replace("$[Snippet]",c.snippet??""),f=f.replace("$[id]",t.id),f=f.replace("$[geDirections]",""),l(d)){let C=f.match(/\$\[.+?\]/g);if(C!==null)for(r=0;r<C.length;r++){let V=C[r],L=V.substr(2,V.length-3),Z=/\/displayName$/.test(L);L=L.replace(/\/displayName$/,""),y=d[L],l(y)&&(y=Z?y.displayName:y.value),l(y)&&(f=f.replace(V,y??""))}}}else if(l(d)&&(a=Object.keys(d),a.length>0)){for(f='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],y=d[s],f+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;f+="</tbody></table>"}if(!l(f))return;f=vat.link(f),xo.innerHTML=f;let x=xo.querySelectorAll("a");for(r=0;r<x.length;r++)x[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Qd(xo,"a","href",i),Qd(xo,"link","href",i),Qd(xo,"area","href",i),Qd(xo,"img","src",i),Qd(xo,"iframe","src",i),Qd(xo,"video","src",i),Qd(xo,"audio","src",i),Qd(xo,"source","src",i),Qd(xo,"track","src",i),Qd(xo,"input","src",i),Qd(xo,"embed","src",i),Qd(xo,"script","src",i),Qd(xo,"video","poster",i)),jd(xo,"a","href",o),jd(xo,"link","href",o),jd(xo,"area","href",o),jd(xo,"img","src",o),jd(xo,"iframe","src",o),jd(xo,"video","src",o),jd(xo,"audio","src",o),jd(xo,"source","src",o),jd(xo,"track","src",o),jd(xo,"input","src",o),jd(xo,"embed","src",o),jd(xo,"script","src",o),jd(xo,"video","poster",o);let S='<div class="cesium-infoBox-description-lighter" style="';S+="overflow:auto;",S+="word-wrap:break-word;",S+=`background-color:${p.toCssColorString()};`,S+=`color:${g.toCssColorString()};`,S+='">',S+=`${xo.innerHTML}</div>`,xo.innerHTML="",t.description=S}function KD(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=gye(t,i,n.context),c=a.kml,d=Dat(e,t,n.styleCollection,r,s),u=vn(t,"name",Pe.kml);a.name=u,a.parent=o;let h=kat(t);l(h)||(h=Nat(t)),a.availability=h,e8(a);function p(V){return V?V.show&&p(V.parent):!0}let g=Fh(t,"visibility",Pe.kml);a.show=p(o)&&(g??!0);let f=Ai(t,"author",Pe.atom),y=c.author;y.name=vn(f,"name",Pe.atom),y.uri=vn(f,"uri",Pe.atom),y.email=vn(f,"email",Pe.atom);let x=Ai(t,"link",Pe.atom),S=c.link;S.href=Ns(x,"href"),S.hreflang=Ns(x,"hreflang"),S.rel=Ns(x,"rel"),S.type=Ns(x,"type"),S.title=Ns(x,"title"),S.length=Ns(x,"length"),c.address=vn(t,"address",Pe.kml),c.phoneNumber=vn(t,"phoneNumber",Pe.kml),c.snippet=vn(t,"Snippet",Pe.kml),qat(t,a),$at(t,a,d,s,r);let C=e._ellipsoid;return Rye(t,a,C),Lye(t,a,C),l(Ai(t,"Region",Pe.kml))&&Vt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function Vye(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function ect(e,t,n,i){let o=KD(e,t,n),r=Be(n);r.parentEntity=o.entity,Vye(e,t,r,i)}function tct(e,t,n,i){let o=KD(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let d=0,u=c.length;d<u&&!a;d++){let h=c.item(d),p=Cye[h.localName];l(p)&&(p(e,n.entityCollection,h,r,s,r.id),a=!0)}a||(r.merge(s),HD(e,r,s))}var nct={FlyTo:rct,Wait:oct,SoundCue:Uj,AnimatedUpdate:Uj,TourControl:Uj};function ict(e,t,n,i){let o=vn(t,"name",Pe.kml),r=Ns(t,"id"),s=new Nw(o,r),a=Ai(t,"Playlist",Pe.gx);if(a){let c=e._ellipsoid,d=a.childNodes;for(let u=0;u<d.length;u++){let h=d[u];if(h.localName){let p=nct[h.localName];p?p(s,h,c):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(s)}function Uj(e,t){Vt(`KML Tour unsupported node ${t.localName}`)}function oct(e,t){let n=ni(t,"duration",Pe.gx);e.addPlaylistEntry(new Uw(n))}function rct(e,t,n){let i=ni(t,"duration",Pe.gx),o=vn(t,"flyToMode",Pe.gx),r={kml:{}};Rye(t,r,n),Lye(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new kw(i,o,s);e.addPlaylistEntry(a)}function Lye(e,t,n){let i=Ai(e,"Camera",Pe.kml);if(l(i)){let o=ni(i,"longitude",Pe.kml)??0,r=ni(i,"latitude",Pe.kml)??0,s=ni(i,"altitude",Pe.kml)??0,a=ni(i,"heading",Pe.kml)??0,c=ni(i,"tilt",Pe.kml)??0,d=ni(i,"roll",Pe.kml)??0,u=m.fromDegrees(o,r,s,n),h=Xa.fromDegrees(a,c-90,d);t.kml.camera=new Aw(u,h)}}function Rye(e,t,n){let i=Ai(e,"LookAt",Pe.kml);if(l(i)){let o=ni(i,"longitude",Pe.kml)??0,r=ni(i,"latitude",Pe.kml)??0,s=ni(i,"altitude",Pe.kml)??0,a=ni(i,"heading",Pe.kml),c=ni(i,"tilt",Pe.kml),d=ni(i,"range",Pe.kml)??0;c=X.toRadians(c??0),a=X.toRadians(a??0);let u=new Gu(a,c-X.PI_OVER_TWO,d),h=m.fromDegrees(o,r,s,n);t.kml.lookAt=new Mw(h,u)}}function sct(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Ai(t,"Icon",Pe.kml),c=Qj(a,e,r,s,!1);if(!l(c))return;let d=document.createElement("img");e._screenOverlays.push(d),d.src=c.url,d.onload=function(){let u=["position: absolute"],h=Ai(t,"screenXY",Pe.kml),p=Ai(t,"overlayXY",Pe.kml),g=Ai(t,"size",Pe.kml),f,y,x,S,C,V;l(g)&&(f=Py(g,"x"),y=Py(g,"y"),x=Ns(g,"xunits"),S=Ns(g,"yunits"),l(f)&&f!==-1&&f!==0&&(x==="fraction"?C=`width: ${Math.floor(f*100)}%`:x==="pixels"&&(C=`width: ${f}px`),u.push(C)),l(y)&&y!==-1&&y!==0&&(S==="fraction"?V=`height: ${Math.floor(y*100)}%`:S==="pixels"&&(V=`height: ${y}px`),u.push(V))),d.style=u.join(";");let L=0,Z=d.height;l(p)&&(f=Py(p,"x"),y=Py(p,"y"),x=Ns(p,"xunits"),S=Ns(p,"yunits"),l(f)&&(x==="fraction"?L=f*d.width:(x==="pixels"||x==="insetPixels")&&(L=f)),l(y)&&(S==="fraction"?Z=y*d.height:(S==="pixels"||S==="insetPixels")&&(Z=y))),l(h)&&(f=Py(h,"x"),y=Py(h,"y"),x=Ns(h,"xunits"),S=Ns(h,"yunits"),l(f)&&(x==="fraction"?C=`left: calc(${Math.floor(f*100)}% - ${L}px)`:x==="pixels"?C=`left: ${f-L}px`:x==="insetPixels"&&(C=`right: ${f-L}px`),u.push(C)),l(y)&&(S==="fraction"?V=`bottom: calc(${Math.floor(y*100)}% - ${Z}px)`:S==="pixels"?V=`bottom: ${y-Z}px`:S==="insetPixels"&&(V=`top: ${y-Z}px`),u.push(V))),d.style=u.join(";")},o.appendChild(d)}function act(e,t,n,i){let r=KD(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=OD(Ai(t,"LatLonQuad",Pe.gx),c),u=ni(t,"drawOrder",Pe.kml);if(l(d))s=Jj(),s.hierarchy=new Na(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new Qm,s.zIndex=u,r.rectangle=s;let f=Ai(t,"LatLonBox",Pe.kml);if(l(f)){let y=ni(f,"west",Pe.kml),x=ni(f,"south",Pe.kml),S=ni(f,"east",Pe.kml),C=ni(f,"north",Pe.kml);l(y)&&(y=X.negativePiToPi(X.toRadians(y))),l(x)&&(x=X.clampToLatitudeRange(X.toRadians(x))),l(S)&&(S=X.negativePiToPi(X.toRadians(S))),l(C)&&(C=X.clampToLatitudeRange(X.toRadians(C))),s.coordinates=new le(y,x,S,C);let V=ni(f,"rotation",Pe.kml);if(l(V)){let L=X.toRadians(V);s.rotation=L,s.stRotation=L}}}let h=Ai(t,"Icon",Pe.kml),p=Qj(h,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&Vt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let f=ni(h,"x",Pe.gx),y=ni(h,"y",Pe.gx),x=ni(h,"w",Pe.gx),S=ni(h,"h",Pe.gx);(l(f)||l(y)||l(x)||l(S))&&Vt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=KT(t,"color",Pe.kml),s.material.transparent=!0}else s.material=KT(t,"color",Pe.kml);let g=vn(t,"altitudeMode",Pe.kml);l(g)?g==="absolute"?(s.height=ni(t,"altitude",Pe.kml),s.zIndex=void 0):g!=="clampToGround"&&Vt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=vn(t,"altitudeMode",Pe.gx),g==="relativeToSeaFloor"?(Vt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ni(t,"altitude",Pe.kml),s.zIndex=void 0):g==="clampToSeaFloor"?Vt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&Vt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function Zye(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),Vt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var vy={INTERVAL:0,EXPIRE:1,STOP:2};function YD(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var cct=new le,qV=new he,Dj=new U,lct=new m;function qj(e,t,n,i,o,r){function s(d){return d<-X.PI_OVER_TWO?-X.PI_OVER_TWO:d>X.PI_OVER_TWO?X.PI_OVER_TWO:d}function a(d){return d>X.PI?d-X.TWO_PI:d<-X.PI?d+X.TWO_PI:d}let c=rx(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==oe.MORPHING){let d,u;if(o=o??cct,l(n)&&(Dj.x=n.clientWidth*.5,Dj.y=n.clientHeight*.5,d=t.pickEllipsoid(Dj,r,lct)),l(d)?u=r.cartesianToCartographic(d,qV):(u=le.center(o,qV),d=r.cartographicToCartesian(u)),l(i)&&!X.equalsEpsilon(i,1,X.EPSILON9)){let S=o.width*i*.5,C=o.height*i*.5;o=new le(a(u.longitude-S),s(u.latitude-C),a(u.longitude+S),s(u.latitude+C))}c=c.replace("[bboxWest]",X.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",X.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",X.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",X.toDegrees(o.north).toString());let h=X.toDegrees(u.longitude).toString(),p=X.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",h),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",X.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",X.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,d)),c=c.replace("[lookatTerrainLon]",h),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,qV),c=c.replace("[cameraLon]",X.toDegrees(qV.longitude).toString()),c=c.replace("[cameraLat]",X.toDegrees(qV.latitude).toString()),c=c.replace("[cameraAlt]",X.toDegrees(qV.height).toString());let g=t.frustum,f=g.aspectRatio,y="",x="";if(l(f)){let S=X.toDegrees(g.fov);f>1?(y=S,x=S/f):(x=S,y=S*f)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",x.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(ld(c))}function dct(e,t,n,i){let r=KD(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Ai(t,"Link",Pe.kml);if(l(c)||(c=Ai(t,"Url",Pe.kml)),l(c)){let d=vn(c,"href",Pe.kml),u,h;if(l(d)){let p=d;if(d=Kj(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=vn(c,"viewRefreshMode",Pe.kml),u==="onRegion"){Vt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=vn(c,"viewBoundScale",Pe.kml)??1;let x=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",S=vn(c,"viewFormat",Pe.kml)??x,C=vn(c,"httpQuery",Pe.kml);l(S)&&d.setQueryParameters(ld(YD(S))),l(C)&&d.setQueryParameters(ld(YD(C)));let V=e._ellipsoid;qj(d,e.camera,e.canvas,h,e._lastCameraView.bbox,V)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new oa,y=$j(e,f,d,g).then(function(x){let S=e._entityCollection,C=f.values;S.suspendEvents();for(let Z=0;Z<C.length;Z++){let E=C[Z];l(E.parent)||(E.parent=r,e8(E)),S.add(E)}S.resumeEvents();let V=vn(c,"refreshMode",Pe.kml),L=ni(c,"refreshInterval",Pe.kml)??0;if(V==="onInterval"&&L>0||V==="onExpire"||u==="onStop"){let Z=Ai(x,"NetworkLinkControl",Pe.kml),E=l(Z),P=q.now(),W={id:Hn(),href:d,cookie:{},lastUpdated:P,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:P},v=0;if(E&&(W.cookie=ld(vn(Z,"cookie",Pe.kml)??""),v=ni(Z,"minRefreshPeriod",Pe.kml)??0),V==="onInterval")E&&(L=Math.max(v,L)),W.refreshMode=vy.INTERVAL,W.time=L;else if(V==="onExpire"){let A;if(E&&(A=vn(Z,"expires",Pe.kml)),l(A))try{let b=q.fromIso8601(A),R=q.secondsDifference(b,P);R>0&&R<v&&q.addSeconds(P,v,b),W.refreshMode=vy.EXPIRE,W.time=b}catch{Vt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else Vt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(W.refreshMode=vy.STOP,W.time=ni(c,"viewRefreshTime",Pe.kml)??0):Vt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(W.refreshMode)&&e._networkLinks.set(W.id,W)}}).catch(function(x){Vt(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,x)});i.addPromise(y)}}}function uct(e,t,n,i){let o=Hj[t.localName];return l(o)?o(e,t,n,i):Zye(e,t,n,i)}function Yj(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Ai(a,"Document",Pe.kml),d=vn(c,"name",Pe.kml);l(d)||(d=Yp(i.getUrlComponent())),l(e._name)||(e._name=d);let u=new qd._DeferredLoading(e),h=new oa(e);return Promise.all(_ye(e,n,h,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let f=p.childNodes;for(let y=0;y<f.length;y++){let x=f[y];if(l(Hj[x.localName])){p=x;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),uct(e,p,g,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}function mct(e,t,n,i,o){let r=sn("ThirdParty/Workers/z-worker-pako.js");DV({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new CD(new l0(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],d={},u;for(let h=0;h<a.length;h++){let p=a[h];p.directory||(/\.kml$/i.test(p.filename)&&(!l(u)||!/\//i.test(p.filename))?(l(u)&&c.push(kj(u,d)),u=p):c.push(kj(p,d)))}return l(u)&&c.push(Mat(u,d)),Promise.all(c).then(function(){if(s.close(),!l(d.kml))throw new ce("KMZ file does not contain a KML document.");return d.keys=Object.keys(d),Yj(e,t,d.kml,i,d,o)})})}function $j(e,t,n,i){i=i??Y.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Re){n=Re.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let d=e._resourceCredits,u=n.credits;if(l(u)){let h=u.length;for(let p=0;p<h;p++)d.push(u[p])}}else o=o??Re.DEFAULT.clone();return o=Re.createIfNeeded(o),l(a)&&(a=Pn(a)),Promise.resolve(c).then(function(d){return d instanceof Blob?Fat(d).then(function(u){return u?mct(e,t,d,o,a):Aat(d).then(function(h){h=pye(h),h=bye(h);let p,g;try{p=zj.parseFromString(h,"application/xml")}catch(f){g=f.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let f=l(g)?g:p.documentElement.firstChild.nodeValue;throw f||(f=p.body.innerText),new ce(f)}return Yj(e,t,p,o,r,a,s)})}):Yj(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}function qd(e){e=e??Y.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new be,this._error=new be,this._loading=new be,this._refresh=new be,this._unsupportedNode=new be,this._clock=void 0,this._entityCollection=new oa(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Qp,this._networkLinks=new It,this._entityCluster=new Md,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?m.clone(t.positionWC):void 0,direction:l(t)?m.clone(t.directionWC):void 0,up:l(t)?m.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():le.clone(le.MAX_VALUE)},this._ellipsoid=e.ellipsoid??ne.default;let i=e.credit;typeof i=="string"&&(i=new Gt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}qd.load=function(e,t){return t=t??Y.EMPTY_OBJECT,new qd(t).load(e,t)};Object.defineProperties(qd.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}}});qd.prototype.load=function(e,t){t=t??Y.EMPTY_OBJECT,Jr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return $j(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=q.equals(s,Oe.MINIMUM_VALUE),d=q.equals(a,Oe.MAXIMUM_VALUE);if(!c||!d){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=q.fromDate(h)),d&&(h=new Date,h.setHours(24,0,0,0),a=q.fromDate(h)),o=new Sh,o.startTime=s,o.stopTime=a,o.currentTime=q.clone(s),o.clockRange=Mr.LOOP_STOP,o.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(q.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Jr.setLoading(i,!1),i}).catch(function(o){return Jr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};qd.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function e8(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 hct(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Ai(r,"NetworkLinkControl",Pe.kml),c=l(a),d=0;if(c){if(l(Ai(a,"Update",Pe.kml))){Vt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=ld(vn(a,"cookie",Pe.kml)??""),d=ni(a,"minRefreshPeriod",Pe.kml)??0}let u=q.now(),h=t.refreshMode;if(h===vy.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(h===vy.EXPIRE){let P;if(l(a)&&(P=vn(a,"expires",Pe.kml)),l(P))try{let W=q.fromIso8601(P),v=q.secondsDifference(W,u);v>0&&v<d&&q.addSeconds(u,d,W),t.time=W}catch{Vt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else Vt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,f=n.values;function y(P){g.remove(P);let W=P._children,v=W.length;for(let A=0;A<v;++A)y(W[A])}g.suspendEvents();let x=g.values.slice(),S;for(S=0;S<x.length;++S){let P=x[S];P.parent===p&&(P.parent=void 0,y(P))}for(g.resumeEvents(),g.suspendEvents(),S=0;S<f.length;S++){let P=f[S];l(P.parent)||(P.parent=p,e8(P)),g.add(P)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let C=g.computeAvailability(),V=C.start,L=C.stop,Z=q.equals(V,Oe.MINIMUM_VALUE),E=q.equals(L,Oe.MAXIMUM_VALUE);if(!Z||!E){let P=e._clock;(P.startTime!==V||P.stopTime!==L)&&(P.startTime=V,P.stopTime=L,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var Oj=new It;qd.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=q.now(),i=this;Oj.removeAll();function o(u){let h=u._children,p=h.length;for(let g=0;g<p;++g){let f=h[g];Oj.set(f.id,f),o(f)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,X.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,X.EPSILON7)&&a.upWC.equalsEpsilon(s.up,X.EPSILON7))&&(s.position=m.clone(a.positionWC),s.direction=m.clone(a.directionWC),s.up=m.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new It,d=!1;return t.values.forEach(function(u){let h=u.entity;if(!Oj.contains(h.id)){if(!u.updating){let p=!1;if(u.refreshMode===vy.INTERVAL?q.secondsDifference(n,u.lastUpdated)>u.time&&(p=!0):u.refreshMode===vy.EXPIRE?q.greaterThan(n,u.time)&&(p=!0):u.refreshMode===vy.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&q.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(h),u.updating=!0;let g=new oa,f=u.href.clone();f.setQueryParameters(u.cookie);let y=i._ellipsoid??ne.default;qj(f,i.camera,i.canvas,u.viewBoundScale,s.bbox,y),$j(i,g,f,{context:h.id}).then(hct(i,u,g,c,f)).catch(function(x){let S=`NetworkLink ${u.href} refresh failed: ${x}`;console.log(S),i._error.raiseEvent(i,S)}),d=!0}}c.set(u.id,u)}}),d&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function fct(){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}qd._DeferredLoading=jf;qd._getTimestamp=xi;var JT=qd;var CZi=_(T(),1);function Bw(){fe.throwInstantiationError()}Bw.prototype.update=fe.throwInstantiationError;Bw.prototype.getBoundingSphere=fe.throwInstantiationError;Bw.prototype.isDestroyed=fe.throwInstantiationError;Bw.prototype.destroy=fe.throwInstantiationError;var t8=Bw;var D8i=_(T(),1);var EZi=_(T(),1);async function n8(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===oe.SCENE2D)return r;let c=[le.center(e),le.southeast(e),le.southwest(e),le.northeast(e),le.northwest(e)],d=await n8._sampleTerrainMostDetailed(n,c),u=!1,h=d.reduce(function(g,f){return l(f.height)?(u=!0,Math.max(f.height,g)):g},-Number.MAX_VALUE),p=r;return u&&(p.height+=h),p}n8._sampleTerrainMostDetailed=c_;var QT=n8;var Yvi=_(T(),1);var XZi=_(T(),1),Yw=`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
|
|
|
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
|
|
|
#ifdef COLOR_CORRECT
|
|
|
uniform vec3 u_hsbShift; // Hue, saturation, brightness
|
|
|
#endif
|
|
|
|
|
|
#ifdef HIGHLIGHT_FILL_TILE
|
|
|
uniform vec4 u_fillHighlightColor;
|
|
|
#endif
|
|
|
|
|
|
#ifdef TRANSLUCENT
|
|
|
uniform vec4 u_frontFaceAlphaByDistance;
|
|
|
uniform vec4 u_backFaceAlphaByDistance;
|
|
|
uniform vec4 u_translucencyRectangle;
|
|
|
#endif
|
|
|
|
|
|
#ifdef UNDERGROUND_COLOR
|
|
|
uniform vec4 u_undergroundColor;
|
|
|
uniform vec4 u_undergroundColorAlphaByDistance;
|
|
|
#endif
|
|
|
|
|
|
#ifdef ENABLE_VERTEX_LIGHTING
|
|
|
uniform float u_lambertDiffuseMultiplier;
|
|
|
uniform float u_vertexShadowDarkness;
|
|
|
#endif
|
|
|
|
|
|
in vec3 v_positionMC;
|
|
|
in vec3 v_positionEC;
|
|
|
in vec3 v_textureCoordinates;
|
|
|
in vec3 v_normalMC;
|
|
|
in vec3 v_normalEC;
|
|
|
|
|
|
#ifdef APPLY_MATERIAL
|
|
|
in float v_height;
|
|
|
in float v_slope;
|
|
|
in float v_aspect;
|
|
|
#endif
|
|
|
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
|
|
|
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
|
|
|
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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;
|
|
|
}
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
|
|
|
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\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,
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
|
bool textureInvertColor,
|
|
|
vec3 texturefilterColor,
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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()
|
|
|
{
|
|
|
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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);
|
|
|
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
|
|
|
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\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 PZi=_(T(),1),zw=`#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);
|
|
|
return czm_modelViewProjection * morphPosition;
|
|
|
}
|
|
|
|
|
|
#ifdef QUANTIZATION_BITS12
|
|
|
uniform vec2 u_minMaxHeight;
|
|
|
uniform mat4 u_scaleAndBias;
|
|
|
#endif
|
|
|
|
|
|
|
|
|
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\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)
|
|
|
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
|
|
|
|
|
|
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\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
|
|
|
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\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 wZi=_(T(),1),$V=`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 HZi=_(T(),1);var NZi=_(T(),1);var pct=new U;function bct(e,t){let n=e.unionClippingRegions,i=e.length,o=ys.useFloatTexture(t),r=ys.getTextureResolution(e,t,pct),s=r.x,a=r.y,c=o?xct(s,a):_ct(s,a);return c+=`
|
|
|
`,c+=n?gct(i):yct(i),c}function gct(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
|
|
|
{
|
|
|
vec4 position = czm_windowToEyeCoordinates(fragCoord);
|
|
|
vec3 clipNormal = vec3(0.0);
|
|
|
vec3 clipPosition = vec3(0.0);
|
|
|
float clipAmount;
|
|
|
float pixelWidth = czm_metersPerPixel(position);
|
|
|
bool breakAndDiscard = false;
|
|
|
for (int i = 0; i < ${e}; ++i)
|
|
|
{
|
|
|
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
|
|
|
clipNormal = clippingPlane.xyz;
|
|
|
clipPosition = -clippingPlane.w * clipNormal;
|
|
|
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
|
|
|
clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
|
|
|
if (amount <= 0.0)
|
|
|
{
|
|
|
breakAndDiscard = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (breakAndDiscard) {
|
|
|
discard;
|
|
|
}
|
|
|
return clipAmount;
|
|
|
}
|
|
|
`}function yct(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 xct(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
|
|
|
{
|
|
|
int pixY = clippingPlaneNumber / ${e};
|
|
|
int pixX = clippingPlaneNumber - (pixY * ${e});
|
|
|
float u = (float(pixX) + 0.5) * ${o};
|
|
|
float v = (float(pixY) + 0.5) * ${r};
|
|
|
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
|
|
|
return czm_transformPlane(plane, transform);
|
|
|
}
|
|
|
`}function _ct(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
|
|
|
{
|
|
|
int clippingPlaneStartIndex = clippingPlaneNumber * 2;
|
|
|
int pixY = clippingPlaneStartIndex / ${e};
|
|
|
int pixX = clippingPlaneStartIndex - (pixY * ${e});
|
|
|
float u = (float(pixX) + 0.5) * ${o};
|
|
|
float v = (float(pixY) + 0.5) * ${r};
|
|
|
vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
|
|
|
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
|
|
|
vec4 plane;
|
|
|
plane.xyz = czm_octDecode(oct, 65535.0);
|
|
|
plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v)));
|
|
|
return czm_transformPlane(plane, transform);
|
|
|
}
|
|
|
`}var u0=bct;function Tct(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 i8(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function Sct(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 Cct(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 Vct(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 Lct(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}i8.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,d=e.applyAlpha,u=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,f=e.showOceanWaves,y=e.enableLighting,x=e.dynamicAtmosphereLighting,S=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,V=e.perFragmentGroundAtmosphere,L=e.hasVertexNormals,Z=e.useWebMercatorProjection,E=e.enableFog,P=e.enableClippingPlanes,W=e.clippingPlanes,v=e.enableClippingPolygons,A=e.clippingPolygons,b=e.clippedByBoundaries,R=e.hasImageryLayerCutout,G=e.colorCorrect,I=e.highlightFillTile,w=e.colorToAlpha,M=e.hasGeodeticSurfaceNormals,O=e.hasExaggeration,k=e.showUndergroundColor,B=e.translucent,N=e.marsOptions||{},z=0,K="",H=n.renderedMesh.encoding;H.quantization===Hs.BITS12&&(z=1,K="QUANTIZATION_BITS12");let ee=0,pe="";b&&(ee=1,pe="TILE_LIMIT_RECTANGLE");let _e=0,ae="";R&&(_e=1,ae="APPLY_IMAGERY_CUTOUT");let ye=t.mode,Se=ye|o<<2|r<<3|s<<4|a<<5|c<<6|d<<7|p<<8|g<<9|f<<10|y<<11|x<<12|S<<13|C<<14|V<<15|L<<16|Z<<17|E<<18|z<<19|h<<20|P<<21|v<<22|ee<<23|_e<<24|G<<25|I<<26|w<<27|M<<28|O<<29|k<<30|B<<31|u<<32,Ee=0;l(W)&&W.length>0&&(Ee=P?W.clippingPlanesState:0);let Ie=0;l(A)&&A.length>0&&(Ie=v?A.clippingPolygonsState:0);let Fe=n.surfaceShader;if(l(Fe)&&Fe.numberOfDayTextures===i&&Fe.flags===Se&&Fe.material===this.material&&Fe.clippingShaderState===Ee&&Fe.clippingPolygonShaderState===Ie)return Fe.shaderProgram;let ve=this._shadersByTexturesFlags[i];if(l(ve)||(ve=this._shadersByTexturesFlags[i]=[]),Fe=ve[Se],!l(Fe)||Fe.material!==this.material||Fe.clippingShaderState!==Ee||Fe.clippingPolygonShaderState!==Ie){let ct=this.baseVertexShaderSource.clone(),Je=this.baseFragmentShaderSource.clone();Ee!==0&&Je.sources.unshift(u0(W,t.context)),Ie!==0&&(Je.sources.unshift(Cct(t.context)),ct.sources.unshift(Vct(t.context))),N.enableUplift&&Je.defines.push("APPLY_MARS3D_UPLIFT"),N.enableFlat&&ct.defines.push("APPLY_MARS3D_FLAT"),N.enableClip&&Je.defines.push("APPLY_MARS3D_CLIP"),N.enableFlood&&Je.defines.push("APPLY_MARS3D_FLOOD"),ct.defines.push(K),Je.defines.push(`TEXTURE_UNITS ${i}`,pe,ae),o&&Je.defines.push("APPLY_BRIGHTNESS"),r&&Je.defines.push("APPLY_CONTRAST"),s&&Je.defines.push("APPLY_HUE"),a&&Je.defines.push("APPLY_SATURATION"),c&&Je.defines.push("APPLY_GAMMA"),N.invertColor&&Je.defines.push("APPLY_INVERT_COLOR_MARS3D"),N.filterColor&&Je.defines.push("APPLY_FILTER_COLOR_MARS3D"),d&&Je.defines.push("APPLY_ALPHA"),u&&Je.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&Je.defines.push("HAS_WATER_MASK"),g&&(Je.defines.push("SHOW_REFLECTIVE_OCEAN"),ct.defines.push("SHOW_REFLECTIVE_OCEAN")),f&&Je.defines.push("SHOW_OCEAN_WAVES"),w&&Je.defines.push("APPLY_COLOR_TO_ALPHA"),k&&(ct.defines.push("UNDERGROUND_COLOR"),Je.defines.push("UNDERGROUND_COLOR")),B&&(ct.defines.push("TRANSLUCENT"),Je.defines.push("TRANSLUCENT")),y&&(L?(ct.defines.push("ENABLE_VERTEX_LIGHTING"),Je.defines.push("ENABLE_VERTEX_LIGHTING")):(ct.defines.push("ENABLE_DAYNIGHT_SHADING"),Je.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(ct.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Je.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),S&&(ct.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Je.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(ct.defines.push("GROUND_ATMOSPHERE"),Je.defines.push("GROUND_ATMOSPHERE"),V&&(ct.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Je.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),ct.defines.push("INCLUDE_WEB_MERCATOR_Y"),Je.defines.push("INCLUDE_WEB_MERCATOR_Y"),E&&(ct.defines.push("FOG"),Je.defines.push("FOG")),h&&Je.defines.push("APPLY_SPLIT"),P&&Je.defines.push("ENABLE_CLIPPING_PLANES"),v&&(Je.defines.push("ENABLE_CLIPPING_POLYGONS"),ct.defines.push("ENABLE_CLIPPING_POLYGONS"),A.inverse&&Je.defines.push("CLIPPING_INVERSE"),Je.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${A.extentsCount}`),ct.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${A.extentsCount}`)),G&&Je.defines.push("COLOR_CORRECT"),I&&Je.defines.push("HIGHLIGHT_FILL_TILE"),M&&ct.defines.push("GEODETIC_SURFACE_NORMALS"),O&&ct.defines.push("EXAGGERATION");let bt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
|
|
|
{
|
|
|
vec4 color = initialColor;
|
|
|
`;R&&(bt+=` vec4 cutoutAndColorResult;
|
|
|
bool texelUnclipped;
|
|
|
`);for(let Tt=0;Tt<i;++Tt)R?bt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Tt}];
|
|
|
texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
|
|
|
cutoutAndColorResult = sampleAndBlend(
|
|
|
`:bt+=` color = sampleAndBlend(
|
|
|
`,bt+=` color,
|
|
|
u_dayTextures[${Tt}],
|
|
|
u_dayTextureUseWebMercatorT[${Tt}] ? textureCoordinates.xz : textureCoordinates.xy,
|
|
|
u_dayTextureTexCoordsRectangle[${Tt}],
|
|
|
u_dayTextureTranslationAndScale[${Tt}],
|
|
|
${d?`u_dayTextureAlpha[${Tt}]`:"1.0"},
|
|
|
${u?`u_dayTextureNightAlpha[${Tt}]`:"1.0"},
|
|
|
${u?`u_dayTextureDayAlpha[${Tt}]`:"1.0"},
|
|
|
${o?`u_dayTextureBrightness[${Tt}]`:"0.0"},
|
|
|
${r?`u_dayTextureContrast[${Tt}]`:"0.0"},
|
|
|
${s?`u_dayTextureHue[${Tt}]`:"0.0"},
|
|
|
${a?`u_dayTextureSaturation[${Tt}]`:"0.0"},
|
|
|
${c?`u_dayTextureOneOverGamma[${Tt}]`:"0.0"},
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
|
${N.invertColor?`u_mars3dTextureInvertColor[${Tt}]`:"false"},
|
|
|
${N.filterColor?`u_mars3dTextureFilterColor[${Tt}]`:"vec3(1.0)"},
|
|
|
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
|
${h?`u_dayTextureSplit[${Tt}]`:"0.0"},
|
|
|
${w?`u_colorsToAlpha[${Tt}]`:"vec4(0.0)"},
|
|
|
nightBlend );
|
|
|
`,R&&(bt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
|
|
|
`);bt+=` return color;
|
|
|
}`,Je.sources.push(bt),ct.sources.push(Sct(ye)),ct.sources.push(Lct(Z));let Qe=nn.fromCache({context:t.context,vertexShaderSource:ct,fragmentShaderSource:Je,attributeLocations:H.getAttributeLocations()});Fe=ve[Se]=new Tct(i,Se,this.material,Qe,Ee,Ie)}return n.surfaceShader=Fe,Fe.shaderProgram};i8.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 me(this)};var Hw=i8;var S2i=_(T(),1);var GGi=_(T(),1);var JZi=_(T(),1),Rct={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},qn=Object.freeze(Rct);var jZi=_(T(),1),Zct={START:0,LOADING:1,DONE:2,FAILED:3},aa=Object.freeze(Zct);var $Zi=_(T(),1),Gct={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},bo=Object.freeze(Gct);function or(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new re(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=bo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new de,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(or.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===bo.RECEIVING||e===bo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==qn.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var Ect=new he;function o8(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==oe.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,Ect);s=n.project(c,r),s=m.fromElements(s.z,s.x,s.y,r)}return s}var Ict=new m,Xct=new m,Wct=new m;or.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,d=a.length,u=Number.MAX_VALUE;for(let h=0;h<d;h+=3){let p=a[h],g=a[h+1],f=a[h+2],y=o8(c,t,n,s,p,Ict),x=o8(c,t,n,s,g,Xct),S=o8(c,t,n,s,f,Wct),C=ei.rayTriangleParametric(e,y,x,S,i);l(C)&&C<u&&C>=0&&(u=C)}return u!==Number.MAX_VALUE?yn.getPoint(e,u,o):void 0};or.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=bo.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()};or.prototype.freeVertexArray=function(){or._freeVertexArray(this.vertexArray),this.vertexArray=void 0,or._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};or.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new or),e.state===aa.START&&(Pct(e,t,n),e.state=aa.LOADING)};or.processStateMachine=function(e,t,n,i,o,r,s){or.initialize(e,n,i);let a=e.data;if(e.state===aa.LOADING&&vct(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let d=a.terrainState===bo.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let u=a.processImagery(e,n,t);if(d&&u){let h=e._loadedCallbacks,p={};for(let g in h)h.hasOwnProperty(g)&&(h[g](e)||(p[g]=h[g]));e._loadedCallbacks=p,e.state=aa.DONE}c&&(e.renderable=!0)};or.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,d,u;for(d=0,u=c.length;d<u;++d){let h=c[d];if(!l(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===qn.PLACEHOLDER){let g=h.loadingImagery.imageryLayer;if(g.ready){h.freeResources(),c.splice(d,1),g._createTileImagerySkeletons(e,t,d),--d,u=c.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);a=a&&p,s=s||p||l(h.readyImagery),r=r&&l(h.loadingImagery)&&(h.loadingImagery.state===qn.FAILED||h.loadingImagery.state===qn.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function Gye(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=lc.clone(s);c.hasGeodeticSurfaceNormals=t,c=lc.clone(c);let d=c.stride,u=new Float32Array(a*d);t?s.addGeodeticSurfaceNormals(r,u,n):s.removeGeodeticSurfaceNormals(r,u),o.vertices=u,o.stride=d,o!==e.mesh?(or._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=or._createVertexArrayForMesh(i.context,o)):(or._freeVertexArray(e.vertexArray),e.vertexArray=or._createVertexArrayForMesh(i.context,o)),or._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}or.prototype.addGeodeticSurfaceNormals=function(e,t){Gye(this,!0,e,t)};or.prototype.removeGeodeticSurfaceNormals=function(e){Gye(this,!1,void 0,e)};or.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,d=c.exaggeration!==r,u=c.exaggerationRelativeHeight!==s;if(d||u){if(d)if(a&&!c.hasGeodeticSurfaceNormals){let h=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(h,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let h=e.customData,p=h.length;for(let g=0;g<p;g++){let f=h[g];f.level=-1}}}};function Pct(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=bo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function vct(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===bo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||or.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===bo.FAILED&&wct(s,e,t,n,e.x,e.y,e.level),s.terrainState===bo.UNLOADED&&Fct(s,n,e.x,e.y,e.level),s.terrainState===bo.RECEIVED&&Mct(s,t,n,e.x,e.y,e.level),s.terrainState===bo.TRANSFORMED&&(Nct(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=bo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Uct(t.context,s);else{let d=s._findAncestorTileWithTerrainData(e);l(d)&&l(d.data.waterMaskTexture)&&(s.waterMaskTexture=d.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,d,s.waterMaskTranslationAndScale))}}function wct(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=aa.FAILED;return}let c=a.data.terrainData,d=a.x,u=a.y,h=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,d,u,h,o,r,s);l(p)&&(e.terrainState=bo.RECEIVING,Promise.resolve(p).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=bo.RECEIVED)}).catch(function(){e.terrainState=bo.FAILED}))}function Fct(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=bo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=bo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===$n.CANCELLED){e.terrainData=void 0,e.terrainState=bo.UNLOADED,e.request=void 0;return}e.terrainState=bo.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Lo.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new Ho({throttle:!1,throttleByServer:!0,type:hs.TERRAIN});e.request=c;let d=t.requestTileGeometry(n,i,o,c);l(d)?(e.terrainState=bo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=bo.UNLOADED,e.request=void 0)}a()}var Act={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Mct(e,t,n,i,o,r){let s=n.tilingScheme,a=Act;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let d=e.terrainData.createMesh(a);l(d)&&(e.terrainState=bo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=bo.TRANSFORMED}).catch(function(){e.terrainState=bo.FAILED}))}or._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=Ct.createVertexBuffer({context:e,typedArray:n,usage:ke.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=Ct.createIndexBuffer({context:e,typedArray:a,usage:ke.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new oi({context:e,attributes:o,indexBuffer:s})};or._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 Nct(e,t,n,i,o,r,s){e.vertexArray=or._createVertexArrayForMesh(t,e.mesh),e.terrainState=bo.READY,e.fill=e.fill&&e.fill.destroy(s)}function kct(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=vt.create({context:e,pixelFormat:ot.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new tn({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:en.LINEAR,magnificationFilter:fi.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Uct(e,t){let n=t.terrainData.waterMask,i=kct(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=vt.create({context:e,pixelFormat:ot.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,re.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}or.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};or.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var cm=or;var qWi=_(T(),1);var $Xi=_(T(),1);var zXi=_(T(),1);var yEi=_(T(),1);var PGi=_(T(),1);var r8,Eye="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmQHrJmkly5GMmeyeds7qlqGckHbEMszNoB_aHL967jpcpMFlqzgl75smE9bSxUFgvbMH9RZ-1bNm94gP0mBkZCj49YnVLAsh3PgcdtfgQwNxkZdUV2dz75e_dsw_O0bYHnpqlqyefjc7B5QgSv6ClYuonoi55ZvXmrydipr6sBClFcIjCyO89XNoxG1N4yuLS0.AT1_EEoMffUB",eL={};eL.defaultAccessToken=Eye;eL.defaultWorldImageryServer=new Re({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});eL.defaultWorldHillshadeServer=new Re({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});eL.defaultWorldOceanServer=new Re({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});eL.getDefaultTokenCredit=function(e){if(e===Eye){if(!l(r8)){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>';r8=new Gt(t,!0)}return r8}};var $d=eL;var NGi=_(T(),1);function s8(e){e=e??Y.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Re.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Cm(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,d=e.pixelsToCheck;for(let u=0,h=d.length;a&&u<h;++u){let p=d[u],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}s8.prototype.isReady=function(){return this._isReady};s8.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=Cm(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let d=0;d<4;++d){let u=c+d;if(i[u]!==n[u])return!1}}return!0};var Kw=s8;var DGi=_(T(),1);function a8(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}a8.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])};a8.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 Ah=a8;var KGi=_(T(),1);function tL(){fe.throwInstantiationError()}Object.defineProperties(tL.prototype,{rectangle:{get:fe.throwInstantiationError},tileWidth:{get:fe.throwInstantiationError},tileHeight:{get:fe.throwInstantiationError},maximumLevel:{get:fe.throwInstantiationError},minimumLevel:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},tileDiscardPolicy:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},proxy:{get:fe.throwInstantiationError},hasAlphaChannel:{get:fe.throwInstantiationError}});tL.prototype.getTileCredits=function(e,t,n){fe.throwInstantiationError()};tL.prototype.requestImage=function(e,t,n,i){fe.throwInstantiationError()};tL.prototype.pickFeatures=function(e,t,n,i,o){fe.throwInstantiationError()};var Dct=/\.ktx2$/i;tL.loadImage=function(e,t){let n=Re.createIfNeeded(t);return Dct.test(n.url)?Ll(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var bl=tL;var QGi=_(T(),1),Oct={SATELLITE:1,OCEANS:2,HILLSHADE:3},Mh=Object.freeze(Oct);function Iye(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Ki({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Gt(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}Iye.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 Kw({missingImageUrl:Xye(e,0,0,this.maximumLevel).url,pixelsToCheck:[new U(0,0),new U(200,20),new U(20,200),new U(80,110),new U(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Bct(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 ts({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Ki({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ce(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 Pi,o=e.fullExtent,r=i.unproject(new m(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new le(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=le.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 ce(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Gt(e.copyrightText)]:t.credit=new Gt(e.copyrightText))}function Yct(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new ce(n)}async function zct(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Bct(i,t)}catch(i){Yct(e,i)}}function qf(e){e=e??Y.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Ki({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new Gt(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new be}qf.fromBasemapType=async function(e,t){t=t??Y.EMPTY_OBJECT;let n,i,o;switch(e){case Mh.SATELLITE:{n=t.token??$d.defaultAccessToken,i=Re.createIfNeeded($d.defaultWorldImageryServer),i.appendForwardSlash();let r=$d.getDefaultTokenCredit(n);l(r)&&(o=Gt.clone(r))}break;case Mh.OCEANS:{n=t.token??$d.defaultAccessToken,i=Re.createIfNeeded($d.defaultWorldOceanServer),i.appendForwardSlash();let r=$d.getDefaultTokenCredit(n);l(r)&&(o=Gt.clone(r))}break;case Mh.HILLSHADE:{n=t.token??$d.defaultAccessToken,i=Re.createIfNeeded($d.defaultWorldHillshadeServer),i.appendForwardSlash();let r=$d.getDefaultTokenCredit(n);l(r)&&(o=Gt.clone(r))}break;default:}return qf.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Xye(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Ii?(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(qf.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}}});qf.fromUrl=async function(e,t){t=t??Y.EMPTY_OBJECT;let n=Re.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new qf(t);i._resource=n;let o=new Iye(t);return(t.usePreCachedTilesIfAvailable??!0)&&await zct(n,o),o.build(i),i};qf.prototype.getTileCredits=function(e,t,n){return this._tileCredits};qf.prototype.requestImage=function(e,t,n,i){return bl.loadImage(this,Xye(this,e,t,n,i))};qf.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ii)s=X.toDegrees(i),a=X.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,c="3857"}let d="visible";l(this._layers)&&(d+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let g=[],f=p.results;if(!l(f))return g;for(let y=0;y<f.length;++y){let x=f[y],S=new Ah;if(S.data=x,S.name=x.value,S.properties=x.attributes,S.configureDescriptionFromProperties(x.attributes),x.geometryType==="esriGeometryPoint"&&x.geometry){let C=x.geometry.spatialReference&&x.geometry.spatialReference.wkid?x.geometry.spatialReference.wkid:4326;if(C===4326||C===4283)S.position=he.fromDegrees(x.geometry.x,x.geometry.y,x.geometry.z);else if(C===102100||C===900913||C===3857){let V=new Pi;S.position=V.unproject(new m(x.geometry.x,x.geometry.y,x.geometry.z))}}g.push(S)}return g})};qf._metadataCache={};var m0=qf;var NEi=_(T(),1);var _Ei=_(T(),1),Hct={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"},nL=Object.freeze(Hct);var CEi=_(T(),1);function Jw(e){}Jw.prototype.isReady=function(){return!0};Jw.prototype.shouldDiscardImage=function(e){return Jw.EMPTY_IMAGE===e};var JD;Object.defineProperties(Jw,{EMPTY_IMAGE:{get:function(){return l(JD)||(JD=new Image,JD.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),JD}}});var iL=Jw;function Wye(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}Wye.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 Gt)break;o.credit=new Gt(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],d=c.bbox;c.bbox=new le(X.toRadians(d[1]),X.toRadians(d[0]),X.toRadians(d[3]),X.toRadians(d[2]))}}};function Kct(e,t){if(e.resourceSets.length!==1)throw new ce("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 Jct(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Lo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ce(i)}async function Qct(e,t,n){let i=e.url,o=ks._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),ks._metadataCache[i]=o);try{let r=await o;return Kct(r,t)}catch(r){Jct(e,r,n)}}function ks(e){e=e??Y.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??nL.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new iL),this._proxy=e.proxy,this._credit=new Gt(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${ks.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new ts({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 be}Object.defineProperties(ks.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)}}});ks.fromUrl=async function(e,t){t=t??Y.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??nL.AERIAL,o=Re.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new ks(t);a._resource=o;let c=new Wye(t);return await Qct(s,c),c.build(a),a};var jct=new le;ks.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,jct);return elt(this._attributionList,n,i)};ks.prototype.requestImage=function(e,t,n,i){let o=bl.loadImage(this,qct(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?iL.EMPTY_IMAGE:Promise.reject(r)})};ks.prototype.pickFeatures=function(e,t,n,i,o){};ks.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;(e&r)!==0&&(s|=1),(t&r)!==0&&(s|=2),i+=s}return i};ks.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];(s&1)!==0&&(t|=r),(s&2)!==0&&(n|=r)}return{x:t,y:n,level:i}};ks._logoUrl=void 0;Object.defineProperties(ks,{logoUrl:{get:function(){return l(ks._logoUrl)||(ks._logoUrl=sn("Assets/Images/bing_maps_credit.png")),ks._logoUrl},set:function(e){ks._logoUrl=e}}});function qct(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:ks.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var $ct=new le;function elt(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let d=0,u=s.coverageAreas.length;!c&&d<u;++d){let h=a[d];if(t>=h.zoomMin&&t<=h.zoomMax){let p=le.intersection(n,h.bbox,$ct);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ks._metadataCache={};var Qw=ks;var bIi=_(T(),1);var tIi=_(T(),1);var Pye=/{[^}]+}/g,vye={x:olt,y:slt,z:llt,s:dlt,reverseX:rlt,reverseY:alt,reverseZ:clt,westDegrees:ult,southDegrees:mlt,eastDegrees:hlt,northDegrees:flt,westProjected:plt,southProjected:blt,eastProjected:glt,northProjected:ylt,width:xlt,height:_lt},tlt=Rt(vye,{i:Tlt,j:Slt,reverseI:Clt,reverseJ:Vlt,longitudeDegrees:Rlt,latitudeDegrees:Zlt,longitudeProjected:Glt,latitudeProjected:Elt,format:Xlt});function jw(e){e=e??Y.EMPTY_OBJECT,this._errorEvent=new be;let t=Re.createIfNeeded(e.url),n=Re.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 ts({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=le.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Gt(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=Rt(vye,r),a=Rt(tlt,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=e.enablePickFeatures??!0}Object.defineProperties(jw.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}}});jw.prototype.getTileCredits=function(e,t,n){};jw.prototype.requestImage=function(e,t,n,i){return bl.loadImage(this,nlt(this,e,t,n,i))};jw.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=ilt(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(c):d.type==="xml"?u.fetchXML().then(d.callback).catch(c):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(c):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(c)}return c()};var QD=!1,eu=new le,jD=!1,qw=new le;function nlt(e,t,n,i,o){QD=!1,jD=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(Pye);return l(d)&&d.forEach(function(u){let h=u.substring(1,u.length-1);l(a[h])&&(c[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var c8=!1,rL=new U,l8=!1;function ilt(e,t,n,i,o,r,s){QD=!1,jD=!1,c8=!1,l8=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},h=c.match(Pye);return l(h)&&h.forEach(function(p){let g=p.substring(1,p.length-1);l(d[g])&&(u[g]=d[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function sL(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 olt(e,t,n,i){return sL(e,"{x}",t)}function rlt(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return sL(e,"{reverseX}",o)}function slt(e,t,n,i){return sL(e,"{y}",n)}function alt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return sL(e,"{reverseY}",o)}function clt(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return sL(e,"{reverseZ}",r)}function llt(e,t,n,i){return sL(e,"{z}",i)}function dlt(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function qD(e,t,n,i){QD||(e.tilingScheme.tileXYToRectangle(t,n,i,eu),eu.west=X.toDegrees(eu.west),eu.south=X.toDegrees(eu.south),eu.east=X.toDegrees(eu.east),eu.north=X.toDegrees(eu.north),QD=!0)}function ult(e,t,n,i){return qD(e,t,n,i),eu.west}function mlt(e,t,n,i){return qD(e,t,n,i),eu.south}function hlt(e,t,n,i){return qD(e,t,n,i),eu.east}function flt(e,t,n,i){return qD(e,t,n,i),eu.north}function $D(e,t,n,i){jD||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,qw),jD=!0)}function plt(e,t,n,i){return $D(e,t,n,i),qw.west}function blt(e,t,n,i){return $D(e,t,n,i),qw.south}function glt(e,t,n,i){return $D(e,t,n,i),qw.east}function ylt(e,t,n,i){return $D(e,t,n,i),qw.north}function xlt(e,t,n,i){return e.tileWidth}function _lt(e,t,n,i){return e.tileHeight}function Tlt(e,t,n,i,o,r,s){return eO(e,t,n,i,o,r),rL.x}function Slt(e,t,n,i,o,r,s){return eO(e,t,n,i,o,r),rL.y}function Clt(e,t,n,i,o,r,s){return eO(e,t,n,i,o,r),e.tileWidth-rL.x-1}function Vlt(e,t,n,i,o,r,s){return eO(e,t,n,i,o,r),e.tileHeight-rL.y-1}var Llt=new le,oL=new m;function eO(e,t,n,i,o,r,s){if(c8)return;d8(e,t,n,i,o,r);let a=oL,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Llt);rL.x=e.tileWidth*(a.x-c.west)/c.width|0,rL.y=e.tileHeight*(c.north-a.y)/c.height|0,c8=!0}function Rlt(e,t,n,i,o,r,s){return X.toDegrees(o)}function Zlt(e,t,n,i,o,r,s){return X.toDegrees(r)}function Glt(e,t,n,i,o,r,s){return d8(e,t,n,i,o,r),oL.x}function Elt(e,t,n,i,o,r,s){return d8(e,t,n,i,o,r),oL.y}var Ilt=new he;function d8(e,t,n,i,o,r,s){if(!l8){if(e.tilingScheme.projection instanceof Ii)oL.x=X.toDegrees(o),oL.y=X.toDegrees(r);else{let a=Ilt;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,oL)}l8=!0}}function Xlt(e,t,n,i,o,r,s){return s}var Ka=jw;function lm(e){Ka.call(this,e)}lm._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return lm._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof qh)return lm._metadataFailure(e,t);throw o}};lm.fromUrl=async function(e,t){let n=Re.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??Y.EMPTY_OBJECT;let r=await lm._requestMetadata(t,i,o);return new lm(r)};l(Object.create)&&(lm.prototype=Object.create(Ka.prototype),lm.prototype.constructor=lm);function wye(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 Fye(e,t,n){let i=e.positionToTileXY(le.southwest(t),n),o=e.positionToTileXY(le.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}lm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,h,p=[],g=e.childNodes[0].childNodes;for(let W=0;W<g.length;W++)if(r.test(g.item(W).nodeName))d=g.item(W);else if(a.test(g.item(W).nodeName)){h=g.item(W);let v=g.item(W).childNodes;for(let A=0;A<v.length;A++)s.test(v.item(A).nodeName)&&p.push(v.item(A))}else c.test(g.item(W).nodeName)&&(u=g.item(W));let f;if(!l(h)||!l(u))throw f=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Lo.reportError(void 0,o,o.errorEvent,f),new ce(f);let y=t.fileExtension??d.getAttribute("extension"),x=t.tileWidth??parseInt(d.getAttribute("width"),10),S=t.tileHeight??parseInt(d.getAttribute("height"),10),C=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),V=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),L=h.getAttribute("profile"),Z=t.tilingScheme;if(!l(Z))if(L==="geodetic"||L==="global-geodetic")Z=new Ki({ellipsoid:t.ellipsoid});else if(L==="mercator"||L==="global-mercator")Z=new ts({ellipsoid:t.ellipsoid});else throw f=`${i.url} specifies an unsupported profile attribute, ${L}.`,l(o)&&Lo.reportError(void 0,o,o.errorEvent,f),new ce(f);let E=le.clone(t.rectangle);if(!l(E)){let W,v,A,b;t.flipXY??!1?(A=new U(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),b=new U(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(A=new U(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),b=new U(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let G=L==="geodetic"||L==="mercator";if(Z.projection instanceof Ii||G)W=he.fromDegrees(A.x,A.y),v=he.fromDegrees(b.x,b.y);else{let I=Z.projection;W=I.unproject(A),v=I.unproject(b)}E=new le(W.longitude,W.latitude,v.longitude,v.latitude)}return E=wye(E,Z),C=Fye(Z,E,C),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:Z,rectangle:E,tileWidth:x,tileHeight:S,minimumLevel:C,maximumLevel:V,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};lm._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new ts({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=wye(a,s);let c=Fye(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var wy=lm;var EIi=_(T(),1);function Aye(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Aye.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Wlt(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 ce(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ce(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new le(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new ts({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ce(o)}return!0}function Plt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Lo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ce(i)}async function vlt(e,t,n){try{let i=await e.fetchText();Wlt(i,t)}catch(i){Plt(i,e,n)}}function $l(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 Gt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${$l.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 be}Object.defineProperties($l.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}}});$l.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=Re.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new Aye(n);s.channel=t,await vlt(r,s);let a=new $l(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};$l.prototype.getTileCredits=function(e,t,n){};$l.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 bl.loadImage(this,o)};$l.prototype.pickFeatures=function(e,t,n,i,o){};$l._logoUrl=void 0;Object.defineProperties($l,{logoUrl:{get:function(){return l($l._logoUrl)||($l._logoUrl=sn("Assets/Images/google_earth_credit.png")),$l._logoUrl},set:function(e){$l._logoUrl=e}}});var $w=$l;var FIi=_(T(),1);var wlt=/\/$/,Mye=new Gt('© <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 aL(e){e=e??Y.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=Re.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();wlt.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Gt(s))):s=Mye,this._resource=i,this._imageryProvider=new Ka({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(aL.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}}});aL.prototype.getTileCredits=function(e,t,n){};aL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};aL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};aL._defaultCredit=Mye;var eF=aL;var KIi=_(T(),1);function jT(e){e=e??Y.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??le.MAX_VALUE,n=new Ki({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new be;let i=e.credit;typeof i=="string"&&(i=new Gt(i)),this._credit=i;let o=Re.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(jT.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 Flt(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Lo.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return u8(e,n,r);throw l(n)&&(n._hasError=!0),new ce(o)}async function u8(e,t,n){try{return await bl.loadImage(null,e)}catch(i){return Flt(e,i,t,n)}}jT.fromUrl=async function(e,t){let n=Re.createIfNeeded(e),i=await u8(n);t=t??Y.EMPTY_OBJECT;let o=new jT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};jT.prototype.getTileCredits=function(e,t,n){};jT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await u8(this._resource,this);return this._image=o,Lo.reportSuccess(this._errorEvent),o}return this._image};jT.prototype.pickFeatures=function(e,t,n,i,o){};var tF=jT;var yXi=_(T(),1);var eXi=_(T(),1);function Alt(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=Mlt:e==="xml"?n=Dlt:(e==="html"||e==="text")&&(n=Nye)),this.callback=n}function Mlt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Ah;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=he.fromDegrees(s,a)}t.push(r)}return t}var m8="http://www.mapinfo.com/mxp",Nlt="http://www.esri.com/wms",klt="http://www.opengis.net/wfs",Ult="http://www.opengis.net/gml";function Dlt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===m8)return Olt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Nlt)return Blt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===klt)return Ylt(e);if(t.localName==="ServiceExceptionReport")throw new ce(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?zlt(e):Hlt(e)}function Olt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(m8,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(m8,"Val");for(let d=0;d<a.length;++d){let u=a[d];if(u.hasAttribute("ref")){let h=u.getAttribute("ref"),p=u.textContent.trim();s[h]=p}}let c=new Ah;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Blt(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let d=a[c];i[d.name]=d.value}n.push(tO(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let d=0;d<c.length;++d){let u=c[d];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push(tO(a,i))}}return n}function Ylt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Ult,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};h8(r,s),t.push(tO(r,s))}return t}function zlt(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 ce("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};h8(s,a),t.push(tO(s,a))}}return t}function h8(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()&&h8(o,t)&&(t[o.localName]=o.textContent)}return n}function tO(e,t){let n=new Ah;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Hlt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Ah;return o.data=e,o.description=n.innerHTML,[o]}var Klt=/<body>\s*<\/body>/im,Jlt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Qlt=/<title>([\s\S]*)<\/title>/im;function Nye(e){if(Klt.test(e)||Jlt.test(e))return;let t,n=Qlt.exec(e);n&&n.length>1&&(t=n[1]);let i=new Ah;return i.name=t,i.description=e,i.data=e,[i]}var qT=Alt;var aXi=_(T(),1);function nF(e){e=e??Y.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(nF.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)}}});nF.prototype.getFromCache=function(e,t,n,i){let o=kye(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};nF.prototype.checkApproachingInterval=function(e,t,n,i){let o=kye(e,t,n),r=this._tilesRequestedForInterval,s=Uye(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!Dye(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};nF.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=Uye(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=Dye(this,c,r),a||s.push(c)}}};function kye(e,t,n){return`${e}-${t}-${n}`}function jlt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Uye(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=q.secondsDifference(c.stop,i),++a):(s=q.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function Dye(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=jlt(s),c=new Ho({throttle:!1,throttleByServer:!0,type:hs.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(d)?(r[s]={promise:d,request:c},!0):!1}var $T=nF;var qlt=[3034,3035,3042,3043,3044],$lt=[4471,4559];function Nh(e){if(e=e??Y.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new fe("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=Re.createIfNeeded(e.url),n=Re.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Nh.DefaultParameters,!0),n.setQueryParameters(Nh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Oye(e.parameters,e.toLowerCase)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Oye(e.getFeatureInfoParameters,e.toLowerCase));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new $T({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return Bye(i,s,a,c,d,u)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof Pi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!$lt.includes(a)||qlt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Pi?"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 Ka({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Ki({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Nh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function Bye(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function edt(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(Nh.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}}});Nh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Nh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Bye(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Nh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return edt(this,e,t,n,i,o,s)};Nh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Nh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Nh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new qT("json","application/json")),Object.freeze(new qT("xml","text/xml")),Object.freeze(new qT("text","text/html"))]);function Oye(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 iF=Nh;var IXi=_(T(),1);var tdt=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function oF(e){e=e??Y.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=Re.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(tdt),this._useKvp=!0;else{let h={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(h),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=e.format??"image/jpeg",this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new ts({ellipsoid:e.ellipsoid}),this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new $T({clock:e.clock,times:e.times,requestImageFunction:function(h,p,g,f,y){return Yye(s,h,p,g,f,y)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(le.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(le.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new be;let u=e.credit;this._credit=typeof u=="string"?new Gt(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function Yye(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,d=e._dimensions,u=l(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),l(d)&&h.setTemplateValues(d),l(u)&&h.setTemplateValues(u);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(d)&&(g=Rt(g,d)),l(u)&&(g=Rt(g,u)),p={s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({queryParameters:g,request:o}),h.setTemplateValues(p)}return bl.loadImage(e,h)}Object.defineProperties(oF.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}}});oF.prototype.getTileCredits=function(e,t,n){};oF.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Yye(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};oF.prototype.pickFeatures=function(e,t,n,i,o){};var rF=oF;var ndt={ARCGIS_MAPSERVER:m0.fromUrl,BING:async(e,t)=>Qw.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,$w.fromUrl(e,n,t)},MAPBOX:(e,t)=>new eF({url:e,...t}),SINGLE_TILE:tF.fromUrl,TMS:wy.fromUrl,URL_TEMPLATE:(e,t)=>new Ka({url:e,...t}),WMS:(e,t)=>new iF({url:e,...t}),WMTS:(e,t)=>new rF({url:e,...t})};function $f(e){e=e??Y.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 be}Object.defineProperties($f.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(){}}});$f.fromAssetId=async function(e,t){t=t??Y.EMPTY_OBJECT;let n=hd._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=$f._endpointCache[i];l(o)||(o=n.fetchJson(),$f._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ce(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await wy.fromUrl(new hd(r,n));else{let d=ndt[a];if(!l(d))throw new ce(`Unrecognized Cesium ion imagery type: ${a}`);let u={...r.options},h=u.url;delete u.url,s=await d(h,u)}let c=new $f(t);return s.errorEvent.addEventListener(function(d){d.provider=c,c._errorEvent.raiseEvent(d)}),c._tileCredits=hd.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};$f.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};$f.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};$f.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};$f._endpointCache={};var h0=$f;var KXi=_(T(),1),idt={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},f0=Object.freeze(idt);function odt(e){e=e??Y.EMPTY_OBJECT;let t=e.style??f0.AERIAL;return h0.fromAssetId(t)}var p0=odt;var tWi=_(T(),1),sF=`uniform sampler2D u_texture;
|
|
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
out_FragColor = texture(u_texture, v_textureCoordinates);
|
|
|
}
|
|
|
`;var iWi=_(T(),1),aF=`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 cWi=_(T(),1);function cL(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=qn.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}cL.createPlaceholder=function(e){let t=new cL(e,0,0,0);return t.addReference(),t.state=qn.PLACEHOLDER,t};cL.prototype.addReference=function(){++this.referenceCount};cL.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(),me(this),0):this.referenceCount};cL.prototype.processStateMachine=function(e,t,n){this.state===qn.UNLOADED&&!n&&(this.state=qn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===qn.RECEIVED&&(this.state=qn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===qn.READY&&t&&!this.texture;(this.state===qn.TEXTURE_LOADED||i)&&(this.state=qn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var lL=cL;var mWi=_(T(),1);function f8(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}f8.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};f8.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===qn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==qn.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==qn.FAILED&&r.state!==qn.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===qn.FAILED||i.state===qn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var dL=f8;function Si(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=t??Y.EMPTY_OBJECT,e=e??Y.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Si.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Si.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Si.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Si.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Si.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Si.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Si.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Si.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??le.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new dL(lL.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=t.colorToAlphaThreshold??Si.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD,this._marsOptions=t.marsOptions??{},this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(Si.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}}});Si.DEFAULT_BRIGHTNESS=1;Si.DEFAULT_CONTRAST=1;Si.DEFAULT_HUE=0;Si.DEFAULT_SATURATION=1;Si.DEFAULT_GAMMA=1;Si.DEFAULT_SPLIT=Br.NONE;Si.DEFAULT_MINIFICATION_FILTER=en.LINEAR;Si.DEFAULT_MAGNIFICATION_FILTER=fi.LINEAR;Si.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Si.fromProviderAsync=function(e,t){let n=new Si(void 0,t);return ldt(n,Promise.resolve(e)),n};Si.fromWorldImagery=function(e){return e=e??Y.EMPTY_OBJECT,Si.fromProviderAsync(p0({style:e.style}),e)};Si.prototype.isBaseLayer=function(){return this._isBaseLayer};Si.prototype.isDestroyed=function(){return!1};Si.prototype.destroy=function(){return me(this)};var Kye=new le,zye=new le,p8=new le,Jye=new le;Si.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return le.intersection(e.rectangle,t)};Si.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 Pi&&e.rectangle.north<Pi.MaximumLatitude&&e.rectangle.south>-Pi.MaximumLatitude,s=le.intersection(o.rectangle,this._rectangle,Kye),a=le.intersection(e.rectangle,s,zye);if(!l(a)){if(!this.isBaseLayer())return!1;let G=s,I=e.rectangle;a=zye,I.south>=G.north?a.north=a.south=G.north:I.north<=G.south?a.north=a.south=G.south:(a.south=Math.max(I.south,G.south),a.north=Math.min(I.north,G.north)),I.west>=G.east?a.west=a.east=G.east:I.east<=G.west?a.west=a.east=G.west:(a.west=Math.max(I.west,G.west),a.east=Math.min(I.east,G.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),h=adt(this,u,c);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),l(o.minimumLevel)){let G=o.minimumLevel;h<G&&(h=G)}let g=o.tilingScheme,f=g.positionToTileXY(le.northwest(a),h),y=g.positionToTileXY(le.southeast(a),h),x=e.rectangle.width/512,S=e.rectangle.height/512,C=g.tileXYToRectangle(f.x,f.y,h);Math.abs(C.south-e.rectangle.north)<S&&f.y<y.y&&++f.y,Math.abs(C.east-e.rectangle.west)<x&&f.x<y.x&&++f.x;let V=g.tileXYToRectangle(y.x,y.y,h);Math.abs(V.north-e.rectangle.south)<S&&y.y>f.y&&--y.y,Math.abs(V.west-e.rectangle.east)<x&&y.x>f.x&&--y.x;let L=le.clone(e.rectangle,Jye),Z=g.tileXYToRectangle(f.x,f.y,h),E=le.intersection(Z,s,p8),P;r?(g.rectangleToNativeRectangle(L,L),g.rectangleToNativeRectangle(Z,Z),g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(s,s),P=g.tileXYToNativeRectangle.bind(g),x=L.width/512,S=L.height/512):P=g.tileXYToRectangle.bind(g);let W,v=0,A=1,b;!this.isBaseLayer()&&Math.abs(E.west-L.west)>=x&&(v=Math.min(1,(E.west-L.west)/L.width)),!this.isBaseLayer()&&Math.abs(E.north-L.north)>=S&&(A=Math.max(0,(E.north-L.south)/L.height));let R=A;for(let G=f.x;G<=y.x;G++)if(W=v,Z=P(G,f.y,h),E=le.simpleIntersection(Z,s,p8),!!l(E)){v=Math.min(1,(E.east-L.west)/L.width),G===y.x&&(this.isBaseLayer()||Math.abs(E.east-L.east)<x)&&(v=1),A=R;for(let I=f.y;I<=y.y;I++){if(b=A,Z=P(G,I,h),E=le.simpleIntersection(Z,s,p8),!l(E))continue;A=Math.max(0,(E.south-L.south)/L.height),I===y.y&&(this.isBaseLayer()||Math.abs(E.south-L.south)<S)&&(A=0);let w=new re(W,A,v,b),M=this.getImageryFromCache(G,I,h);i.imagery.splice(n,0,new dL(M,w,r)),++n}}return!0};Si.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,Kye),i=c.rectangleToNativeRectangle(i,Jye)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new re(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Si.prototype._requestImagery=function(e){if(l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return e.state=qn.FAILED,e.request=void 0,!1;if(l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return e.state=qn.FAILED,e.request=void 0,!1;let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=qn.RECEIVED,e.request=void 0,Lo.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function o(s){if(e.request.state===$n.CANCELLED){e.state=qn.UNLOADED,e.request=void 0;return}e.state=qn.FAILED,e.request=void 0;let a=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 x:${e.x},y: ${e.y},z:${e.level}. `;t._resource&&t._resource._last_url&&(a+=t._resource._last_url),n._requestImageError=Lo.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function r(){let s=new Ho({throttle:!1,throttleByServer:!0,type:hs.IMAGERY});e.request=s,e.state=qn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=qn.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),a.then?a.then(function(c){i(c)}).catch(function(c){o(c)}):i(a)}r()};Si.prototype._createTextureWebGL=function(e,t){let n=new tn({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?ot.RGBA:ot.RGB,sampler:n})};Si.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=qn.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=qn.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Pi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=qn.TEXTURE_LOADED};function Hye(e,t,n){return`${e}:${t}:${n}`}Si.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===en.LINEAR&&i===fi.LINEAR&&!ot.isCompressedFormat(t.pixelFormat)&&X.isPowerOfTwo(t.width)&&X.isPowerOfTwo(t.height)){n=en.LINEAR_MIPMAP_LINEAR;let r=Dt.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=Hye(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new tn({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(af.NICEST),t.sampler=d}else{let r=Hye(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new tn({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Si.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof Ii)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Fc({persists:!0,owner:this,preExecute:function(c){sdt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=qn.READY,t.releaseReference()},canceled:function(){t.state=qn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=qn.READY};Si.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Si.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Si.prototype.getImageryFromCache=function(e,t,n,i){let o=Qye(e,t,n),r=this._imageryCache[o];return l(r)||(r=new lL(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Si.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=Qye(e.x,e.y,e.level);delete this._imageryCache[t]};function Qye(e,t,n){return JSON.stringify([e,t,n])}var nO={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},rdt=Ht.supportsTypedArrays()?new Float32Array(2*64):void 0;function sdt(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 x=new Float32Array(2*64*2),S=0;for(let E=0;E<64;++E){let P=E/63;x[S++]=0,x[S++]=P,x[S++]=1,x[S++]=P}let C={position:0,webMercatorT:1},V=es.getRegularGridIndices(2,64),L=Ct.createIndexBuffer({context:t,typedArray:V,usage:ke.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});o.vertexArray=new oi({context:t,attributes:[{index:C.position,vertexBuffer:Ct.createVertexBuffer({context:t,typedArray:x,usage:ke.STATIC_DRAW}),componentsPerAttribute:2},{index:C.webMercatorT,vertexBuffer:Ct.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:ke.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:L});let Z=new De({sources:[aF]});o.shaderProgram=nn.fromCache({context:t,vertexShaderSource:Z,fragmentShaderSource:sF,attributeLocations:C}),o.sampler=new tn({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:en.LINEAR,magnificationFilter:fi.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;nO.textureDimensions.x=r,nO.textureDimensions.y=s,nO.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-c),h=new vt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});X.isPowerOfTwo(r)&&X.isPowerOfTwo(s)&&h.generateMipmap(af.NICEST);let p=i.south,g=i.north,f=rdt,y=0;for(let x=0;x<64;++x){let S=x/63,C=X.lerp(p,g,S);a=Math.sin(C);let L=(.5*Math.log((1+a)/(1-a))-c)*u;f[y++]=L,f[y++]=L}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=nO,e.vertexArray=o.vertexArray}function adt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ii?1:Math.cos(n),a=o.rectangle,d=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(d)/Math.log(2);return Math.round(u)|0}function cdt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function ldt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){cdt(e._errorEvent,i)}}var Ja=Si;var SPi=_(T(),1);var ePi=_(T(),1),jye={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>=jye.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Qn=jye;function mL(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 re}mL.prototype.update=function(e,t,n){this.changedThisFrame&&(oxe(e,t,this.tile,n),this.changedThisFrame=!1)};mL.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};mL.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):cm._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var ddt=new ig;mL.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=ddt;a.clear();for(let d=0;d<t.length;++d){let u=t[d];l(u.data.vertexArray)&&a.enqueue(t[d])}let c=a.dequeue();for(;c!==void 0;){let d=c.findTileToWest(r),u=c.findTileToSouth(r),h=c.findTileToEast(r),p=c.findTileToNorth(r);Us(e,n,c,d,s,_n.EAST,!1,a,i),Us(e,n,c,u,s,_n.NORTH,!1,a,i),Us(e,n,c,h,s,_n.WEST,!1,a,i),Us(e,n,c,p,s,_n.SOUTH,!1,a,i);let g=d.findTileToNorth(r),f=d.findTileToSouth(r),y=h.findTileToNorth(r),x=h.findTileToSouth(r);Us(e,n,c,g,s,_n.SOUTHEAST,!1,a,i),Us(e,n,c,y,s,_n.SOUTHWEST,!1,a,i),Us(e,n,c,f,s,_n.NORTHEAST,!1,a,i),Us(e,n,c,x,s,_n.NORTHWEST,!1,a,i),c=a.dequeue()}};function Us(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||Qn.wasKicked(d._lastSelectionResult)||Qn.originalResult(d._lastSelectionResult)===Qn.CULLED);){if(s)return;let u=d.parent;if(r>=_n.NORTHWEST&&u!==void 0)switch(r){case _n.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case _n.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case _n.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case _n.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===Qn.RENDERED){if(l(d.data.vertexArray))return;udt(e,t,n,d,r,o,a,c);return}if(Qn.originalResult(i._lastSelectionResult)!==Qn.CULLED)switch(r){case _n.WEST:Us(e,t,n,i.northwestChild,o,r,!0,a,c),Us(e,t,n,i.southwestChild,o,r,!0,a,c);break;case _n.EAST:Us(e,t,n,i.southeastChild,o,r,!0,a,c),Us(e,t,n,i.northeastChild,o,r,!0,a,c);break;case _n.SOUTH:Us(e,t,n,i.southwestChild,o,r,!0,a,c),Us(e,t,n,i.southeastChild,o,r,!0,a,c);break;case _n.NORTH:Us(e,t,n,i.northeastChild,o,r,!0,a,c),Us(e,t,n,i.northwestChild,o,r,!0,a,c);break;case _n.NORTHWEST:Us(e,t,n,i.northwestChild,o,r,!0,a,c);break;case _n.NORTHEAST:Us(e,t,n,i.northeastChild,o,r,!0,a,c);break;case _n.SOUTHWEST:Us(e,t,n,i.southwestChild,o,r,!0,a,c);break;case _n.SOUTHEAST:Us(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new fe("Invalid edge")}}}function udt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new mL(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),mdt(e,t,n,i,o,a)}function mdt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(oxe(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case _n.WEST:d=s.westMeshes,u=s.westTiles;break;case _n.SOUTH:d=s.southMeshes,u=s.southTiles;break;case _n.EAST:d=s.eastMeshes,u=s.eastTiles;break;case _n.NORTH:d=s.northMeshes,u=s.northTiles;break;case _n.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case _n.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case _n.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case _n.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||d[0]!==a||d.length!==1,d[0]=a,u[0]=n,d.length=1,u.length=1;return}let h,p,g,f,y=n.rectangle,x,S=i.rectangle;switch(o){case _n.WEST:for(x=(S.north-S.south)*X.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!X.greaterThan(y.north,f.south,x));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!X.greaterThanOrEquals(y.south,f.north,x));++p);break;case _n.SOUTH:for(x=(S.east-S.west)*X.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!X.lessThan(y.west,f.east,x));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!X.lessThanOrEquals(y.east,f.west,x));++p);break;case _n.EAST:for(x=(S.north-S.south)*X.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!X.lessThan(y.south,f.north,x));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!X.lessThanOrEquals(y.north,f.south,x));++p);break;case _n.NORTH:for(x=(S.east-S.west)*X.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!X.greaterThan(y.east,f.west,x));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!X.greaterThanOrEquals(y.west,f.east,x));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||d[h]!==a,d[h]=a,u[h]=n):(s.changedThisFrame=!0,d.splice(h,p-h,a),u.splice(h,p-h,n))}var eS=new he,hdt=new he,uL=new m,x8=new m,b8=new U,g8=new U,tu=new U;function lO(){this.height=0,this.encodedNormal=new U}function iO(e,t,n,i,o,r,s,a,c){if(l(o))return o;let d;if(l(r)&&l(s))d=(r.height+s.height)*.5;else if(l(r))d=r.height;else if(l(s))d=s.height;else if(l(a))d=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,g=0;l(h)&&(p=h.minimumHeight,g=h.maximumHeight),d=(p+g)*.5}return rxe(e,t,n,i,d,c),c}var fdt={minimumHeight:0,maximumHeight:0},pdt=new m,qye=new lO,$ye=new lO,exe=new lO,txe=new lO,bdt=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,gdt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function oxe(e,t,n,i){cm.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,h=rO(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,exe),p=rO(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,qye),g=rO(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,$ye),f=rO(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,txe);h=iO(r,u,0,1,h,p,f,g,exe),p=iO(r,u,0,0,p,h,g,f,qye),g=iO(r,u,1,1,g,p,f,h,$ye),f=iO(r,u,1,1,f,g,h,p,txe);let y=p.height,x=g.height,S=h.height,C=f.height,V=Math.min(y,x,S,C),L=Math.max(y,x,S,C),Z=(V+L)*.5,E,P,W=e.getLevelMaximumGeometricError(n.level),v=u.maximumRadius-W,A=Math.acos(v/u.maximumRadius)*4;if(A*=1.5,s.width>A&&L-V<=W){let G=new Fa({width:9,height:9,buffer:bdt,structure:{heightOffset:L}}),I=gdt;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,r.mesh=G._createMeshSync(I)}else{let G=d,I=le.center(s,hdt);I.height=Z;let w=u.cartographicToCartesian(I,pdt),M=new lc(w,void 0,void 0,void 0,void 0,!0,!0,G,a,c),O=5,k;for(k=r.westMeshes,E=0,P=k.length;E<P;++E)O+=k[E].eastIndicesNorthToSouth.length;for(k=r.southMeshes,E=0,P=k.length;E<P;++E)O+=k[E].northIndicesWestToEast.length;for(k=r.eastMeshes,E=0,P=k.length;E<P;++E)O+=k[E].westIndicesSouthToNorth.length;for(k=r.northMeshes,E=0,P=k.length;E<P;++E)O+=k[E].southIndicesEastToWest.length;let B=fdt;B.minimumHeight=V,B.maximumHeight=L;let N=M.stride,z=new Float32Array(O*N),K=0,te=K;K=oO(u,s,M,z,K,0,1,h.height,h.encodedNormal,1,B),K=aO(r,u,M,z,K,r.westTiles,r.westMeshes,_n.EAST,B);let H=K;K=oO(u,s,M,z,K,0,0,p.height,p.encodedNormal,0,B),K=aO(r,u,M,z,K,r.southTiles,r.southMeshes,_n.NORTH,B);let j=K;K=oO(u,s,M,z,K,1,0,g.height,g.encodedNormal,0,B),K=aO(r,u,M,z,K,r.eastTiles,r.eastMeshes,_n.WEST,B);let ee=K;K=oO(u,s,M,z,K,1,1,f.height,f.encodedNormal,1,B),K=aO(r,u,M,z,K,r.northTiles,r.northMeshes,_n.SOUTH,B),V=B.minimumHeight,L=B.maximumHeight;let pe=Xn.fromRectangle(s,V,L,n.tilingScheme.ellipsoid),_e=Pi.geodeticLatitudeToMercatorAngle(s.south),ae=1/(Pi.geodeticLatitudeToMercatorAngle(s.north)-_e),ye=(Pi.geodeticLatitudeToMercatorAngle(I.latitude)-_e)*ae,Se=u.geodeticSurfaceNormalCartographic(eS,x8),Ee=Fn.octEncode(Se,b8),Ie=K;M.encode(z,K*N,pe.center,U.fromElements(.5,.5,tu),Z,Ee,ye,Se),++K;let Fe=K,ve=Fe<256?1:2,ct=(Fe-1)*3,Je=ct*ve,bt=(z.length-Fe*N)*Float32Array.BYTES_PER_ELEMENT,Qe;if(bt>=Je){let Ce=Fe*N*Float32Array.BYTES_PER_ELEMENT;Qe=Fe<256?new Uint8Array(z.buffer,Ce,ct):new Uint16Array(z.buffer,Ce,ct)}else Qe=Fe<256?new Uint8Array(ct):new Uint16Array(ct);z=new Float32Array(z.buffer,0,Fe*N);let Tt=0;for(E=0;E<Fe-2;++E)Qe[Tt++]=Ie,Qe[Tt++]=E,Qe[Tt++]=E+1;Qe[Tt++]=Ie,Qe[Tt++]=E,Qe[Tt++]=0;let ft=[];for(E=H;E>=te;--E)ft.push(E);let gt=[];for(E=j;E>=H;--E)gt.push(E);let En=[];for(E=ee;E>=j;--E)En.push(E);let cn=[];for(cn.push(0),E=Ie-1;E>=ee;--E)cn.push(E);r.mesh=new Cu(M.center,z,Qe,ct,Fe,V,L,de.fromOrientedBoundingBox(pe),Vdt(e,pe.center,s,V,L),M.stride,pe,M,ft,gt,En,cn)}let b=t.context;r._destroyVertexArray(i),r.vertexArray=cm._createVertexArrayForMesh(b,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let R=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let G=o._findAncestorTileWithTerrainData(n);l(G)&&l(G.data.waterMaskTexture)&&(r.waterMaskTexture=G.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,G,r.waterMaskTranslationAndScale))}l(R)&&(--R.referenceCount,R.referenceCount===0&&R.destroy())}function oO(e,t,n,i,o,r,s,a,c,d,u){let h=eS;h.longitude=X.lerp(t.west,t.east,r),h.latitude=X.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,uL),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,x8));let f=g8;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,g),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var cO=new le;function cF(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=le.clone(e.rectangle,cO),o.west-=X.TWO_PI,o.east-=X.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=le.clone(e.rectangle,cO),o.west+=X.TWO_PI,o.east+=X.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,h=(r.north-o.south)/d,p=(n.x-a)/(c-a),g=(n.y-u)/(h-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var ydt=new U;function y8(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var xdt=new U,_dt=new m;function Tdt(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,h=i.vertices,p=cF(t,n,u.decodeTextureCoordinates(h,o,tu),tu),g=cF(t,n,u.decodeTextureCoordinates(h,r,g8),g8),f;c?f=(s-p.x)/(g.x-p.x):f=(a-p.y)/(g.y-p.y);let y=u.decodeHeight(h,o),x=u.decodeHeight(h,r),S=n.rectangle;eS.longitude=X.lerp(S.west,S.east,s),eS.latitude=X.lerp(S.south,S.north,a),d.height=eS.height=X.lerp(y,x,f);let C;if(u.hasVertexNormals){let V=u.getOctEncodedNormal(h,o,ydt),L=u.getOctEncodedNormal(h,r,xdt),Z=Fn.octDecode(V.x,V.y,uL),E=Fn.octDecode(L.x,L.y,_dt);C=m.lerp(Z,E,f,uL),m.normalize(C,C),Fn.octEncode(C,d.encodedNormal)}else C=e.geodeticSurfaceNormalCartographic(eS,uL),Fn.octEncode(C,d.encodedNormal)}function rxe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(eS,uL);Fn.octEncode(s,r.encodedNormal)}function rO(e,t,n,i,o,r,s,a,c,d,u){if(ixe(e,t,a,s,!1,n,i,u)||ixe(e,t,d,c,!0,n,i,u))return u;let p;if(_8(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],y8(r,p,n,i,u),u;let g;if(n===0?i===0?g=sO(e.westMeshes,e.westTiles,_n.EAST,e.southMeshes,e.southTiles,_n.NORTH,n,i):g=sO(e.northMeshes,e.northTiles,_n.SOUTH,e.westMeshes,e.westTiles,_n.EAST,n,i):i===0?g=sO(e.southMeshes,e.southTiles,_n.NORTH,e.eastMeshes,e.eastTiles,_n.WEST,n,i):g=sO(e.eastMeshes,e.eastTiles,_n.WEST,e.northMeshes,e.northTiles,_n.SOUTH,n,i),l(g))return rxe(e,t,n,i,g,u),u}function sO(e,t,n,i,o,r,s,a){let c=nxe(e,t,!1,n,s,a),d=nxe(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function aO(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=Sdt(e,t,n,i,o,r[d],s[d],a,c);return o}function Sdt(e,t,n,i,o,r,s,a,c){let d=r.rectangle;a===_n.EAST&&e.tile.x===0?(d=le.clone(r.rectangle,cO),d.west-=X.TWO_PI,d.east-=X.TWO_PI):a===_n.WEST&&r.x===0&&(d=le.clone(r.rectangle,cO),d.west+=X.TWO_PI,d.east+=X.TWO_PI);let u=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,tu),h=tu.x,p=tu.y);let g,f;switch(a){case _n.WEST:g=s.westIndicesSouthToNorth,f=!1;break;case _n.NORTH:g=s.northIndicesWestToEast,f=!0;break;case _n.EAST:g=s.eastIndicesNorthToSouth,f=!1;break;case _n.SOUTH:g=s.southIndicesEastToWest,f=!0;break}let y=r,x=e.tile,S=s.encoding,C=s.vertices,V=n.stride,L,Z;S.hasWebMercatorT&&(L=Pi.geodeticLatitudeToMercatorAngle(u.south),Z=1/(Pi.geodeticLatitudeToMercatorAngle(u.north)-L));for(let E=0;E<g.length;++E){let P=g[E],W=S.decodeTextureCoordinates(C,P,tu);cF(y,x,W,W);let v=W.x,A=W.y,b=f?v:A;if(b<0||b>1||Math.abs(v-h)<X.EPSILON5&&Math.abs(A-p)<X.EPSILON5)continue;let R=Math.abs(v)<X.EPSILON5||Math.abs(v-1)<X.EPSILON5,G=Math.abs(A)<X.EPSILON5||Math.abs(A-1)<X.EPSILON5;if(R&&G)continue;let I=S.decodePosition(C,P,uL),w=S.decodeHeight(C,P),M;S.hasVertexNormals?M=S.getOctEncodedNormal(C,P,b8):(M=b8,M.x=0,M.y=0);let O=A;if(S.hasWebMercatorT){let B=X.lerp(u.south,u.north,A);O=(Pi.geodeticLatitudeToMercatorAngle(B)-L)*Z}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(I,x8)),n.encode(i,o*V,I,W,w,M,O,k),c.minimumHeight=Math.min(c.minimumHeight,w),c.maximumHeight=Math.max(c.maximumHeight,w),++o}return o}function nxe(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let d=s;d!==a;d+=c){let u=e[d],h=t[d];if(!_8(h,u))continue;let p;switch(i){case _n.WEST:p=u.westIndicesSouthToNorth;break;case _n.SOUTH:p=u.southIndicesEastToWest;break;case _n.EAST:p=u.eastIndicesNorthToSouth;break;case _n.NORTH:p=u.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return u.encoding.decodeHeight(u.vertices,g)}}function _8(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function ixe(e,t,n,i,o,r,s,a){let c,d,u,h,p,g=i[o?0:n.length-1],f=n[o?0:n.length-1];if(_8(g,f)&&(r===0?s===0?(c=o?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,d=o,u=o):(c=o?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,d=!o,u=!1):s===0?(c=o?f.westIndicesSouthToNorth:f.northIndicesWestToEast,d=!o,u=!0):(c=o?f.southIndicesEastToWest:f.westIndicesSouthToNorth,d=o,u=!o),c.length>0)){h=o?0:c.length-1,p=c[h],f.encoding.decodeTextureCoordinates(f.vertices,p,tu);let y=cF(g,e.tile,tu,tu);if(y.x===r&&y.y===s)return y8(f,p,r,s,a),!0;if(h=Wo(c,d?r:s,function(x,S){f.encoding.decodeTextureCoordinates(f.vertices,x,tu);let C=cF(g,e.tile,tu,tu);return u?d?C.x-r:C.y-s:d?r-C.x:s-C.y}),h<0){if(h=~h,h>0&&h<c.length)return Tdt(t,g,e.tile,f,c[h-1],c[h],r,s,d,a),!0}else return y8(f,c[h],r,s,a),!0}return!1}var Cdt=[new m,new m,new m,new m];function Vdt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Cdt;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var hL=mL;function rr(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=Cn.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 be,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(rr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(rr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(rr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(rr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new be,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new D(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=le.clone(le.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(rr.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=re.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){ys.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){oh.setOwner(e,this,"_clippingPolygons")}}});function Ldt(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}rr.prototype.update=function(e){this._imageryLayers._update()};function Rdt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}rr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Ldt)})),Rdt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)cm._freeVertexArray(t[i]);t.length=0};rr.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};rr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:yc.LESS}}),this._blendRenderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL},blending:fn.ALPHA_BLEND});let s=Be(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ue.fromCache(s),s=Be(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ue.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&hL.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let d=0,u=c.length;d<u;++d){let h=c[d],p=h.data.tileBoundingRegion;dxe(this,h,e,!1);let g=this.marsOptions?.uplift;if(g&&g.enabled&&g.height!==0&&g.rectangles){for(let f=0;f<g.rectangles.length;f++)if(le.intersection(p.rectangle,g.rectangles[f])){dxe(this,h,e,!0);break}}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function uxe(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)}rr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)uxe(t[n],e)};rr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};rr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};rr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Qn.CULLED_BUT_NEEDED,o=n.terrainState),cm.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)!==ur.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,cm.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Zdt=new de,mxe=new le,Gdt=new le,Edt=new he;function uO(e,t){if(t.west<t.east)return t;let n=le.clone(t,Gdt);return le.center(e,Edt).longitude>0?n.east=X.PI:n.west=-X.PI,n}function hxe(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||!le.equals(e.cartographicLimitRectangle,le.MAX_VALUE))}rr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=hxe(this,t);if(t.fog.enabled&&!o&&X.fog(i,t.fog.density)>=1)return ur.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return ur.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let d=uO(e.rectangle,this.cartographicLimitRectangle),u=le.simpleIntersection(d,e.rectangle,mxe);if(!l(u))return ur.NONE;if(le.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(c=Zdt,de.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===oe.MORPHING&&l(r.renderedMesh)&&(c=de.union(s.boundingSphere,c,c))),!l(c))return ur.PARTIAL;let h=this._clippingPlanes;if(l(h)&&h.enabled){let x=h.computeIntersectionWithBoundingVolume(c);if(e.isClipped=x!==Jt.INSIDE,x===Jt.OUTSIDE)return ur.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let x=p.computeIntersectionWithBoundingVolume(s);e.isClipped=x!==Jt.OUTSIDE}let g,f=a.computeVisibility(c);if(f===Jt.OUTSIDE?g=ur.NONE:f===Jt.INTERSECTING?g=ur.PARTIAL:f===Jt.INSIDE&&(g=ur.FULL),g===ur.NONE)return g;let y=t.mode===oe.SCENE3D&&t.camera.frustum instanceof un;if(t.mode===oe.SCENE3D&&!y&&l(n)&&!o){let x=r.occludeePointInScaledSpace;return!l(x)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(x,s.minimumHeight)?g:ur.NONE}return g};rr.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 Idt=[],Xdt=[];rr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Idt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===bo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let h=s[a],p=h.loadingImagery,g=!l(p)||p.state===qn.FAILED||p.state===qn.INVALID,f=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[f]=g&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=Xdt;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);u.length>0;){let h=u.pop(),p=h._lastSelectionResultFrame===d?h._lastSelectionResult:Qn.NONE;if(p===Qn.RENDERED){let g=h.data;if(!l(g))continue;if(!o&&h.data.terrainState===bo.READY)return!1;let f=h.data.imagery;for(a=0,c=f.length;a<c;++a){let y=f[a],x=y.loadingImagery,S=!l(x)||x.state===qn.FAILED||x.state===qn.INVALID,C=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(S&&!i[C])return!1}}else p===Qn.REFINED&&u.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var Wdt=new m;rr.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=m.subtract(i.center,o,Wdt),a=m.magnitude(s);return a<X.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,r))*e._distance)};var sxe=new F,dO=new F,Pdt=new re,vdt=new re,wdt=new re,Fdt=new m,axe=new m,Adt=new m,Mdt=new m;rr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let d=i[a];l(d.readyImagery)&&d.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Ndt=[new m,new m,new m,new m];function cxe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Ndt;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}rr.prototype.computeDistanceToTile=function(e,t){kdt(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,d=Math.abs(c-r),u=Math.abs(c-s);d>u?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function kdt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new cm);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Fd({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,d=e,u=0,h=t.marsOptions?.flat;if(h&&h.enabled&&h.rectangles){for(let x=0;x<h.rectangles.length;x++)if(le.intersection(e.rectangle,h.rectangles[x])){u=h.rectangles[x]._flatHeight??h.heights[x];break}}let p=t.marsOptions?.uplift,g=0;if(p&&p.enabled&&p.height!==0&&p.rectangles){for(let x=0;x<p.rectangles.length;x++)if(le.intersection(r.rectangle,p.rectangles[x])){g=p.height;break}}let f=i.mesh,y=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,c=!0;else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0)r.minimumHeight=y._minimumHeight,r.maximumHeight=y._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let x=e.parent;for(;x!==void 0;){let S=x.data;if(S!==void 0){let C=S.mesh,V=S.terrainData;if(C!==void 0&&C.minimumHeight!==void 0&&C.maximumHeight!==void 0){r.minimumHeight=C.minimumHeight,r.maximumHeight=C.maximumHeight;break}else if(V!==void 0&&V._minimumHeight!==void 0&&V._maximumHeight!==void 0){r.minimumHeight=V._minimumHeight,r.maximumHeight=V._maximumHeight;break}}x=x.parent}d=x}if(r.maximumHeight+=g,r.minimumHeight-=u,d!==void 0){let x=n.verticalExaggeration,S=n.verticalExaggerationRelativeHeight;if((x!==1||u!==0)&&(c=!1,r.minimumHeight=Zr.getHeight(r.minimumHeight,x,S),r.maximumHeight=Zr.getHeight(r.maximumHeight,x,S)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Xn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=de.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=m.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=cxe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let V=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||V)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=cxe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}rr.prototype.isDestroyed=function(){return!1};rr.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(),me(this)};function Udt(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,d;for(d=0;d<c;++d)if(o=a[d],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?o.readyImagery??o.loadingImagery:void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(d=s;d<u;++d)a[d].freeResources();a.splice(s,e)}return!0}}rr.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,d=c.length,u=-1,h=0;for(a=0;a<d;++a){let g=c[a];if((g.readyImagery??g.loadingImagery).imageryLayer===e)u===-1&&(u=a),++h;else if(u!==-1)break}if(u===-1)return;let p=u+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Udt(h,e,n),s.state=aa.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=aa.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Qn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};rr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],d=c.loadingImagery;if(l(d)||(d=c.readyImagery),d.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};rr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};rr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Ddt=new F,Odt=new F;function lxe(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=F.multiplyByPoint(i,this.properties.rtc,axe);return F.setTranslation(i,o,sxe),sxe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=F.multiplyByPoint(i,this.properties.rtc,axe);return F.setTranslation(i,r,dO),F.multiply(o,dO,dO),dO},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?F.multiply(e.context.uniformState.view,i.modelMatrix,Ddt):F.IDENTITY;return F.inverseTranspose(o,Odt)},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 re(0,0,.5,1),fillHighlightColor:new D(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new U(65e5,9e6),nightFadeDistance:new U(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,center3D:void 0,rtc:new m,modifiedModelView:new F,tileRectangle:new re,verticalExaggerationAndRelativeHeight:new U(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new U,southMercatorYAndOneOverHeight:new U,waterMask:void 0,waterMaskTranslationAndScale:new re,minMaxHeight:new U,scaleAndBias:new F,clippingPlanesEdgeColor:D.clone(D.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new re,frontFaceAlphaByDistance:new re,backFaceAlphaByDistance:new re,localizedTranslucencyRectangle:new re,undergroundColor:D.clone(D.TRANSPARENT),undergroundColorAlphaByDistance:new re,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[],mars_inverseTileWidth:0,mars_cartographicTileRectangle:void 0,mars_flat_enabled:!1,mars_flat_rectangle:new re,mars_flat_texture:void 0,mars_uplift_enabled:!1,mars_uplift_hideInsideOrOutside:!1,mars_uplift_rectangle:new re,mars_uplift_texture:void 0,mars_clip_enabled:!1,mars_clip_rectangle:new re,mars_clip_texture:void 0,mars_clip_only:!1,mars_flood_enabled:!1,mars_flood_rectangle:new re,mars_flood_texture:void 0,mars_flood_only:!1}};return l(t.materialUniformMap)?Rt(n,t.materialUniformMap):n}function Bdt(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=Ydt(e,r,o),i.wireframeVertexArray.mesh=o}}function Ydt(e,t,n){let o={indices:n.indices,primitiveType:Ae.TRIANGLES};An.toWireframe(o);let r=o.indices,s=Ct.createIndexBuffer({context:e,typedArray:r,usage:ke.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new oi({context:e,attributes:t._attributes,indexBuffer:s})}var fxe,pxe,mO;(function(){let e=new Xt({geometry:vm.fromDimensions({dimensions:new m(2,2,2)})}),t=new Xt({geometry:new eb({radius:1})}),n=new F,i,o;function r(s){return new Wn({geometryInstances:s,appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})}fxe=function(s,a){return s===i||(mO(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Kt.fromColor(a),o=r(e)),o},pxe=function(s,a){return s===i||(mO(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Kt.fromColor(a),o=r(t)),o},mO=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var zdt=new re(0,0,0,0),Hdt={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},Kdt=D.TRANSPARENT,Jdt=new Ot;function dxe(e,t,n,i){let o=t.data;l(o.vertexArray)||(o.fill===void 0&&(o.fill=new hL(t)),o.fill.update(e,n));let r=n.creditDisplay,s=o.terrainData;if(l(s)&&l(s.credits)){let St=s.credits;for(let mn=0,to=St.length;mn<to;++mn)r.addCreditToNextFrame(St[mn])}let a=Dt.maximumTextureImageUnits,c=o.waterMaskTexture,d=o.waterMaskTranslationAndScale;!l(c)&&l(o.fill)&&(c=o.fill.waterMaskTexture,d=o.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,h=n.globeTranslucencyState,p=h.translucent,g=h.frontFaceAlphaByDistance,f=h.backFaceAlphaByDistance,y=h.rectangle,x=e.undergroundColor??Kdt,S=e.undergroundColorAlphaByDistance??Jdt,C=hxe(e,n)&&n.mode===oe.SCENE3D&&x.alpha>0&&(S.nearValue>0||S.farValue>0),V=e.lambertDiffuseMultiplier,L=e.vertexShadowDarkness,Z=e.hasWaterMask&&l(c),E=Z&&e.showWaterEffect,P=e.oceanNormalMap,W=E&&l(P),v=e.terrainProvider,A=l(v)&&e.terrainProvider.hasVertexNormals,b=n.fog.enabled&&n.fog.renderable&&!u,R=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,G=Cn.castShadows(e.shadows)&&!p,I=Cn.receiveShadows(e.shadows)&&!p,w=e.hueShift,M=e.saturationShift,O=e.brightnessShift,k=!(X.equalsEpsilon(w,0,X.EPSILON7)&&X.equalsEpsilon(M,0,X.EPSILON7)&&X.equalsEpsilon(O,0,X.EPSILON7)),B=!1;if(R){let St=m.magnitude(n.camera.positionWC),mn=e.nightFadeOutDistance;B=St>mn}Z&&--a,W&&--a,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--a,--a),a-=h.numberOfTextureUniforms;let N=o.renderedMesh,z=N.center,K=N.encoding,te=o.tileBoundingRegion,H=n.verticalExaggeration,j=n.verticalExaggerationRelativeHeight,ee=e.marsOptions?.uplift;i&&ee&&(j=n.verticalExaggerationRelativeHeight-ee.height/(H-1)),e.marsOptions?.uplift?.enabled&&--a,e.marsOptions?.clip?.enabled&&--a,e.marsOptions?.flat?.enabled&&--a,e.marsOptions?.flood?.enabled&&--a;let pe=H!==1,_e=K.hasGeodeticSurfaceNormals,ae=Pdt,ye=0,Se=0,Ee=0,Ie=0,Fe=!1;if(n.mode!==oe.SCENE3D){let St=n.mapProjection,mn=St.project(le.southwest(t.rectangle),Adt),to=St.project(le.northeast(t.rectangle),Mdt);if(ae.x=mn.x,ae.y=mn.y,ae.z=to.x,ae.w=to.y,n.mode!==oe.MORPHING&&(z=Fdt,z.x=0,z.y=(ae.z+ae.x)*.5,z.z=(ae.w+ae.y)*.5,ae.x-=z.y,ae.y-=z.z,ae.z-=z.y,ae.w-=z.z),n.mode===oe.SCENE2D&&K.quantization===Hs.BITS12){let He=1/(Math.pow(2,12)-1)*.5,yr=(ae.z-ae.x)*He,cr=(ae.w-ae.y)*He;ae.x-=yr,ae.y-=cr,ae.z+=yr,ae.w+=cr}St instanceof Pi&&(ye=t.rectangle.south,Se=t.rectangle.north,Ee=Pi.geodeticLatitudeToMercatorAngle(ye),Ie=1/(Pi.geodeticLatitudeToMercatorAngle(Se)-Ee),Fe=!0)}let ve=Hdt;ve.frameState=n,ve.surfaceTile=o,ve.hasWaterMask=Z,ve.showReflectiveOcean=E,ve.showOceanWaves=W,ve.enableLighting=e.enableLighting,ve.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,ve.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,ve.showGroundAtmosphere=R,ve.atmosphereLightIntensity=e.atmosphereLightIntensity,ve.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ve.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ve.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ve.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ve.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ve.perFragmentGroundAtmosphere=B,ve.hasVertexNormals=A,ve.useWebMercatorProjection=Fe,ve.clippedByBoundaries=o.clippedByBoundaries,ve.hasGeodeticSurfaceNormals=_e,ve.hasExaggeration=pe;let ct=o.imagery,Je=0,bt=ct.length,Qe=e.showSkirts&&!u&&!p,Tt=e.backFaceCulling&&!u&&!p,ft=Tt?e._renderState:e._disableCullingRenderState,gt=Tt?e._blendRenderState:e._disableCullingBlendRenderState,En=ft,cn=e._firstPassInitialColor,Ce=n.context;if(l(e._debug.boundingSphereTile)||mO(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let St=e._drawCommands.length;for(let mn=0;mn<St;++mn)e._uniformMaps[mn]=lxe(n,e)}do{let St=0,mn,to;if(e._drawCommands.length<=e._usedDrawCommands?(mn=new $e,mn.owner=t,mn.cull=!1,mn.boundingVolume=new de,mn.orientedBoundingBox=void 0,to=lxe(n,e),e._drawCommands.push(mn),e._uniformMaps.push(to)):(mn=e._drawCommands[e._usedDrawCommands],to=e._uniformMaps[e._usedDrawCommands]),mn.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let $t=te.boundingVolume,Ve=te.boundingSphere;l($t)?fxe($t,D.RED).update(n):l(Ve)&&pxe(Ve,D.RED).update(n)}let He=to.properties;re.clone(cn,He.initialColor),He.oceanNormalMap=P,He.lightingFadeDistance.x=e.lightingFadeOutDistance,He.lightingFadeDistance.y=e.lightingFadeInDistance,He.nightFadeDistance.x=e.nightFadeOutDistance,He.nightFadeDistance.y=e.nightFadeInDistance,He.atmosphereLightIntensity=e.atmosphereLightIntensity,He.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,He.atmosphereMieCoefficient=e.atmosphereMieCoefficient,He.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,He.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,He.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,He.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let yr=u?f:g,cr=u?g:f;l(yr)&&(re.fromElements(yr.near,yr.nearValue,yr.far,yr.farValue,He.frontFaceAlphaByDistance),re.fromElements(cr.near,cr.nearValue,cr.far,cr.farValue,He.backFaceAlphaByDistance)),re.fromElements(S.near,S.nearValue,S.far,S.farValue,He.undergroundColorAlphaByDistance),D.clone(x,He.undergroundColor),He.lambertDiffuseMultiplier=V,He.vertexShadowDarkness=L;let ma=!l(o.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;ma&&D.clone(e.fillHighlightColor,He.fillHighlightColor),He.verticalExaggerationAndRelativeHeight.x=H,He.verticalExaggerationAndRelativeHeight.y=j,He.center3D=N.center,m.clone(z,He.rtc),re.clone(ae,He.tileRectangle),He.southAndNorthLatitude.x=ye,He.southAndNorthLatitude.y=Se,He.southMercatorYAndOneOverHeight.x=Ee,He.southMercatorYAndOneOverHeight.y=Ie;let Me=vdt,at=uO(t.rectangle,e.cartographicLimitRectangle),et=wdt,qe=uO(t.rectangle,y);m.fromElements(w,M,O,He.hsbShift);let lt=t.rectangle,Bt=1/lt.width,xn=1/lt.height;Me.x=(at.west-lt.west)*Bt,Me.y=(at.south-lt.south)*xn,Me.z=(at.east-lt.west)*Bt,Me.w=(at.north-lt.south)*xn,re.clone(Me,He.localizedCartographicLimitRectangle),et.x=(qe.west-lt.west)*Bt,et.y=(qe.south-lt.south)*xn,et.z=(qe.east-lt.west)*Bt,et.w=(qe.north-lt.south)*xn,He.mars_inverseTileWidth=Bt,He.mars_cartographicTileRectangle=new U(lt.west,lt.south);let no=e.marsOptions?.clip;no?(no.rectangle?He.mars_clip_rectangle=new re(no.rectangle.west,no.rectangle.south,no.rectangle.width,no.rectangle.height):He.mars_clip_rectangle=new re,He.mars_clip_texture=no.texture,He.mars_clip_only=no.onlySelf,He.mars_clip_enabled=no.enabled):(He.mars_clip_enabled=!1,He.mars_clip_rectangle=new re,He.mars_clip_texture=void 0,He.mars_clip_only=!1);let zi=e.marsOptions?.flood;zi?(zi.rectangle?He.mars_flood_rectangle=new re(zi.rectangle.west,zi.rectangle.south,zi.rectangle.width,zi.rectangle.height):He.mars_flood_rectangle=new re,He.mars_flood_texture=zi.texture,He.mars_flood_only=zi.onlySelf,He.mars_flood_enabled=zi.enabled):(He.mars_flood_enabled=!1,He.mars_flood_rectangle=new re,He.mars_flood_texture=void 0);let ms=e.marsOptions?.flat;ms?(ms.rectangle?He.mars_flat_rectangle=new re(ms.rectangle.west,ms.rectangle.south,ms.rectangle.width,ms.rectangle.height):He.mars_flat_rectangle=new re,He.mars_flat_texture=ms.texture,He.mars_flat_enabled=ms.enabled):(He.mars_flat_enabled=!1,He.mars_flat_rectangle=new re,He.mars_flat_texture=void 0);let lr=e.marsOptions?.uplift;lr?(lr.rectangle?He.mars_uplift_rectangle=new re(lr.rectangle.west,lr.rectangle.south,lr.rectangle.width,lr.rectangle.height):He.mars_uplift_rectangle=new re,He.mars_uplift_texture=lr.texture,He.mars_uplift_enabled=(!lr.showUp||lr.enabled&&lr.height!==0)&&l(lr.rectangles)&&lr.rectangles.length>0,He.mars_uplift_hideInsideOrOutside=!i):(He.mars_uplift_enabled=!1,He.mars_uplift_rectangle=new re,He.mars_uplift_texture=void 0,He.mars_uplift_hideInsideOrOutside=!1),re.clone(et,He.localizedTranslucencyRectangle);let Gi=b&&X.fog(t._distance,n.fog.density)>X.EPSILON3;k=k&&(Gi||R);let Ei=!1,ha=!1,jr=!1,Tl=!1,Xo=!1,xr=!1,Tm=!1,_r=!1,du=!1,Kh=!1,hp=!1,Jh=!1;for(;St<a&&Je<bt;){let $t=ct[Je],Ve=$t.readyImagery;if(++Je,!l(Ve)||Ve.imageryLayer.alpha===0)continue;let Zt=$t.useWebMercatorT?Ve.textureWebMercator:Ve.texture,Nt=Ve.imageryLayer;l($t.textureTranslationAndScale)||($t.textureTranslationAndScale=Nt._calculateTextureTranslationAndScale(t,$t)),He.dayTextures[St]=Zt,He.dayTextureTranslationAndScale[St]=$t.textureTranslationAndScale,He.dayTextureTexCoordsRectangle[St]=$t.textureCoordinateRectangle,He.dayTextureUseWebMercatorT[St]=$t.useWebMercatorT,He.dayTextureAlpha[St]=Nt.alpha,xr=xr||He.dayTextureAlpha[St]!==1,He.dayTextureNightAlpha[St]=Nt.nightAlpha,Tm=Tm||He.dayTextureNightAlpha[St]!==1,He.dayTextureDayAlpha[St]=Nt.dayAlpha,Tm=Tm||He.dayTextureDayAlpha[St]!==1,He.dayTextureBrightness[St]=Nt.brightness,Ei=Ei||He.dayTextureBrightness[St]!==Ja.DEFAULT_BRIGHTNESS,He.dayTextureContrast[St]=Nt.contrast,ha=ha||He.dayTextureContrast[St]!==Ja.DEFAULT_CONTRAST,He.dayTextureHue[St]=Nt.hue,jr=jr||He.dayTextureHue[St]!==Ja.DEFAULT_HUE,He.dayTextureSaturation[St]=Nt.saturation,Tl=Tl||He.dayTextureSaturation[St]!==Ja.DEFAULT_SATURATION,He.dayTextureOneOverGamma[St]=1/Nt.gamma,Xo=Xo||He.dayTextureOneOverGamma[St]!==1/Ja.DEFAULT_GAMMA,He.dayTextureSplit[St]=Nt.splitDirection,_r=_r||He.dayTextureSplit[St]!==0,hp=hp||!!Nt.invertColor,He.mars3dTextureInvertColor[St]=!!Nt.invertColor,Jh=Jh||!!Nt.filterColor,Nt.filterColor?He.mars3dTextureFilterColor[St]=new m(Nt.filterColor.red,Nt.filterColor.green,Nt.filterColor.blue):He.mars3dTextureFilterColor[St]=new m(1,1,1);let uo=He.dayTextureCutoutRectangles[St];if(l(uo)||(uo=He.dayTextureCutoutRectangles[St]=new re),re.clone(re.ZERO,uo),l(Nt.cutoutRectangle)){let Ao=uO(lt,Nt.cutoutRectangle),ec=le.simpleIntersection(Ao,lt,mxe);du=l(ec)||du,uo.x=(Ao.west-lt.west)*Bt,uo.y=(Ao.south-lt.south)*xn,uo.z=(Ao.east-lt.west)*Bt,uo.w=(Ao.north-lt.south)*xn}let Tr=He.colorsToAlpha[St];l(Tr)||(Tr=He.colorsToAlpha[St]=new re);let Rs=l(Nt.colorToAlpha)&&Nt.colorToAlphaThreshold>0;if(Kh=Kh||Rs,Rs){let Ao=Nt.colorToAlpha;Tr.x=Ao.red,Tr.y=Ao.green,Tr.z=Ao.blue,Tr.w=Nt.colorToAlphaThreshold}else Tr.w=-1;if(l(Ve.credits)){let Ao=Ve.credits;for(let ec=0,qy=Ao.length;ec<qy;++ec)r.addCreditToNextFrame(Ao[ec])}++St}He.dayTextures.length=St,He.waterMask=c,re.clone(d,He.waterMaskTranslationAndScale),He.minMaxHeight.x=K.minimumHeight,He.minMaxHeight.y=K.maximumHeight,F.clone(K.matrix,He.scaleAndBias);let fp=e._clippingPlanes,qa=l(fp)&&fp.enabled&&t.isClipped;qa&&(He.clippingPlanesEdgeColor=D.clone(fp.edgeColor,He.clippingPlanesEdgeColor),He.clippingPlanesEdgeWidth=fp.edgeWidth);let I0=e._clippingPolygons,kS=l(I0)&&I0.enabled&&t.isClipped;ve.numberOfDayTextures=St,ve.applyBrightness=Ei,ve.applyContrast=ha,ve.applyHue=jr,ve.applySaturation=Tl,ve.applyGamma=Xo,ve.applyAlpha=xr,ve.applyDayNightAlpha=Tm,ve.applySplit=_r,ve.enableFog=Gi,ve.enableClippingPlanes=qa,ve.clippingPlanes=fp,ve.enableClippingPolygons=kS,ve.clippingPolygons=I0,ve.hasImageryLayerCutout=du,ve.colorCorrect=k,ve.highlightFillTile=ma,ve.colorToAlpha=Kh,ve.showUndergroundColor=C,ve.translucent=p,ve.marsOptions={invertColor:hp,filterColor:Jh,enableUplift:e?._marsOptions?.uplift?.enabled,enableFlat:e?._marsOptions?.flat?.enabled,enableClip:e?._marsOptions?.clip?.enabled,enableFlood:e?._marsOptions?.flood?.enabled};let X0=o.renderedMesh.indices.length;Qe||(X0=o.renderedMesh.indexCountWithoutSkirts),mn.shaderProgram=e._surfaceShaderSet.getShaderProgram(ve),mn.castShadows=G,mn.receiveShadows=I,mn.renderState=En,mn.primitiveType=Ae.TRIANGLES,mn.vertexArray=o.vertexArray||o.fill.vertexArray,mn.count=X0,mn.uniformMap=to,mn.pass=Ge.GLOBE,e._debug.wireframe&&(Bdt(Ce,e,t),l(o.wireframeVertexArray)&&(mn.vertexArray=o.wireframeVertexArray,mn.primitiveType=Ae.LINES,mn.count=X0*2));let Ds=mn.boundingVolume,$a=mn.orientedBoundingBox;n.mode!==oe.SCENE3D?(de.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,te.minimumHeight,te.maximumHeight,Ds),m.fromElements(Ds.center.z,Ds.center.x,Ds.center.y,Ds.center),n.mode===oe.MORPHING&&(Ds=de.union(te.boundingSphere,Ds,Ds))):(mn.boundingVolume=de.clone(te.boundingSphere,Ds),mn.orientedBoundingBox=Xn.clone(te.boundingVolume,$a)),mn.dirty=!0,p&&h.updateDerivedCommands(mn,n),uxe(mn,n),En=gt,cn=zdt}while(Je<bt)}var lF=rr;var Z2i=_(T(),1);function bxe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=le.clone(le.MAX_VALUE)}Object.defineProperties(bxe.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=Ot.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=Ot.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=le.clone(le.MAX_VALUE)),le.clone(e,this._rectangle)}}});var dF=bxe;var w2i=_(T(),1);function Vs(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(Vs.prototype,{length:{get:function(){return this._layers.length}}});Vs.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()})};Vs.prototype.addImageryProvider=function(e,t){let n=new Ja(e);return this.add(n,t),n};Vs.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};Vs.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=[]};Vs.prototype.contains=function(e){return this.indexOf(e)!==-1};Vs.prototype.indexOf=function(e){return this._layers.indexOf(e)};Vs.prototype.get=function(e){return this._layers[e]};function hO(e,t){return e.indexOf(t)}function gxe(e,t,n){let i=e._layers;if(t=X.clamp(t,0,i.length-1),n=X.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)}Vs.prototype.raise=function(e){let t=hO(this._layers,e);gxe(this,t,t+1)};Vs.prototype.lower=function(e){let t=hO(this._layers,e);gxe(this,t,t-1)};Vs.prototype.raiseToTop=function(e){let t=hO(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))};Vs.prototype.lowerToBottom=function(e){let t=hO(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 Qdt=new le;function T8(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];le.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],d=c.readyImagery;if(!l(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!l(u.pickFeatures)||!le.contains(d.rectangle,t))continue;let h=Qdt,p=1/1024;h.west=X.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),h.east=X.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),h.south=X.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),h.north=X.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),le.contains(h,t)&&i(d)}}Vs.pickImageryHelper=T8;Vs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(T8(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Vs.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(T8(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let a=s.imageryLayer.imageryProvider;for(let d=0;d<r.length;d++)if(r[d]===s.imageryLayer)return;let c=a.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let d=s[c],u=r[c];if(l(d)&&d.length>0)for(let h=0;h<d.length;++h){let p=d[h];p.imageryLayer=u,l(p.position)||(p.position=i),a.push(p)}}return a})};Vs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Vs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Vs.prototype.isDestroyed=function(){return!1};Vs.prototype.destroy=function(){return this.removeAll(!0),me(this)};Vs.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 uF=Vs;var fvi=_(T(),1);var N2i=_(T(),1);function yxe(e){this._ellipsoid=new Ip(e.ellipsoid,m.ZERO)}Object.defineProperties(yxe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var mF=yxe;var Y2i=_(T(),1);var S8=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()}},jdt=1e3;function ca(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=[],this._frameUpdated=void 0,this._lastSelectionResult=Qn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new S8(jdt),this.state=aa.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}ca.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new ca({tilingScheme:e,x:s,y:r,level:0});return i};var qdt=256;function $dt(e,t,n,i){let o=n.width/qdt*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}ca.prototype._getCacheKey=function(e,t){return $dt(e.longitude,e.latitude,this._rectangle,t)};ca.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};ca.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};ca.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};ca.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],le.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],le.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(ca.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 ca({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 ca({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 ca({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 ca({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<aa.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});ca.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]};ca.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};ca.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};ca.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};ca.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};ca.prototype.freeResources=function(){this.clearPositionCache(),this.state=aa.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),fO(this._southwestChild),this._southwestChild=void 0,fO(this._southeastChild),this._southeastChild=void 0,fO(this._northwestChild),this._northwestChild=void 0,fO(this._northeastChild),this._northeastChild=void 0};function fO(e){l(e)&&e.freeResources()}var hF=ca;var K2i=_(T(),1);function pO(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}pO.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};pO.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(),xxe(this,t)),t=i}};function xxe(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}pO.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))&&xxe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var fF=pO;function dm(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new fF,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new mF({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(dm.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});dm.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function eut(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Txe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}dm.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==aa.START&&e(t),t=t.replacementNext};dm.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};dm.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};dm.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function Txe(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}dm.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(eut(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Txe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};dm.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),out(this,e),fut(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function tut(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=be.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))}dm.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(dut(this,e),hut(this,e),tut(this,e))};dm.prototype.isDestroyed=function(){return!1};dm.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var bF,_xe=new he;function nut(e,t){let n=le.center(e.rectangle,_xe),i=n.longitude-bF.longitude,o=n.latitude-bF.latitude;n=le.center(t.rectangle,_xe);let r=n.longitude-bF.longitude,s=n.latitude-bF.latitude;return i*i+o*o-(r*r+s*s)}var iut=new m,pF=[];function out(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles)){let y=r.tilingScheme;if(l(y)){let x=r.tilingScheme;e._levelZeroTiles=hF.createLevelZeroTiles(x);let S=e._levelZeroTiles.length;if(pF.length<S)for(pF=new Array(S),o=0;o<S;++o)pF[o]===void 0&&(pF[o]=new gF)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;bF=t.camera.positionCartographic,a.sort(nut);let d=e._addHeightCallbacks,u=e._removeHeightCallbacks,h=t.frameNumber,p;if(d.length>0||u.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(h,d,u);d.length=0,u.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let f=F.getTranslation(g.transform,iut);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Qa(e,s,r,t,c,!1,pF[o]):(b0(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}function b0(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function gF(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Sxe(){this.southwest=new gF,this.southeast=new gF,this.northwest=new gF,this.northeast=new gF}Sxe.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 L8=new Array(31);for(let e=0;e<L8.length;++e)L8[e]=new Sxe;function rut(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=cut(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,d=n.northwestChild,u=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:Qn.NONE,g=e.tileProvider;if(s||i){let f=Qn.originalResult(p)===Qn.RENDERED,y=Qn.originalResult(p)===Qn.CULLED||p===Qn.NONE,x=n.state===aa.DONE,S=f||y||x;if(S||l(g.canRenderWithoutLosingDetail)&&(S=g.canRenderWithoutLosingDetail(n)),S){s&&b0(e,e._tileLoadQueueMedium,n,t),bO(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Qn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&b0(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){bO(e,n),b0(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Qn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.REFINED;let y=e._tilesToRender.length,x=e._tileLoadQueueLow.length,S=e._tileLoadQueueMedium.length,C=e._tileLoadQueueHigh.length,V=e._tileToUpdateHeights.length;if(sut(e,a,c,d,u,t,i,o),y!==e._tilesToRender.length){let L=o.allAreRenderable,Z=o.anyWereRenderedLastFrame,E=o.notYetRenderableCount,P=!1;if(!L&&!Z){let W=e._tilesToRender;for(let A=y;A<W.length;++A){let b=W[A];for(;b!==void 0&&b._lastSelectionResult!==Qn.KICKED&&b!==n;)b._lastSelectionResult=Qn.kick(b._lastSelectionResult),b=b.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=V,bO(e,n),n._lastSelectionResult=Qn.RENDERED;let v=p===Qn.RENDERED;!v&&E>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=x,e._tileLoadQueueMedium.length=S,e._tileLoadQueueHigh.length=C,b0(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,P=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=v,v||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!P&&b0(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Qn.RENDERED,bO(e,n),b0(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Qn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function sut(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,h=L8[t.level],p=h.southwest,g=h.southeast,f=h.northwest,y=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Qa(e,t,d,r,u,s,p),Qa(e,n,d,r,u,s,g),Qa(e,i,d,r,u,s,f),Qa(e,o,d,r,u,s,y)):(Qa(e,i,d,r,u,s,f),Qa(e,t,d,r,u,s,p),Qa(e,o,d,r,u,s,y),Qa(e,n,d,r,u,s,g)):c.latitude<t.rectangle.north?(Qa(e,n,d,r,u,s,g),Qa(e,t,d,r,u,s,p),Qa(e,o,d,r,u,s,y),Qa(e,i,d,r,u,s,f)):(Qa(e,o,d,r,u,s,y),Qa(e,i,d,r,u,s,f),Qa(e,n,d,r,u,s,g),Qa(e,t,d,r,u,s,p)),h.combine(a)}function aut(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&le.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&le.contains(n,e._cameraReferenceFrameOriginCartographic)}function Qa(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==ur.NONE)return rut(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,aut(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&b0(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Qn.NONE;c!==Qn.CULLED_BUT_NEEDED&&c!==Qn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Qn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(b0(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Qn.CULLED):t._lastSelectionResult=Qn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function cut(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof un||t.camera.frustum instanceof Ar)return lut(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=X.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function lut(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),h=d/u;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=X.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function bO(e,t){e._tilesToRender.push(t)}function dut(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=xi()+e._loadQueueTimeSlice,s=e._tileProvider,a=C8(e,t,s,r,n,!1);a=C8(e,t,s,r,i,a),C8(e,t,s,r,o,a)}function uut(e,t){return e._loadPriority-t._loadPriority}function C8(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(uut);for(let s=0,a=o.length;s<a&&(xi()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var fL=new yn,V8=new he,Fy=new m,mut=[];function hut(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=mut;n.length=0;let i=e._tileToUpdateHeights,o=xi(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let h=i[0];if(!l(h.data)||!l(h.data.mesh)){let y=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:Qn.NONE;(y===Qn.RENDERED||y===Qn.CULLED_BUT_NEEDED)&&n.push(h),h.clearPositionCache(),i.shift(),e._lastTileIndex=0;continue}let p=h.customData,g=p.length,f=!1;for(u=e._lastTileIndex;u<g;++u){let y=p[u],x=h.data.terrainData,S=l(x)&&x.wasCreatedByUpsampling();if(h.level>y.level&&!S){let C,V=h.getPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError);if(l(V))C=V;else{if(l(y.positionOnEllipsoidSurface)||(y.positionOnEllipsoidSurface=m.fromRadians(y.positionCartographic.longitude,y.positionCartographic.latitude,0,d)),a===oe.SCENE3D){let L=d.geodeticSurfaceNormal(y.positionOnEllipsoidSurface,fL.direction),Z=d.getSurfaceNormalIntersectionWithZAxis(y.positionOnEllipsoidSurface,11500,fL.origin);if(!l(Z)){let E=0;l(h.data.tileBoundingRegion)&&(E=h.data.tileBoundingRegion.minimumHeight);let P=Math.min(E,-11500),W=m.multiplyByScalar(L,Math.abs(P)+1,Fy);m.subtract(y.positionOnEllipsoidSurface,W,fL.origin)}}else he.clone(y.positionCartographic,V8),V8.height=-11500,c.project(V8,Fy),m.fromElements(Fy.z,Fy.x,Fy.y,Fy),m.clone(Fy,fL.origin),m.clone(m.UNIT_X,fL.direction);C=h.data.pick(fL,a,c,!1,Fy),l(C)&&h.setPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError,C)}l(C)&&(l(y.callback)&&y.callback(C),y.level=h.level)}if(xi()>=s){f=!0;break}}if(f){e._lastTileIndex=u;break}else e._lastTileIndex=0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function fut(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var yF=dm;function kh(e){e=e??ne.default;let t=new Bx({ellipsoid:e}),n=new uF;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new Hw,this._material=void 0,this._surface=new yF({tileProvider:new lF({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._undergroundColor=D.clone(D.BLACK),this._undergroundColorAlphaByDistance=new Ot(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new dF,Z8(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Re({url:sn("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=ne.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=X.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=X.PI*e.minimumRadius,this.nightFadeOutDistance=X.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*X.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Cn.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(kh.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=le.clone(le.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)&&Z8(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,Z8(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=D.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Ot.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function Z8(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[rh,$V];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(Yw),e._surfaceShaderSet.baseVertexShaderSource=new De({sources:[rh,$V,zw],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new De({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function put(e){return function(t,n){let i=de.distanceSquaredTo(t.pickBoundingSphere,e),o=de.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var but=[],gut={start:0,stop:0};kh.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,s=but;s.length=0;let a=this._surface._tilesToRender,c=a.length,d,u;for(u=0;u<c;++u){d=a[u];let p=d.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=g=de.fromRectangleWithHeights2D(d.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),m.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))de.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let f=ei.raySphere(e,g,gut);l(f)&&s.push(p)}s.sort(put(e.origin));let h;for(c=s.length,u=0;u<c&&(h=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(h));++u);return h};var yut=new he;kh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==oe.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,yut);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var xut=new m,Cxe=new m,_ut=new he,Tut=new yn;function R8(e,t){return l(e)&&le.contains(e.rectangle,t)?e:void 0}kh.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],!le.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=R8(n._southwestChild,e)||R8(n._southeastChild,e)||R8(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,xut),d=Tut,u=a.geodeticSurfaceNormal(c,d.direction),h=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(h)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(g??0,-11500),y=m.multiplyByScalar(u,Math.abs(f)+1,Cxe);m.subtract(c,y,d.origin)}let p=n.data.pick(d,void 0,s,!1,Cxe);if(l(p))return a.cartesianToCartographic(p,_ut).height};kh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};kh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let d=this;a.fetchImage().then(function(u){c===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new vt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===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))};kh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};kh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};kh.prototype.isDestroyed=function(){return!1};kh.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(),me(this)};var xF=kh;var vwi=_(T(),1);var xwi=_(T(),1);var Hvi=_(T(),1),pL=`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 Jvi=_(T(),1),bL=`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);
|
|
|
|
|
|
v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates
|
|
|
gl_Position = czm_modelViewProjection * p; // position in clip coordinates
|
|
|
|
|
|
// With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums
|
|
|
// and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the
|
|
|
// ellipsoid (does not write depth) that was rendered in the farther frustum.
|
|
|
//
|
|
|
// Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates
|
|
|
// artifacts since some fragments can be alpha blended twice. This is solved by only rendering
|
|
|
// the ellipsoid in the closest frustum to the viewer.
|
|
|
gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);
|
|
|
|
|
|
czm_vertexLogDepth();
|
|
|
}
|
|
|
`;var G8={position:0};function gO(e){e=e??Y.EMPTY_OBJECT,this.center=m.clone(e.center??m.ZERO),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new de,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=e.show??!0,this.material=e.material??Ji.fromType(Ji.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 $e({owner:e._owner??this}),this._pickCommand=new $e({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 Sut(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=va.createGeometry(va.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Xe.POSITION_ONLY}));return t=oi.fromGeometry({context:e,geometry:n,attributeLocations:G8,bufferUsage:ke.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}gO.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=Ue.fromCache({cull:{enabled:!0,face:Ti.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?fn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Sut(t));let o=!1,r=this.radii;if(!m.equals(this._radii,r)){m.clone(r,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(r.x*r.x),y.y=1/(r.y*r.y),y.z=1/(r.z*r.z),o=!0}(!F.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),F.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(r),de.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,d=this._useLogDepth!==c;this._useLogDepth=c;let u=this._colorCommand,h,p;(s||a||i||d)&&(h=new De({sources:[bL]}),p=new De({sources:[this.material.shaderSource,pL]}),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=nn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:G8}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=Rt(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let g=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Ge.TRANSLUCENT:Ge.OPAQUE,g.push(u)),f.pick){let y=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||d)&&(h=new De({sources:[bL]}),p=new De({sources:[this.material.shaderSource,pL],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=nn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:G8}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=Rt(Rt(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Ge.TRANSLUCENT:Ge.OPAQUE,g.push(y)}};gO.prototype.isDestroyed=function(){return!1};gO.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(),me(this)};var _F=gO;function TF(e){e=e??Y.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=sn("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ne.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new _F({radii:this.ellipsoid.radii,material:Ji.fromType(Ji.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new cI}Object.defineProperties(TF.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var yO=new $,Cut=new $,Vut=new m,xO=[];TF.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(Ft.computeIcrfToFixedMatrix(n,yO))||Ft.computeTemeToPseudoFixedMatrix(n,yO);let i=this._axes.evaluate(n,Cut);$.transpose(i,i),$.multiply(yO,i,i);let o=B0.computeMoonPositionInEarthInertialFrame(n,Vut);$.multiplyByVector(yO,o,o),F.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=xO,xO.length=0,t.update(e),e.commandList=r,xO.length===1?xO[0]:void 0};TF.prototype.isDestroyed=function(){return!1};TF.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),me(this)};var SF=TF;var gQi=_(T(),1);var Kwi=_(T(),1);var Fwi=_(T(),1),CF=`in vec2 v_textureCoordinates;
|
|
|
const float M_PI = 3.141592653589793;
|
|
|
|
|
|
float vdcRadicalInverse(int i)
|
|
|
{
|
|
|
float r;
|
|
|
float base = 2.0;
|
|
|
float value = 0.0;
|
|
|
float invBase = 1.0 / base;
|
|
|
float invBi = invBase;
|
|
|
for (int x = 0; x < 100; x++)
|
|
|
{
|
|
|
if (i <= 0)
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
r = mod(float(i), base);
|
|
|
value += r * invBi;
|
|
|
invBi *= invBase;
|
|
|
i = int(float(i) * invBase);
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
|
|
|
vec2 hammersley2D(int i, int N)
|
|
|
{
|
|
|
return vec2(float(i) / float(N), vdcRadicalInverse(i));
|
|
|
}
|
|
|
|
|
|
vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
|
|
|
{
|
|
|
float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
|
|
|
float phi = 2.0 * M_PI * xi.x;
|
|
|
float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
|
|
|
float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
|
|
|
vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
|
|
|
vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
|
|
vec3 tangentX = normalize(cross(upVector, N));
|
|
|
vec3 tangentY = cross(N, tangentX);
|
|
|
return tangentX * H.x + tangentY * H.y + N * H.z;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Estimate the geometric self-shadowing of the microfacets in a surface,
|
|
|
* using the Smith Joint GGX visibility function.
|
|
|
* Note: Vis = G / (4 * NdotL * NdotV)
|
|
|
* see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
|
|
|
* see Real-Time Rendering. Page 331 to 336.
|
|
|
* see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
|
|
|
*
|
|
|
* @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
|
|
|
* @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
|
|
|
* @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
|
|
|
*/
|
|
|
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
|
|
|
{
|
|
|
float alphaRoughnessSq = alphaRoughness * alphaRoughness;
|
|
|
|
|
|
float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
|
|
|
float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
|
|
|
|
|
|
float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0
|
|
|
if (GGX > 0.0)
|
|
|
{
|
|
|
return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0
|
|
|
}
|
|
|
return 0.0;
|
|
|
}
|
|
|
|
|
|
vec2 integrateBrdf(float roughness, float NdotV)
|
|
|
{
|
|
|
vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);
|
|
|
float A = 0.0;
|
|
|
float B = 0.0;
|
|
|
const int NumSamples = 1024;
|
|
|
float alphaRoughness = roughness * roughness;
|
|
|
for (int i = 0; i < NumSamples; i++)
|
|
|
{
|
|
|
vec2 xi = hammersley2D(i, NumSamples);
|
|
|
vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0));
|
|
|
vec3 L = 2.0 * dot(V, H) * H - V;
|
|
|
float NdotL = clamp(L.z, 0.0, 1.0);
|
|
|
float NdotH = clamp(H.z, 0.0, 1.0);
|
|
|
float VdotH = clamp(dot(V, H), 0.0, 1.0);
|
|
|
if (NdotL > 0.0)
|
|
|
{
|
|
|
float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
|
|
|
float G_Vis = 4.0 * G * VdotH * NdotL / NdotH;
|
|
|
float Fc = pow(1.0 - VdotH, 5.0);
|
|
|
A += (1.0 - Fc) * G_Vis;
|
|
|
B += Fc * G_Vis;
|
|
|
}
|
|
|
}
|
|
|
return vec2(A, B) / float(NumSamples);
|
|
|
}
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);
|
|
|
}
|
|
|
`;function VF(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(VF.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Lut(e,t,n){let i=t.createViewportQuadCommand(CF,{framebuffer:n,renderState:Ue.fromCache({viewport:new ze(0,0,256,256)})});e._drawCommand=i}VF.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new vt({context:t,width:256,height:256,pixelFormat:ot.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:tn.NEAREST});this._colorTexture=n;let i=new Fr({context:t,colorTextures:[n],destroyAttachments:!1});Lut(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};VF.prototype.isDestroyed=function(){return!1};VF.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),me(this)};var LF=VF;var MFi=_(T(),1);var sFi=_(T(),1);var Zxe={};function Rut(e,t,n){let i,o,r;if(e instanceof Ci){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof Qc)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var Zut=new m,Vxe=new m;function Gxe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(d){let u=n(d);if(d<=.5){let p=(u-o)/a;return X.lerp(e,-X.PI_OVER_TWO,p)}let h=(u-r)/c;return X.lerp(-X.PI_OVER_TWO,t,1-h)}}return function(o){return X.lerp(e,t,o)}}function I8(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,d=e.up,u=e.right,h=e.frustum,p=m.subtract(a,c,Zut),g=m.magnitude(m.multiplyByScalar(d,m.dot(p,d),Vxe)),f=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),Vxe));r=Math.min(Rut(h,g,f)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return X.lerp(n,i,a)}}function RF(e,t){return X.equalsEpsilon(e,X.TWO_PI,X.EPSILON11)&&(e=0),t>e+Math.PI?e+=X.TWO_PI:t<e-Math.PI&&(e-=X.TWO_PI),e}var Exe=new m;function Gut(e,t,n,i,o,r,s,a){let c=e.camera,d=m.clone(c.position,Exe),u=c.pitch,h=RF(c.heading,i),p=RF(c.roll,r),g=I8(c,n,d.z,n.z,s),f=Gxe(u,o,g,a);function y(x){let S=x.time/t;c.setView({orientation:{heading:X.lerp(h,i,S),pitch:f(S),roll:X.lerp(p,r,S)}}),U.lerp(d,n,S,c.position),c.position.z=g(S)}return y}function Eut(e,t){e.longitude<t.longitude?e.longitude+=X.TWO_PI:t.longitude+=X.TWO_PI}function Iut(e,t){let n=e.longitude-t.longitude;n<-X.PI?e.longitude+=X.TWO_PI:n>X.PI&&(t.longitude+=X.TWO_PI)}var Xut=new he,Wut=new he;function Put(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(u.positionCartographic,Xut),f=u.pitch,y=RF(u.heading,i),x=RF(u.roll,r),S=p.cartesianToCartographic(n,Wut);g.longitude=X.zeroToTwoPi(g.longitude),S.longitude=X.zeroToTwoPi(S.longitude);let C=!1;if(l(a)){let E=X.zeroToTwoPi(a),P=Math.min(g.longitude,S.longitude),W=Math.max(g.longitude,S.longitude),v=E>=P&&E<=W;if(l(c)){let A=Math.abs(g.longitude-S.longitude),b=X.TWO_PI-A;(v?A:b)<(v?b:A)*c&&!v&&(C=!0)}else v||(C=!0)}C?Eut(g,S):Iut(g,S);let V=I8(u,n,g.height,S.height,s),L=Gxe(f,o,V,d);function Z(){let E=g.longitude,P=S.longitude,W=g.latitude,v=S.latitude;return function(b){let R=b.time/t,G=m.fromRadians(X.lerp(E,P,R),X.lerp(W,v,R),V(R),p);u.setView({destination:G,orientation:{heading:X.lerp(y,i,R),pitch:L(R),roll:X.lerp(x,r,R)}})}}return Z()}function vut(e,t,n,i,o,r,s){let a=e.camera,c=m.clone(a.position,Exe),d=RF(a.heading,i),u=a.frustum.right-a.frustum.left,h=I8(a,n,u,n.z,s);function p(g){let f=g.time/t;a.setView({orientation:{heading:X.lerp(d,i,f)}}),U.lerp(c,n,f,a.position);let y=h(f),x=a.frustum,S=x.top/x.right,C=(y-(x.right-x.left))*.5;x.right+=C,x.left-=C,x.top=S*x.right,x.bottom=-x.top}return p}var Lxe=new he,wut=new m;function E8(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Rxe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Zxe.createTween=function(e,t){t=t??Y.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===oe.MORPHING)return E8();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,Lxe),n=r.project(Lxe,wut));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let f=t.duration;l(f)||(f=Math.ceil(m.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let y=t.heading??0,x=t.pitch??-X.PI_OVER_TWO,S=t.roll??0,C=e.screenSpaceCameraController;C.enableInputs=!1;let V=Rxe(C,t.complete),L=Rxe(C,t.cancel),Z=p.frustum,E=e.mode===oe.SCENE2D;if(E=E&&U.equalsEpsilon(p.position,n,X.EPSILON6),E=E&&X.equalsEpsilon(Math.max(Z.right-Z.left,Z.top-Z.bottom),n.z,X.EPSILON6),E=E||e.mode!==oe.SCENE2D&&m.equalsEpsilon(n,p.position,X.EPSILON10),E=E&&X.equalsEpsilon(X.negativePiToPi(y),X.negativePiToPi(p.heading),X.EPSILON10)&&X.equalsEpsilon(X.negativePiToPi(x),X.negativePiToPi(p.pitch),X.EPSILON10)&&X.equalsEpsilon(X.negativePiToPi(S),X.negativePiToPi(p.roll),X.EPSILON10),E)return E8(V,L);let P=new Array(4);if(P[oe.SCENE2D]=vut,P[oe.SCENE3D]=Put,P[oe.COLUMBUS_VIEW]=Gut,f<=0)return E8(function(){P[i](e,1,n,y,x,S,a,c,d,u)({time:1}),typeof V=="function"&&V()},L);let W=P[i](e,f,n,y,x,S,a,c,d,u);if(!l(h)){let v=p.positionCartographic.height,A=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;v>A&&v>11500?h=kr.CUBIC_OUT:h=kr.QUINTIC_IN_OUT}return{duration:f,easingFunction:h,startObject:{time:0},stopObject:{time:f},update:W,complete:V,cancel:L}};var ZF=Zxe;var cFi=_(T(),1),Fut={ROTATE:0,INFINITE_SCROLL:1},ed=Object.freeze(Fut);function rn(e){this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new Ci,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=X.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 be,this._moveEnd=new be,this._changed=new be,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new F,this._invViewMatrix=new F,Axe(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,X.PI_OVER_TWO)),this._max2Dfrustum=void 0,Jxe(this,rn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*rn.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}rn.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);rn.TRANSFORM_2D_INVERSE=F.inverseTransformation(rn.TRANSFORM_2D,new F);rn.DEFAULT_VIEW_RECTANGLE=le.fromDegrees(-95,-20,-70,90);rn.DEFAULT_VIEW_FACTOR=.5;rn.DEFAULT_OFFSET=new Gu(0,-X.PI_OVER_FOUR,0);function Axe(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Aut(e){if(!l(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=xi()):e.timeSinceMoved=Math.max(xi()-e._lastMovedTimestamp,0)/1e3}}rn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==oe.SCENE2D};rn.prototype._updateCameraChanged=function(){let e=this;if(Aut(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)%X.TWO_PI;i=i>X.PI?X.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%X.TWO_PI;s=s>X.PI?X.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===oe.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,f=e.frustum,y=e._changedFrustum,x=p.x+f.left,S=p.x+f.right,C=g.x+y.left,V=g.x+y.right,L=p.y+f.bottom,Z=p.y+f.top,E=g.y+y.bottom,P=g.y+y.top,W=Math.max(x,C),v=Math.min(S,V),A=Math.max(L,E),b=Math.min(Z,P),R;if(W>=v||A>=Z)R=1;else{let G=y;x<C&&S>V&&L<E&&Z>P&&(G=f),R=1-(v-W)*(b-A)/((G.right-G.left)*(G.top-G.bottom))}R>t&&(e._changed.raiseEvent(R),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let c=X.acosClamped(m.dot(e.directionWC,e._changedDirection)),d;l(e.frustum.fovy)?d=c/(e.frustum.fovy*.5):d=c;let h=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||h>t)&&(e._changed.raiseEvent(Math.max(d,h)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function Mut(e){Ft.basisTo2D(e._projection,e._transform,e._actualTransform)}var Nut=new he,kut=new m,_O=new m,Uut=new re,Dut=new re,Out=new re,But=new re,Yut=new re;function zut(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,Uut),o=n.cartesianToCartographic(i,Nut),r=t.project(o,kut),s=Dut;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=re.clone(re.UNIT_X,Yut),c=re.add(F.getColumn(e._transform,0,_O),i,_O);n.cartesianToCartographic(c,o),t.project(o,r);let d=Out;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,m.subtract(d,s,d),d.x=0;let u=But;if(m.magnitudeSquared(d)>X.EPSILON10)m.cross(a,d,u);else{let h=re.add(F.getColumn(e._transform,1,_O),i,_O);n.cartesianToCartographic(h,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,m.subtract(u,s,u),u.x=0,m.magnitudeSquared(u)<X.EPSILON10&&(re.clone(re.UNIT_Y,d),re.clone(re.UNIT_Z,u))}m.cross(u,a,d),m.normalize(d,d),m.cross(a,d,u),m.normalize(u,u),F.setColumn(e._actualTransform,0,d,e._actualTransform),F.setColumn(e._actualTransform,1,u,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var X8=new m;function Xc(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=!m.equals(o,e.position)||n;r&&(o=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let c=e._up,d=!m.equals(c,e.up);d&&(m.normalize(e.up,e.up),c=m.clone(e.up,e._up));let u=e._right,h=!m.equals(u,e.right);h&&(m.normalize(e.right,e.right),u=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone(rn.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?Mut(e):zut(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=F.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=X8;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===oe.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||h){let f=m.dot(s,m.cross(c,u,X8));if(Math.abs(1-f)>X.EPSILON2){let y=1/m.magnitudeSquared(c),x=m.dot(c,s)*y,S=m.multiplyByScalar(s,x,X8);c=m.normalize(m.subtract(c,S,e._up),e._up),m.clone(c,e.up),u=m.cross(s,c,e._right),m.clone(u,e.right)}}(a||p)&&(e._directionWC=F.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=F.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=F.multiplyByPointAsVector(g,u,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(r||a||d||h||p)&&Axe(e)}function Mxe(e,t){let n;return X.equalsEpsilon(Math.abs(e.z),1,X.EPSILON3)?n=Math.atan2(t.y,t.x)-X.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-X.PI_OVER_TWO,X.TWO_PI-X.zeroToTwoPi(n)}function Nxe(e){return X.PI_OVER_TWO-X.acosClamped(e.z)}function kxe(e,t,n){let i=0;return X.equalsEpsilon(Math.abs(e.z),1,X.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=X.zeroToTwoPi(i+X.TWO_PI)),i}var CO=new F,VO=new F;Object.defineProperties(rn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Xc(this),this._invTransform}},viewMatrix:{get:function(){return Xc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Xc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Xc(this),this._positionCartographic}},positionWC:{get:function(){return Xc(this),this._positionWC}},directionWC:{get:function(){return Xc(this),this._directionWC}},upWC:{get:function(){return Xc(this),this._upWC}},rightWC:{get:function(){return Xc(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,CO),n=Ft.eastNorthUpToFixedFrame(this.positionWC,e,VO);this._setTransform(n);let i=Mxe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,CO),n=Ft.eastNorthUpToFixedFrame(this.positionWC,e,VO);this._setTransform(n);let i=Nxe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,CO),n=Ft.eastNorthUpToFixedFrame(this.positionWC,e,VO);this._setTransform(n);let i=kxe(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}}});rn.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&&Bxe(this,this.position)};var Hut=new m,Kut=new m,Jut=new m;rn.prototype._setTransform=function(e){let t=m.clone(this.positionWC,Hut),n=m.clone(this.upWC,Kut),i=m.clone(this.directionWC,Jut);F.clone(e,this._transform),this._transformChanged=!0,Xc(this);let o=this._actualInvTransform;F.multiplyByPoint(o,t,this.position),F.multiplyByPointAsVector(o,i,this.direction),F.multiplyByPointAsVector(o,n,this.up),m.cross(this.direction,this.up,this.right),Xc(this)};var Qut=new U,jut=new yn,qut=new m,$ut=new m;function Uxe(e){if(!F.equals(F.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=Qut;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let a=e.getPickRay(i,jut);o=n.pickWorldCoordinates(a,t,!0,qut)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,$ut));let s;if(l(o)||l(r)){let a=l(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}rn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof un&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Uxe(this)))};var LO=new m,F8=new F,emt=new F,A8=new we,M8=new $,Dxe=new he;function tmt(e,t,n){let i=F.clone(e.transform,F8),o=Ft.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,emt);e._setTransform(o),m.clone(m.ZERO,e.position),n.heading=n.heading-X.PI_OVER_TWO;let r=we.fromHeadingPitchRoll(n,A8),s=$.fromQuaternion(r,M8);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function nmt(e,t,n,i){let o=F.clone(e.transform,F8);if(e._setTransform(F.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Dxe);t=a.project(c,LO)}m.clone(t,e.position)}n.heading=n.heading-X.PI_OVER_TWO;let r=we.fromHeadingPitchRoll(n,A8),s=$.fromQuaternion(r,M8);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function imt(e,t,n,i){let o=F.clone(e.transform,F8);if(e._setTransform(F.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,Dxe);t=c.project(d,LO)}U.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===ed.ROTATE){n.heading=n.heading-X.PI_OVER_TWO,n.pitch=-X.PI_OVER_TWO,n.roll=0;let r=we.fromHeadingPitchRoll(n,A8),s=$.fromQuaternion(r,M8);$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(o)}var omt=new m,rmt=new m,smt=new m;function Oxe(e,t,n,i){let o=m.clone(n.direction,omt),r=m.clone(n.up,rmt);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,c=Ft.eastNorthUpToFixedFrame(t,a,CO),d=F.inverseTransformation(c,VO);F.multiplyByPointAsVector(d,o,o),F.multiplyByPointAsVector(d,r,r)}let s=m.cross(o,r,smt);return i.heading=Mxe(o,r),i.pitch=Nxe(o),i.roll=kxe(o,r,s),i}var w8={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},gL=new Xa;rn.prototype.setView=function(e){e=e??Y.EMPTY_OBJECT;let t=e.orientation??Y.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??m.clone(this.positionWC,LO);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,LO),i=!1),l(t.direction)&&(t=Oxe(this,o,t,w8.orientation)),gL.heading=t.heading??0,gL.pitch=t.pitch??-X.PI_OVER_TWO,gL.roll=t.roll??0,n===oe.SCENE3D?tmt(this,o,gL):n===oe.SCENE2D?imt(this,o,gL,i):nmt(this,o,gL,i)};var amt=new m;rn.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:rn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(rn.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*rn.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,amt).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};rn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new re),Xc(this),F.multiplyByVector(this._actualInvTransform,e,t)};rn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new m),Xc(this),F.multiplyByPoint(this._actualInvTransform,e,t)};rn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new m),Xc(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};rn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new re),Xc(this),F.multiplyByVector(this._actualTransform,e,t)};rn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new m),Xc(this),F.multiplyByPoint(this._actualTransform,e,t)};rn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new m),Xc(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function Bxe(e,t){let n=e._scene.mapMode2D===ed.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var Ixe=new m;rn.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,Ixe),m.add(n,Ixe,n),this._mode===oe.SCENE2D&&Bxe(this,n),this._adjustOrthographicFrustum(!0)};rn.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?RO(this,e):this.move(this.direction,e)};rn.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?RO(this,-e):this.move(this.direction,-e)};rn.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};rn.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};rn.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};rn.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};rn.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,-e)};rn.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,e)};rn.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,-e)};rn.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,e)};var cmt=new we,lmt=new $;rn.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=we.fromAxisAngle(e,-n,cmt),o=$.fromQuaternion(i,lmt),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};rn.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};rn.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var dmt=new we,umt=new $;rn.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=we.fromAxisAngle(e,-n,dmt),o=$.fromQuaternion(i,umt);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};rn.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,Yxe(this,e)};rn.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,Yxe(this,-e)};var mmt=new m,hmt=new m,fmt=new m,Xxe=new m;function Yxe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,X.EPSILON2)){let i=m.normalize(n,mmt),o=m.equalsEpsilon(i,e.constrainedAxis,X.EPSILON2),r=m.equalsEpsilon(i,m.negate(e.constrainedAxis,Xxe),X.EPSILON2);if(!o&&!r){let s=m.normalize(e.constrainedAxis,hmt),a=m.dot(i,s),c=X.acosClamped(a);t>0&&t>c&&(t=c-X.EPSILON4),a=m.dot(i,m.negate(s,Xxe)),c=X.acosClamped(a),t<0&&-t>c&&(t=-c+X.EPSILON4);let d=m.cross(s,i,fmt);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}rn.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,zxe(this,-e)};rn.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,zxe(this,e)};function zxe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function RO(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===ed.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===ed.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Hxe(e,t){e.move(e.direction,t)}rn.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?RO(this,e):Hxe(this,e)};rn.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?RO(this,-e):Hxe(this,-e)};rn.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return m.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 pmt=new F;rn.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ne.default,o=Ft.eastNorthUpToFixedFrame(e,i,pmt);this.lookAtTransform(o,t)};var bmt=new m,gmt=new we,ymt=new we,xmt=new $;function Kxe(e,t,n){t=X.clamp(t,-X.PI_OVER_TWO,X.PI_OVER_TWO),e=X.zeroToTwoPi(e)-X.PI_OVER_TWO;let i=we.fromAxisAngle(m.UNIT_Y,-t,gmt),o=we.fromAxisAngle(m.UNIT_Z,-e,ymt),r=we.multiply(o,i,o),s=$.fromQuaternion(r,xmt),a=m.clone(m.UNIT_X,bmt);return $.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}rn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=Kxe(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){U.clone(U.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<X.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(F.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<X.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var GF=new he,_mt=new he,Tmt=new m,Smt=new m,Cmt=new m,Vmt=new m,Lmt=new m,Rmt=new m,Zmt=new m,W8=new m,Gmt={direction:new m,right:new m,up:new m},Wxe;function Ic(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function Jxe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Gmt,{north:s,south:a,west:c}=t,{east:d}=t;c>d&&(d+=X.TWO_PI);let u=(c+d)*.5,h;if(a<-X.PI_OVER_TWO+X.RADIANS_PER_DEGREE&&s>X.PI_OVER_TWO-X.RADIANS_PER_DEGREE)h=0;else{let v=GF;v.longitude=u,v.latitude=s,v.height=0;let A=_mt;A.longitude=u,A.latitude=a,A.height=0;let b=Wxe;(!l(b)||b.ellipsoid!==o)&&(Wxe=b=new Mp(void 0,void 0,o)),b.setEndPoints(v,A),h=b.interpolateUsingFraction(.5,GF).latitude}let p=GF;p.longitude=u,p.latitude=h,p.height=0;let g=o.cartographicToCartesian(p,Zmt),f=GF;f.longitude=d,f.latitude=s;let y=o.cartographicToCartesian(f,Tmt);f.longitude=c;let x=o.cartographicToCartesian(f,Cmt);f.longitude=u;let S=o.cartographicToCartesian(f,Lmt);f.latitude=a;let C=o.cartographicToCartesian(f,Rmt);f.longitude=d;let V=o.cartographicToCartesian(f,Vmt);f.longitude=c;let L=o.cartographicToCartesian(f,Smt);m.subtract(x,g,x),m.subtract(V,g,V),m.subtract(y,g,y),m.subtract(L,g,L),m.subtract(S,g,S),m.subtract(C,g,C);let Z=o.geodeticSurfaceNormal(g,r.direction);m.negate(Z,Z);let E=m.cross(Z,m.UNIT_Z,r.right);m.normalize(E,E);let P=m.cross(E,Z,r.up),W;if(e.frustum instanceof un){let v=Math.max(m.distance(y,x),m.distance(V,L)),A=Math.max(m.distance(y,V),m.distance(x,L)),b,R,G=e.frustum._offCenterFrustum,I=G.right/G.top,w=A*I;v>w?(b=v,R=b/I):(R=A,b=w),W=Math.max(b,R)}else{let v=Math.tan(e.frustum.fovy*.5),A=e.frustum.aspectRatio*v;if(W=Math.max(Ic(Z,P,x,v),Ic(Z,P,V,v),Ic(Z,P,y,v),Ic(Z,P,L,v),Ic(Z,P,S,v),Ic(Z,P,C,v),Ic(Z,E,x,A),Ic(Z,E,V,A),Ic(Z,E,y,A),Ic(Z,E,L,A),Ic(Z,E,S,A),Ic(Z,E,C,A)),a<0&&s>0){let b=GF;b.longitude=c,b.latitude=0,b.height=0;let R=o.cartographicToCartesian(b,W8);m.subtract(R,g,R),W=Math.max(W,Ic(Z,P,R,v),Ic(Z,E,R,A)),b.longitude=d,R=o.cartographicToCartesian(b,W8),m.subtract(R,g,R),W=Math.max(W,Ic(Z,P,R,v),Ic(Z,E,R,A))}}return m.add(g,m.multiplyByScalar(Z,-W,W8),n)}var Emt=new he,Imt=new m,Xmt=new m;function Wmt(e,t,n){let i=e._projection;t.west>t.east&&(t=le.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Emt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Imt);F.multiplyByPoint(o,a,a),F.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Xmt);if(F.multiplyByPoint(o,c,c),F.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-c.x)/u,(a.y-c.y)/d)*.5}else{let d=a.x-c.x,u=a.y-c.y;n.z=Math.max(d,u)}return n}var Pmt=new he,vmt=new m,wmt=new m;function Fmt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===ed.INFINITE_SCROLL?o+=X.TWO_PI:(t=le.MAX_VALUE,o=t.east));let r=Pmt;r.longitude=o,r.latitude=t.north;let s=i.project(r,vmt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,wmt),c=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,h,p=e.frustum.right/e.frustum.top,g=d*p;return c>g?(u=c,h=u/p):(h=d,u=g),d=Math.max(2*u,2*h),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=d,n=i.project(r,n),n}rn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new m),n===oe.SCENE3D)return Jxe(this,e,t);if(n===oe.COLUMBUS_VIEW)return Wmt(this,e,t);if(n===oe.SCENE2D)return Fmt(this,e,t)};var Amt=new yn;function Mmt(e,t,n,i){n=n??ne.default;let o=e.getPickRay(t,Amt),r=ei.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return yn.getPoint(o,s,i)}var Nmt=new yn;function kmt(e,t,n,i){let r=e.getPickRay(t,Nmt).origin;r=m.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-X.PI_OVER_TWO||s.latitude>X.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Umt=new yn;function Dmt(e,t,n,i){let o=e.getPickRay(t,Umt),r=-o.origin.x/o.direction.x;yn.getPoint(o,r,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-X.PI_OVER_TWO||s.latitude>X.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}rn.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new m),t=t??ne.default,this._mode===oe.SCENE3D)n=Mmt(this,e,t,n);else if(this._mode===oe.SCENE2D)n=kmt(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=Dmt(this,e,this._projection,n);else return;return n}};var Omt=new m,Bmt=new m,Ymt=new m;function zmt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,h=e.positionWC;m.clone(h,n.origin);let p=m.multiplyByScalar(e.directionWC,c,Omt);m.add(h,p,p);let g=m.multiplyByScalar(e.rightWC,d*c*a,Bmt),f=m.multiplyByScalar(e.upWC,u*c*s,Ymt),y=m.add(p,g,n.direction);return m.add(y,f,y),m.subtract(y,h,y),m.normalize(y,y),n}var TO=new m;function Hmt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let d=2/r*(r-t.y)-1;d*=(s.top-s.bottom)*.5;let u=n.origin;return m.clone(e.positionWC,u),m.multiplyByScalar(e.rightWC,c,TO),m.add(TO,u,u),m.multiplyByScalar(e.upWC,d,TO),m.add(TO,u,u),m.clone(e.directionWC,n.direction),n}rn.prototype.getPickRay=function(e,t){l(t)||(t=new yn);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)?zmt(this,e,t):Hmt(this,e,t)};var Kmt=new m,Jmt=new m;rn.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,Kmt),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),Jmt);return Math.max(0,m.magnitude(n)-e.radius)};var Qmt=new U;rn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Qmt);return Math.max(o.x,o.y)};function jmt(e,t,n,i,o,r){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let d=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:kr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var qmt=new m,Pxe=new m,$mt=new m,eht=new m;function tht(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(m.UNIT_X,qmt),r=-m.dot(o,n)/m.dot(o,i),s=m.add(n,m.multiplyByScalar(i,r,Pxe),Pxe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,$mt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=m.magnitude(m.subtract(n,s,eht)),u=c*d,h=a*d,p=e._maxCoord.x,g=e._maxCoord.y,f=Math.max(u-p,p),y=Math.max(h-g,g);if(n.z<-f||n.z>f||n.y<-y||n.y>y){let x=s.y<-f||s.y>f,S=s.z<-y||s.z>y;if(x||S)return jmt(e,n,s,f,y,t)}}rn.prototype.createCorrectPositionTween=function(e){if(this._mode===oe.COLUMBUS_VIEW)return tht(this,e)};var nht=new m,la={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};rn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};rn.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=la.destination,e.orientation.heading=la.heading,e.orientation.pitch=la.pitch,e.orientation.roll=la.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};rn.prototype.flyTo=function(e){e=e??Y.EMPTY_OBJECT;let t=e.destination;if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof le;i&&(t=this.getRectangleCameraCoordinates(t,nht));let o=e.orientation??Y.EMPTY_OBJECT;if(l(o.direction)&&(o=Oxe(this,t,o,w8.orientation)),l(e.duration)&&e.duration<=0){let u=w8;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;la.destination=t,la.heading=o.heading,la.pitch=o.pitch,la.roll=o.roll,la.duration=e.duration,la.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},la.cancel=e.cancel,la.endTransform=e.endTransform,la.convert=i?!1:e.convert,la.maximumHeight=e.maximumHeight,la.pitchAdjustHeight=e.pitchAdjustHeight,la.flyOverLongitude=e.flyOverLongitude,la.flyOverLongitudeWeight=e.flyOverLongitudeWeight,la.easingFunction=e.easingFunction;let a=this._scene,c=ZF.createTween(a,la);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(l(d)||(d=rn.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function iht(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function oht(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var rht=100;function Qxe(e,t,n){n=Gu.clone(l(n)?n:rn.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=rht:e.frustum instanceof un||e._mode===oe.SCENE2D?n.range=oht(e,s):n.range=iht(e,s),n.range=X.clamp(n.range,i,o)}return n}rn.prototype.viewBoundingSphere=function(e,t){t=Qxe(this,e,t),this.lookAt(e.center,t)};var sht=new F,aht=new m,cht=new m,lht=new m,dht=new m,uht=new re,mht=new we,hht=new $;rn.prototype.flyToBoundingSphere=function(e,t){t=t??Y.EMPTY_OBJECT;let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=Qxe(this,e,t.offset),o;n?o=m.multiplyByScalar(m.UNIT_Z,i.range,aht):o=Kxe(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??ne.default,a=Ft.eastNorthUpToFixedFrame(e.center,s,sht);F.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=m.subtract(e.center,o,cht),m.normalize(c,c),d=F.multiplyByPointAsVector(a,m.UNIT_Z,lht),1-Math.abs(m.dot(c,d))<X.EPSILON6){let h=we.fromAxisAngle(c,i.heading,mht),p=$.fromQuaternion(h,hht);m.fromCartesian4(F.getColumn(a,1,uht),d),$.multiplyByVector(p,d,d)}let u=m.cross(c,d,dht);m.cross(u,c,d),m.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:c,up:d},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var vxe=new m,wxe=new m,P8=new m,Fxe=new m,EF=[new m,new m,new m,new m];function fht(e,t){let n=t.radii,i=e.positionWC,o=m.multiplyComponents(t.oneOverRadii,i,vxe),r=m.magnitude(o),s=m.normalize(o,wxe),a,c;m.equalsEpsilon(s,m.UNIT_Z,X.EPSILON10)?(a=new m(0,1,0),c=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,P8),P8),c=m.normalize(m.cross(s,a,Fxe),Fxe));let d=Math.sqrt(m.magnitudeSquared(o)-1),u=m.multiplyByScalar(s,1/r,vxe),h=d/r,p=m.multiplyByScalar(a,h,wxe),g=m.multiplyByScalar(c,h,P8),f=m.add(u,g,EF[0]);m.subtract(f,p,f),m.multiplyComponents(n,f,f);let y=m.subtract(u,g,EF[1]);m.subtract(y,p,y),m.multiplyComponents(n,y,y);let x=m.subtract(u,g,EF[2]);m.add(x,p,x),m.multiplyComponents(n,x,x);let S=m.add(u,g,EF[3]);return m.add(S,p,S),m.multiplyComponents(n,S,S),EF}var v8=new U,pht=new m,Ay=[new he,new he,new he,new he];function SO(e,t,n,i,o,r){v8.x=e,v8.y=t;let s=i.pickEllipsoid(v8,o,pht);return l(s)?(Ay[n]=o.cartesianToCartographic(s,Ay[n]),1):(Ay[n]=o.cartesianToCartographic(r[n],Ay[n]),0)}rn.prototype.computeViewRectangle=function(e,t){e=e??ne.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new de(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Jt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=fht(this,e);if(c+=SO(0,0,0,this,e,d),c+=SO(0,a,1,this,e,d),c+=SO(s,a,2,this,e,d),c+=SO(s,0,3,this,e,d),c<2)return le.MAX_VALUE;t=le.fromCartographicArray(Ay,t);let u=0,h=Ay[3].longitude;for(let p=0;p<4;++p){let g=Ay[p].longitude,f=Math.abs(g-h);f>X.PI?u+=X.TWO_PI-f:u+=f,h=g}return X.equalsEpsilon(Math.abs(u),X.TWO_PI,X.EPSILON9)&&(t.west=-X.PI,t.east=X.PI,Ay[0].latitude>=0?t.north=X.PI_OVER_TWO:t.south=-X.PI_OVER_TWO),t};rn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof Ci)return;let e=this._scene;this.frustum=new Ci,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=X.toRadians(60)};rn.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof un)return;let e=Uxe(this),t=this._scene;this.frustum=new un,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};rn.clone=function(e,t){return l(t)||(t=new rn(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var lo=rn;var kFi=_(T(),1);function bht(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var um=bht;var HFi=_(T(),1);var t_e=_(cd(),1),jxe=576,ght=100,IF="#ffffff",ZO="#48b";function n_e(e,t){this.credit=e,this.count=t??1}function yht(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Gt.equals(o,t))return!0}return!1}function xht(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Gt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var i_e="cesium-credit-delimiter";function qxe(e){let t=document.createElement("span");return t.textContent=e,t.className=i_e,t}function $xe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function e_e(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(qxe(n));else{let u=o[d];u.className!==i_e&&e.replaceChild(qxe(n),u)}}let c=a.element;if(o.length<=r)e.appendChild($xe(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild($xe(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function _ht(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<jxe?(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>=jxe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Tht(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: ${IF};
|
|
|
position: relative;
|
|
|
min-height: ${ght}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: ${IF};
|
|
|
}
|
|
|
.cesium-credit-lightbox > ul > li a:hover {
|
|
|
color: ${ZO};
|
|
|
}
|
|
|
.cesium-credit-lightbox.cesium-credit-lightbox-expanded {
|
|
|
border: 1px solid #444;
|
|
|
border-radius: 5px;
|
|
|
max-width: 370px;
|
|
|
}
|
|
|
.cesium-credit-lightbox.cesium-credit-lightbox-mobile {
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
}
|
|
|
.cesium-credit-lightbox-title {
|
|
|
padding: 20px 20px 0 20px;
|
|
|
}
|
|
|
.cesium-credit-lightbox-close {
|
|
|
font-size: 18pt;
|
|
|
cursor: pointer;
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
right: 6px;
|
|
|
color: ${IF};
|
|
|
}
|
|
|
.cesium-credit-lightbox-close:hover {
|
|
|
color: ${ZO};
|
|
|
}
|
|
|
.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: ${IF};
|
|
|
}
|
|
|
.cesium-credit-expand-link:hover {
|
|
|
color: ${ZO};
|
|
|
}
|
|
|
|
|
|
.cesium-credit-text {
|
|
|
color: ${IF};
|
|
|
}
|
|
|
|
|
|
.cesium-credit-delimiter {
|
|
|
padding: 0 5px;
|
|
|
}
|
|
|
|
|
|
.cesium-credit-textContainer *,
|
|
|
.cesium-credit-logoContainer * {
|
|
|
display: inline;
|
|
|
}
|
|
|
|
|
|
.cesium-credit-textContainer a:hover {
|
|
|
color: ${ZO}
|
|
|
}
|
|
|
|
|
|
.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type {
|
|
|
padding-left: 5px;
|
|
|
}
|
|
|
`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function gr(e,t,n){let i=this;n=n??document.body;let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(f){r.contains(f.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let d=document.createElement("ul");r.appendChild(d);let u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Tht(e);let g=Gt.clone(gr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=h,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=d,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new It,lightboxCredits:new It},this._defaultCredit=void 0,this.viewport=n,this.container=e}function o_e(e,t,n,i){i=i??1;let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new n_e(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}gr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Gt.clone(r_e())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,o_e(this,t,e)};gr.prototype.addStaticCredit=function(e){let t=this._staticCredits;yht(t,e)||t.push(e)};gr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};gr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};gr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};gr.prototype.update=function(){this._expanded&&_ht(this)};gr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Gt.equals(gr.cesiumCredit,this._cesiumCredit)||o_e(this,s,r,Number.MAX_VALUE)}Gt.equals(gr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Gt.clone(gr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};gr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;e_e(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",e_e(this._creditList,t,void 0,"li"),xht(this)};gr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),me(this)};gr.prototype.isDestroyed=function(){return!1};gr._cesiumCredit=void 0;gr._cesiumCreditInitialized=!1;var GO;function r_e(){if(!l(GO)){let e=sn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new t_e.default(e).path()),GO=new Gt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return gr._cesiumCreditInitialized||(gr._cesiumCredit=GO,gr._cesiumCreditInitialized=!0),GO}Object.defineProperties(gr,{cesiumCredit:{get:function(){return r_e(),gr._cesiumCredit},set:function(e){gr._cesiumCredit=e,gr._cesiumCreditInitialized=!0}}});gr.CreditDisplayElement=n_e;var XF=gr;var mAi=_(T(),1);function EO(e){e=e??Y.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??D.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Sht=new m,Cht=new $,Vht=new we,Lht=new Ci,Rht=new Qc,Zht=new un,Ght=new Ar,Eht=new D,Iht=[1,1e5];EO.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Ci?a=Lht:s instanceof Qc?a=Rht:s instanceof un?a=Zht:a=Ght,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=Iht,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,c=1):c=d.length-1;let u=r.positionWC,h=r.directionWC,p=r.upWC,g=r.rightWC;g=m.negate(g,Sht);let f=Cht;$.setColumn(f,0,g,f),$.setColumn(f,1,p,f),$.setColumn(f,2,h,f);let y=we.fromRotationMatrix(f,Vht);for(t.length=n.length=c,i=0;i<c;++i)a.near=d[i],a.far=d[i+1],t[i]=new Wn({geometryInstances:new Xt({geometry:new zx({origin:u,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Kt.fromColor(D.fromAlpha(this._color,.1,Eht))},id:this.id,pickPrimitive:this}),appearance:new hn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Wn({geometryInstances:new Xt({geometry:new tI({origin:u,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Kt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};EO.prototype.isDestroyed=function(){return!1};EO.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 me(this)};var ep=EO;var MAi=_(T(),1);var fAi=_(T(),1),WF=`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 bAi=_(T(),1),PF=`in vec4 position;
|
|
|
|
|
|
out vec4 positionEC;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
positionEC = czm_modelView * position;
|
|
|
gl_Position = czm_projection * positionEC;
|
|
|
|
|
|
czm_vertexLogDepth();
|
|
|
}
|
|
|
`;function wF(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 vF=Ht.supportsTypedArrays()?new Float32Array(12):[],s_e=new m,a_e=new m,N8=new m,c_e=new m,IO=new m;function Xht(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof un)o=m.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,h,s_e),g=m.normalize(p,a_e),f=m.normalize(m.cross(m.UNIT_Z,p,N8),N8),y=m.normalize(m.cross(g,f,c_e),c_e),x=m.magnitude(p),S=Math.sqrt(x*x-1);o=m.multiplyByScalar(g,1/x,s_e);let C=S/x;r=m.multiplyByScalar(f,C,a_e),s=m.multiplyByScalar(y,C,N8)}let a=m.add(o,s,IO);m.subtract(a,r,a),m.multiplyComponents(n,a,a),m.pack(a,vF,0);let c=m.subtract(o,s,IO);m.subtract(c,r,c),m.multiplyComponents(n,c,c),m.pack(c,vF,3);let d=m.add(o,s,IO);m.add(d,r,d),m.multiplyComponents(n,d,d),m.pack(d,vF,6);let u=m.subtract(o,s,IO);return m.add(u,r,u),m.multiplyComponents(n,u,u),m.pack(u,vF,9),vF}wF.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 ne(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new $e({renderState:this._rs,boundingVolume:new de(m.ZERO,i.maximumRadius),pass:Ge.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new De({sources:[PF]}),a=new De({sources:[WF]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=nn.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Xht(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new ht({attributes:{position:new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Ae.TRIANGLES});this._va=oi.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:ke.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};wF.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};wF.prototype.isDestroyed=function(){return!1};wF.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var FF=wF;var KAi=_(T(),1);function xL(){}var Wht=/\bgl_FragDepth\b/,Pht=/\bdiscard\b/;function vht(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(Wht.test(r[a])||Pht.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main()
|
|
|
{
|
|
|
out_FragColor = vec4(1.0);
|
|
|
}
|
|
|
`;i=new De({sources:[a]})}else if(!o&&s){let a=`void main()
|
|
|
{
|
|
|
out_FragColor = vec4(1.0);
|
|
|
czm_writeLogDepth();
|
|
|
}
|
|
|
`;i=new De({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function wht(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ue.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ue.fromCache(o);return n[t.id]=r,r}xL.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=$e.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=vht(n,t.shaderProgram),i.depthOnlyCommand.renderState=wht(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var Fht=/\s+czm_writeLogDepth\(/,Aht=/\s+czm_vertexLogDepth\(/;function Mht(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let u=0;u<c.length;++u)if(Aht.test(c[u])){a=!0;break}if(!a){for(let h=0;h<c.length;++h)c[h]=De.replaceMain(c[h],"czm_log_depth_main");c.push(`
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
czm_log_depth_main();
|
|
|
czm_vertexLogDepth();
|
|
|
}
|
|
|
`)}c=s.sources,a=!1;for(let u=0;u<c.length;++u)Fht.test(c[u])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let d="";if(!a){for(let u=0;u<c.length;u++)c[u]=De.replaceMain(c[u],"czm_log_depth_main");d=`
|
|
|
void main()
|
|
|
{
|
|
|
czm_log_depth_main();
|
|
|
czm_writeLogDepth();
|
|
|
}
|
|
|
`}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}xL.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=$e.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Mht(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Nht(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(${D.floatToByte(n.color.red)}, ${D.floatToByte(n.color.green)}, ${D.floatToByte(n.color.blue)}, ${D.floatToByte(n.color.alpha)})`:n="vec4(1.0)");let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main ()
|
|
|
{
|
|
|
czm_non_pick_main();
|
|
|
if (${c}.a == 0.0) {
|
|
|
discard;
|
|
|
}
|
|
|
${c} = ${n};
|
|
|
} `,u=r.length,h=new Array(u+1);for(let g=0;g<u;++g)h[g]=De.replaceMain(r[g],"czm_non_pick_main");h[u]=d;let p=new De({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function l_e(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ue.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ue.fromCache(o);return n[t.id]=r,r}xL.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=$e.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Nht(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=l_e(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function yL(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 d_e(e){return e.isArray?e.arrayLength:mt.getComponentCount(e.type)}function kht(e){let t=d_e(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function u_e(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function m_e(e,t){let n=Mt.getMaximum(t);return`(${e}) / float(${n})`}function Uht(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=u_e(n,i,o)}return e.normalized||(n=m_e(n,e.componentType)),n}function Dht(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=u_e(o,r,s)}return e.normalized||(o=m_e(o,e.componentType)),o}function Oht(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,d=n.classProperty,u=kht(d),h=["0.0","0.0","0.0","0.0"],p=d_e(d);if(p===1)h[0]=Uht(d,c);else{let x=["x","y","z","w"];for(let S=0;S<p;S++)h[S]=Dht(d,c,x[S])}let g=t.fragmentShaderSource.defines.slice();g.push(Xd.METADATA_PICKING_ENABLED),yL(g,Xd.METADATA_PICKING_VALUE_TYPE,u),yL(g,Xd.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),yL(g,Xd.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),yL(g,Xd.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),yL(g,Xd.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),yL(g,Xd.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let f=new De({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:f,attributeLocations:t._attributeLocations})}xL.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=$e.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Oht(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=l_e(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function Bht(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})}xL.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=$e.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Bht(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var tp=xL;var t9i=_(T(),1);function XO(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=X.toRadians(o),t._beta=X.toRadians(i.beta),t._gamma=X.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var Yht=new we,h_e=new we,zht=new $;function Hht(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=we.fromAxisAngle(o,n,h_e),c=we.fromAxisAngle(r,i,Yht),d=we.multiply(c,a,c),u=we.fromAxisAngle(s,t,h_e);we.multiply(u,d,d);let h=$.fromQuaternion(d,zht);$.multiplyByVector(h,r,r),$.multiplyByVector(h,s,s),$.multiplyByVector(h,o,o)}XO.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;Hht(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};XO.prototype.isDestroyed=function(){return!1};XO.prototype.destroy=function(){return this._removeListener(),me(this)};var AF=XO;var a9i=_(T(),1);function k8(){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(k8.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var Kht=new m;k8.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,X.EPSILON4),-Math.max(this._heightFalloff,0)),s=m.normalize(n.positionWC,Kht),a=Math.abs(m.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var MF=k8;var d9i=_(T(),1);function Jht(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=oe.SCENE3D,this.morphTime=oe.getMorphTime(oe.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var NF=Jht;var C9i=_(T(),1);var Za={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},tS=Za.DERIVED_COMMANDS_MAXIMUM_LENGTH,C_e=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function nS(){this._frontFaceAlphaByDistance=new Ot(0,1,0,1),this._backFaceAlphaByDistance=new Ot(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=le.clone(le.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(tS),this._derivedBlendCommandTypes=new Array(tS),this._derivedPickCommandTypes=new Array(tS),this._derivedCommandTypesToUpdate=new Array(tS),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(nS.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}}});nS.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=f_e(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=f_e(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=p_e(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=p_e(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=$ht(this,e,t),this._sunVisibleThroughGlobe=Qht(this,e),this._environmentVisible=jht(this,e),this._useDepthPlane=qht(this,e),this._numberOfTextureUniforms=eft(this),this._rectangle=le.clone(t.translucency.rectangle,this._rectangle),tft(this,e)};function f_e(e,t,n,i){return e?l(n)?(Ot.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 p_e(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Qht(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function jht(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function qht(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function $ht(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function eft(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function tft(e,t){e._derivedCommandsLength=U8(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=U8(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=U8(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<tS;++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=bft())}function U8(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?Za.PICK_FRONT_FACE:d?Za.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Za.TRANSLUCENT_FRONT_FACE,h=i?Za.PICK_BACK_FACE:d?Za.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Za.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=Za.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=Za.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=h):(o[r++]=h,o[r++]=u)):c?(n||(o[r++]=Za.DEPTH_ONLY_BACK_FACE),o[r++]=Za.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=Za.DEPTH_ONLY_FRONT_FACE),o[r++]=Za.OPAQUE_BACK_FACE,o[r++]=u),r)}function mm(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function b_e(e,t){return e.indexOf(t)>-1}function nft(e,t){mm(e.defines,"TRANSLUCENT"),mm(t.defines,"TRANSLUCENT")}function ift(e,t){mm(e.defines,"GROUND_ATMOSPHERE"),mm(t.defines,"GROUND_ATMOSPHERE"),mm(e.defines,"FOG"),mm(t.defines,"FOG"),mm(e.defines,"TRANSLUCENT"),mm(t.defines,"TRANSLUCENT")}function D8(e,t){if(b_e(t.defines,"TILE_LIMIT_RECTANGLE")||b_e(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
|
|
|
{
|
|
|
out_FragColor = vec4(1.0);
|
|
|
}
|
|
|
`;t.sources=[n]}function O8(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=De.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 V_e(e,t){O8(e,t),mm(e.defines,"GROUND_ATMOSPHERE"),mm(t.defines,"GROUND_ATMOSPHERE"),mm(e.defines,"FOG"),mm(t.defines,"FOG")}function oft(e,t){O8(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function rft(e,t){V_e(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function g_e(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 sft(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],d.defines=l(d.defines)?d.defines.slice(0):[],o(c,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:a})}return s}function aft(e){e.cull.face=Ti.BACK,e.cull.enabled=!0}function cft(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0}function lft(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function dft(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function uft(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function y_e(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=fn.ALPHA_BLEND}function x_e(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=fn.ALPHA_BLEND}function mft(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function hft(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function fft(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ue.getState(e);i(s),r=Ue.fromCache(s),o[e.id]=r}return r}function _L(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function pft(e,t,n,i,o){return l(o)?!i&&l(n)?n:Rt(t,o(e),!1):t}function Uh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function bft(){return[new Uh({pass:Ge.GLOBE,pickOnly:!1,getShaderProgramFunction:nft,getRenderStateFunction:aft,getUniformMapFunction:void 0}),new Uh({pass:Ge.GLOBE,pickOnly:!1,getShaderProgramFunction:ift,getRenderStateFunction:cft,getUniformMapFunction:void 0}),new Uh({pass:Ge.GLOBE,pickOnly:!1,getShaderProgramFunction:D8,getRenderStateFunction:lft,getUniformMapFunction:void 0}),new Uh({pass:Ge.GLOBE,pickOnly:!1,getShaderProgramFunction:D8,getRenderStateFunction:dft,getUniformMapFunction:void 0}),new Uh({pass:Ge.GLOBE,pickOnly:!1,getShaderProgramFunction:D8,getRenderStateFunction:uft,getUniformMapFunction:void 0}),new Uh({pass:Ge.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:O8,getRenderStateFunction:y_e,getUniformMapFunction:_L}),new Uh({pass:Ge.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:V_e,getRenderStateFunction:x_e,getUniformMapFunction:_L}),new Uh({pass:Ge.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:oft,getRenderStateFunction:y_e,getUniformMapFunction:_L}),new Uh({pass:Ge.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:rft,getRenderStateFunction:x_e,getUniformMapFunction:_L}),new Uh({pass:Ge.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:g_e,getRenderStateFunction:mft,getUniformMapFunction:_L}),new Uh({pass:Ge.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:g_e,getRenderStateFunction:hft,getUniformMapFunction:_L})]}var __e=new Array(tS),T_e=new Array(tS);nS.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)T_e[o]=this._derivedCommandPacks[n[o]],__e[o]=C_e[n[o]];gft(this,e,i,n,__e,T_e,t)}};function gft(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=a.uniformMapDirtyFrame??0,h=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=d),f&&(a.shaderProgramDirtyFrame=d),y&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let x=0;x<n;++x){let S=r[x],C=i[x],V=o[x],L=a[V],Z,E,P;l(L)?(Z=L.uniformMap,E=L.shaderProgram,P=L.renderState):(Z=void 0,E=void 0,P=void 0),L=$e.shallowClone(t,L),a[V]=L;let W=L.derivedCommands.uniformMapDirtyFrame??0,v=L.derivedCommands.shaderProgramDirtyFrame??0,A=L.derivedCommands.renderStateDirtyFrame??0,b=g||W<u,R=f||v<h,G=y||A<p;b&&(L.derivedCommands.uniformMapDirtyFrame=d),R&&(L.derivedCommands.shaderProgramDirtyFrame=d),G&&(L.derivedCommands.renderStateDirtyFrame=d),L.derivedCommands.type=C,L.pass=S.pass,L.pickOnly=S.pickOnly,L.uniformMap=pft(e,t.uniformMap,Z,b,S.getUniformMapFunction),L.shaderProgram=sft(s.context,t.shaderProgram,E,R,S.getShaderProgramFunction,V),L.renderState=fft(t.renderState,P,G,S.getRenderStateFunction,S.renderStateCache)}}}nS.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=C_e[o[a]];n.commandList.push(s[c])}};function L_e(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function S_e(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var yft=[Za.OPAQUE_FRONT_FACE,Za.OPAQUE_BACK_FACE],xft=[Za.DEPTH_ONLY_FRONT_FACE,Za.DEPTH_ONLY_BACK_FACE,Za.DEPTH_ONLY_FRONT_AND_BACK_FACE];nS.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ge.GLOBE],a=e.indices[Ge.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),L_e(s,a,t,i,o,yft))};nS.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Ge.GLOBE],c=e.indices[Ge.GLOBE],d=e.commands[Ge.TERRAIN_CLASSIFICATION],u=e.indices[Ge.TERRAIN_CLASSIFICATION];if(c===0||u===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&S_e(d,u,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,L_e(a,c,t,i,o,xft),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}S_e(d,u,t,i,o),s.globeDepthTexture=g,o.framebuffer=f};var kF=nS;var B9i=_(T(),1);var L9i=_(T(),1),td=`uniform sampler2D colorTexture;
|
|
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
out_FragColor = texture(colorTexture, v_textureCoordinates);
|
|
|
}
|
|
|
`;function np(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new pi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new pi({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 ii({color:new D(0,0,0,0),owner:this}),this._clearCommand=new ii({color:new D(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(np.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});np.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var _ft={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Bn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Bn.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:fn.ALPHA_BLEND},Tft={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Bn.NOT_EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Bn.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:fn.ALPHA_BLEND},Sft={depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK,blending:fn.ALPHA_BLEND},Cft=`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;
|
|
|
}
|
|
|
`,Vft=`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
|
|
|
}
|
|
|
`;np.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new vt({context:e,width:s,height:a,pixelFormat:ot.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new md({context:e,width:s,height:a,format:Nc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;l(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),l(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ue.fromCache(_ft),this._rsClassified=Ue.fromCache(Tft),this._rsDefault=Ue.fromCache(Sft)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=l(this._previousFramebuffer)?Vft:Cft,u=new De({defines:["UNCLASSIFIED"],sources:[d]}),h=new De({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(td,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};np.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};np.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))};np.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)};np.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};np.prototype.isDestroyed=function(){return!1};np.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()),me(this)};var TL=np;var J9i=_(T(),1);function WO(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(WO.prototype,{total:{get:function(){return this._total}}});function My(e){let t=new Array(Da.NUMBER_OF_JOB_TYPES);t[Da.TEXTURE]=new WO(l(e)?e[Da.TEXTURE]:10),t[Da.PROGRAM]=new WO(l(e)?e[Da.PROGRAM]:10),t[Da.BUFFER]=new WO(l(e)?e[Da.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}My.getTimestamp=xi;Object.defineProperties(My.prototype,{totalBudget:{get:function(){return this._totalBudget}}});My.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};My.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};My.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,d;for(d=0;d<c&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=My.getTimestamp();e.execute();let a=My.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var UF=My;var tMi=_(T(),1);function PO(e){e=e??Y.EMPTY_OBJECT;let t=Pn(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=xi(),this._lastMsSampleTime=xi(),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(PO.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});PO.prototype.update=function(e){let t=xi(),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}};PO.prototype.destroy=function(){return me(this)};var g0=PO;var aUi=_(T(),1);var fMi=_(T(),1);var Ga={};Ga.decodeRawMetadataValue=function(e,t,n){switch(e){case Mt.INT8:return t.getInt8(n);case Mt.UINT8:return t.getUint8(n);case Mt.INT16:return t.getInt16(n,!0);case Mt.UINT16:return t.getUint16(n,!0);case Mt.INT32:return t.getInt32(n,!0);case Mt.UINT32:return t.getUint32(n,!0);case Mt.INT64:return t.getBigInt64(n,!0);case Mt.UINT64:return t.getBigUint64(n,!0);case Mt.FLOAT32:return t.getFloat32(n,!0);case Mt.FLOAT64:return t.getFloat64(n,!0)}throw new ce(`Invalid component type: ${e}`)};Ga.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=Ga.decodeRawMetadataValue(i,t,n);return e.normalized?Mt.normalize(o,i):o};Ga.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Mt.getSizeInBytes(i),r=e.type,s=mt.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,g=Ga.decodeRawMetadataValueComponent(e,t,p);u[h]=g}return u}let c=n*a;return Ga.decodeRawMetadataValueComponent(e,t,c)};Ga.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=Ga.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return Ga.decodeRawMetadataValueElement(e,n,0)};Ga.convertToObjectType=function(e,t){if(!l(t)||e===mt.SCALAR||e===mt.STRING||e===mt.BOOLEAN||e===mt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case mt.VEC2:return U.unpack(n,0,new U);case mt.VEC3:return m.unpack(n,0,new m);case mt.VEC4:return re.unpack(n,0,new re);case mt.MAT2:return Xi.unpack(n,0,new Xi);case mt.MAT3:return $.unpack(n,0,new $);case mt.MAT4:return F.unpack(n,0,new F)}throw new ce(`Invalid metadata object type: ${e}`)};Ga.convertFromObjectType=function(e,t){if(!l(t)||e===mt.SCALAR||e===mt.STRING||e===mt.BOOLEAN||e===mt.ENUM)return t;switch(e){case mt.VEC2:return U.pack(t,Array(2));case mt.VEC3:return m.pack(t,Array(3));case mt.VEC4:return re.pack(t,Array(4));case mt.MAT2:return Xi.pack(t,Array(4));case mt.MAT3:return $.pack(t,Array(9));case mt.MAT4:return F.pack(t,Array(16))}throw new ce(`Invalid metadata object type: ${e}`)};Ga.decodeMetadataValues=function(e,t,n){let i=Ga.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=Ga.convertFromObjectType(e.type,t.offset),s=Ga.convertFromObjectType(e.type,t.scale);i=Lf.valueTransformInPlace(i,r,s,Mt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],d=Ga.convertToObjectType(e.type,c);s[a]=d}return s}return Ga.convertToObjectType(e.type,i)};var DF=Object.freeze(Ga);var TMi=_(T(),1);function iS(){this._framebuffer=new pi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(iS.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Lft(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function Rft(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:Ue.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}iS.prototype.update=function(e,t){Lft(this,e,t),Rft(this,e,t)};var Zft=new re,Gft=new re(1,1/255,1/65025,1/16581375);iS.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=re.unpack(i,0,Zft);return re.divideByScalar(o,255,o),re.dot(o,Gft)};iS.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};iS.prototype.isDestroyed=function(){return!1};iS.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),me(this)};var OF=iS;var wki=_(T(),1);var VMi=_(T(),1);function Eft(e,t){this.near=e??0,this.far=t??0;let n=Ge.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 BF=Eft;var DMi=_(T(),1);var RMi=_(T(),1),Ny=`uniform highp sampler2D u_depthTexture;
|
|
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
|
|
|
}
|
|
|
`;function ip(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new pi,this._tempCopyDepthFramebuffer=new pi,this._updateDepthFramebuffer=new pi({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 ze,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(ip.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 R_e(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!ze.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,ze.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=ze.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!ze.equals(r,e._rs.viewport)||a)&&(e._rs=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:fn.ALPHA_BLEND}),e._rsUpdate=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Bn.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:Bn.NEVER,reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Ny,{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(td,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Ny,{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(td,{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 ii({color:new D(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}ip.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),R_e(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};ip.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};ip.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};ip.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),R_e(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};ip.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};ip.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(D.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};ip.prototype.isDestroyed=function(){return!1};ip.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()),me(this)};var YF=ip;var $Mi=_(T(),1);function oS(){this._framebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new pi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new ze,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(oS.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 Ift(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Xft(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function Wft(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!ze.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,ze.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=ze.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!ze.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Ny,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ii({color:new D(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}oS.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Xft(this,n,o,r,e),Wft(this,n,o,r,i),this._useHdr=e};oS.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};oS.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};oS.prototype.isDestroyed=function(){return!1};oS.prototype.destroy=function(){return Ift(this),me(this)};var zF=oS;var SNi=_(T(),1);var tNi=_(T(),1),SL=`#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 iNi=_(T(),1),HF=`/**
|
|
|
* Compositing for Weighted Blended Order-Independent Transparency. See:
|
|
|
* - http://jcgt.org/published/0002/02/09/
|
|
|
* - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
|
|
|
*/
|
|
|
|
|
|
uniform sampler2D u_opaque;
|
|
|
uniform sampler2D u_accumulation;
|
|
|
uniform sampler2D u_revealage;
|
|
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
vec4 opaque = texture(u_opaque, v_textureCoordinates);
|
|
|
vec4 accum = texture(u_accumulation, v_textureCoordinates);
|
|
|
float r = texture(u_revealage, v_textureCoordinates).r;
|
|
|
|
|
|
#ifdef MRT
|
|
|
vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
|
|
|
#else
|
|
|
vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
|
|
|
#endif
|
|
|
|
|
|
out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;
|
|
|
|
|
|
if (opaque != czm_backgroundColor)
|
|
|
{
|
|
|
out_FragColor.a = 1.0;
|
|
|
}
|
|
|
}
|
|
|
`;function y0(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 pi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new pi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new pi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new pi({createColorAttachments:!1}),this._opaqueClearCommand=new ii({color:new D(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ii({color:new D(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ii({color:new D(0,0,0,0),owner:this}),this._alphaClearCommand=new ii({color:new D(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new ze,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Z_e(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function B8(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function G_e(e){Z_e(e),B8(e)}function Pft(e,t,n,i){Z_e(e),e._accumulationTexture=new vt({context:t,width:n,height:i,pixelFormat:ot.RGBA,pixelDatatype:je.FLOAT}),e._revealageTexture=new vt({context:t,pixelFormat:ot.RGBA,pixelDatatype:je.FLOAT,width:n,height:i,flipY:!1})}function vft(e,t){B8(e);let n=ie.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)&&(B8(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!c||!d)&&(G_e(e),e._translucentMultipassSupport=!1,i=!1)}return i}y0.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((c||d)&&(this._numSamples=o,Pft(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!vft(this,e))return;this._useHDR=i;let u=this,h,p;l(this._compositeCommand)||(h=new De({sources:[HF]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new De({defines:["MRT"],sources:[SL]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new De({sources:[SL]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!ze.equals(this._viewport,t.viewport),f=g!==this._useScissorTest;this._useScissorTest=g,ze.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=ze.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!ze.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=Ue.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 wft={enabled:!0,color:new D(0,0,0,0),equationRgb:ka.ADD,equationAlpha:ka.ADD,functionSourceRgb:Ro.ONE,functionDestinationRgb:Ro.ONE,functionSourceAlpha:Ro.ZERO,functionDestinationAlpha:Ro.ONE_MINUS_SOURCE_ALPHA},Fft={enabled:!0,color:new D(0,0,0,0),equationRgb:ka.ADD,equationAlpha:ka.ADD,functionSourceRgb:Ro.ONE,functionDestinationRgb:Ro.ONE,functionSourceAlpha:Ro.ONE,functionDestinationAlpha:Ro.ONE},Aft={enabled:!0,color:new D(0,0,0,0),equationRgb:ka.ADD,equationAlpha:ka.ADD,functionSourceRgb:Ro.ZERO,functionDestinationRgb:Ro.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Ro.ZERO,functionDestinationAlpha:Ro.ONE_MINUS_SOURCE_ALPHA};function Y8(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ue.getState(i);r.depthMask=!1,r.blending=t,o=Ue.fromCache(r),n[i.id]=o}return o}function Mft(e,t,n){return Y8(t,wft,e._translucentRenderStateCache,n)}function Nft(e,t,n){return Y8(t,Fft,e._translucentRenderStateCache,n)}function kft(e,t,n){return Y8(t,Aft,e._alphaRenderStateCache,n)}var Uft=` 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);
|
|
|
`,Dft=` 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;
|
|
|
`,Oft=` float ai = czm_out_FragColor.a;
|
|
|
out_FragColor = vec4(ai);
|
|
|
`;function z8(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return De.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor;
|
|
|
bool czm_discard = false;
|
|
|
`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],d="";for(let u=0;u<c.length;u++){let h=c[u];d=`layout (location = ${h[1]}) out vec4 ${h[0]};
|
|
|
${d}`}return a.sources.push(d),a.sources.push(`void main()
|
|
|
{
|
|
|
czm_translucent_main();
|
|
|
if (czm_discard)
|
|
|
{
|
|
|
discard;
|
|
|
}
|
|
|
${i}}
|
|
|
`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Bft(e,t){return z8(e,t,"translucentMRT",Uft)}function Yft(e,t){return z8(e,t,"translucentMultipass",Dft)}function zft(e,t){return z8(e,t,"alphaMultipass",Oft)}y0.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=$e.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Bft(t,e.shaderProgram),n.translucentCommand.renderState=Mft(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=$e.shallowClone(e,n.translucentCommand),n.alphaCommand=$e.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Yft(t,e.shaderProgram),n.translucentCommand.renderState=Nft(this,t,e.renderState),n.alphaCommand.shaderProgram=zft(t,e.shaderProgram),n.alphaCommand.renderState=kft(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function Hft(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,h=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let x=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(x,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let x=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(x,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.alphaCommand:f.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=h}function Kft(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,h=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let x=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(x,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=h}y0.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Kft(this,e,t,n,i,o);return}Hft(this,e,t,n,i,o)};y0.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};y0.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,D.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};y0.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};y0.prototype.isDestroyed=function(){return!1};y0.prototype.destroy=function(){return G_e(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()),me(this)};var KF=y0;var GNi=_(T(),1);function JF(){this._framebuffer=new pi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(JF.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Jft(e){e._framebuffer.destroy()}function Qft(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new ac(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new ze},o.viewport=new ze,e._passState=o}JF.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&Qft(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};JF.prototype.isDestroyed=function(){return!1};JF.prototype.destroy=function(){return Jft(this),me(this)};var QF=JF;var FNi=_(T(),1);function CL(e){let t=new ac(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new ze},t.viewport=new ze,this._context=e,this._fb=new pi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}CL.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return ze.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var jF=new D;CL.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),d=0,u=0,h=0,p=-1;for(let g=0;g<s;++g){if(-a<=d&&d<=a&&-c<=u&&u<=c){let f=4*((c-u)*t+d+a);jF.red=D.byteToFloat(o[f]),jF.green=D.byteToFloat(o[f+1]),jF.blue=D.byteToFloat(o[f+2]),jF.alpha=D.byteToFloat(o[f+3]);let y=i.getObjectByPickColor(jF);if(l(y))return y}if(d===u||d<0&&-d===u||d>0&&d===1-u){let f=h;h=-p,p=f}d+=h,u+=p}};CL.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};CL.prototype.isDestroyed=function(){return!1};CL.prototype.destroy=function(){return this._fb.destroy(),me(this)};var qF=CL;var ONi=_(T(),1);function x0(){this._numSamples=1,this._colorFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new D(0,0,0,0),this._clearCommand=new ii({color:new D(0,0,0,0),depth:1,owner:this})}function jft(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(x0.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});x0.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};x0.prototype.clear=function(e,t,n){D.clone(n,this._clearCommand.color),D.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};x0.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};x0.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};x0.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};x0.prototype.isDestroyed=function(){return!1};x0.prototype.destroy=function(){return jft(this),me(this)};var rS=x0;var k5i=_(T(),1);var HNi=_(T(),1);function sS(){}sS.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};sS.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=De.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=De.replaceMain(o[d],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC;
|
|
|
void main()
|
|
|
{
|
|
|
czm_shadow_cast_main();
|
|
|
v_positionEC = (czm_inverseProjection * gl_Position).xyz;
|
|
|
}`)}return new De({defines:i,sources:o})};sS.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=De.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let u=0;u<c;++u)r[u]=De.replaceMain(r[u],"czm_shadow_cast_main");let d="";return t&&(a||(d+=`in vec3 v_positionEC;
|
|
|
`),d+=`uniform vec4 shadowMap_lightPositionEC;
|
|
|
`),i?d+=`void main()
|
|
|
{
|
|
|
`:d+=`void main()
|
|
|
{
|
|
|
czm_shadow_cast_main();
|
|
|
if (out_FragColor.a == 0.0)
|
|
|
{
|
|
|
discard;
|
|
|
}
|
|
|
`,t?d+=` float distance = length(${s});
|
|
|
if (distance >= shadowMap_lightPositionEC.w)
|
|
|
{
|
|
|
discard;
|
|
|
}
|
|
|
distance /= shadowMap_lightPositionEC.w; // radius
|
|
|
out_FragColor = czm_packDepth(distance);
|
|
|
`:n?d+=` out_FragColor = vec4(1.0);
|
|
|
`:d+=` out_FragColor = czm_packDepth(gl_FragCoord.z);
|
|
|
`,d+=`}
|
|
|
`,r.push(d),new De({defines:o,sources:r})};sS.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${d}${u}${t}${n}${i}`};sS.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 De({defines:i,sources:o})};sS.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=De.findNormalVarying(e),s=!i&&l(r)||i&&o,a=De.findPositionVarying(e),c=l(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,f=t.debugCascadeColors,y=t.softShadows,x=h?t._pointBias:i?t._terrainBias:t._primitiveBias,S=e.defines.slice(0),C=e.sources.slice(0),V=C.length;for(let E=0;E<V;++E)C[E]=De.replaceMain(C[E],"czm_shadow_receive_main");h?S.push("USE_CUBE_MAP_SHADOW"):d&&S.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!h&&S.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?S.push("ENABLE_VERTEX_LIGHTING"):S.push("ENABLE_DAYNIGHT_SHADING")),n&&x.normalShading&&s&&(S.push("USE_NORMAL_SHADING"),x.normalShadingSmooth>0&&S.push("USE_NORMAL_SHADING_SMOOTH"));let L="";h?L+=`uniform samplerCube shadowMap_textureCube;
|
|
|
`:L+=`uniform sampler2D shadowMap_texture;
|
|
|
`;let Z;return c?Z=` return vec4(${a}, 1.0);
|
|
|
`:Z=`#ifndef LOG_DEPTH
|
|
|
return czm_windowToEyeCoordinates(gl_FragCoord);
|
|
|
#else
|
|
|
return vec4(v_logPositionEC, 1.0);
|
|
|
#endif
|
|
|
`,L+=`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()
|
|
|
{
|
|
|
${Z}}
|
|
|
vec3 getNormalEC()
|
|
|
{
|
|
|
${s?` return normalize(${r});
|
|
|
`:` return vec3(1.0);
|
|
|
`}}
|
|
|
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL)
|
|
|
{
|
|
|
${x.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x;
|
|
|
float normalOffsetScale = 1.0 - nDotL;
|
|
|
vec3 offset = normalOffset * normalOffsetScale * normalEC;
|
|
|
positionEC.xyz += offset;
|
|
|
`:""}}
|
|
|
`,L+=`void main()
|
|
|
{
|
|
|
czm_shadow_receive_main();
|
|
|
vec4 positionEC = getPositionEC();
|
|
|
vec3 normalEC = getNormalEC();
|
|
|
float depth = -positionEC.z;
|
|
|
`,L+=` czm_shadowParameters shadowParameters;
|
|
|
shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
|
|
|
shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
|
|
|
shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
|
|
|
shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
|
|
|
`,i?L+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0);
|
|
|
`:u||(L+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015);
|
|
|
`),h?L+=` 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?L+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);
|
|
|
float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
|
|
|
applyNormalOffset(positionEC, normalEC, nDotL);
|
|
|
vec4 shadowPosition = shadowMap_matrix * positionEC;
|
|
|
// Spot light uses a perspective projection, so perform the perspective divide
|
|
|
shadowPosition /= shadowPosition.w;
|
|
|
// Stop early if the fragment is not in the shadow bounds
|
|
|
if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
shadowParameters.texCoords = shadowPosition.xy;
|
|
|
shadowParameters.depth = shadowPosition.z;
|
|
|
shadowParameters.nDotL = nDotL;
|
|
|
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
|
|
|
`:g?L+=` float maxDepth = shadowMap_cascadeSplits[1].w;
|
|
|
// Stop early if the eye depth exceeds the last cascade
|
|
|
if (depth > maxDepth)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
// Get the cascade based on the eye-space depth
|
|
|
vec4 weights = czm_cascadeWeights(depth);
|
|
|
// Apply normal offset
|
|
|
float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
|
|
|
applyNormalOffset(positionEC, normalEC, nDotL);
|
|
|
// Transform position into the cascade
|
|
|
vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC;
|
|
|
// Get visibility
|
|
|
shadowParameters.texCoords = shadowPosition.xy;
|
|
|
shadowParameters.depth = shadowPosition.z;
|
|
|
shadowParameters.nDotL = nDotL;
|
|
|
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
|
|
|
// Fade out shadows that are far away
|
|
|
float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z;
|
|
|
float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0);
|
|
|
visibility = mix(visibility, 1.0, fade);
|
|
|
${f?` // Draw cascade colors for debugging
|
|
|
out_FragColor *= czm_cascadeColor(weights);
|
|
|
`:""}`:L+=` 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);
|
|
|
`,L+=` out_FragColor.rgb *= visibility;
|
|
|
}
|
|
|
`,C.push(L),new De({defines:S,sources:C})};var op=sS;function rp(e){e=e??Y.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;(Ht.isInternetExplorer()||Ht.isEdge()||(Ht.isChrome()||Ht.isFirefox())&&Ht.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 F,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new re,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new vO,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new de,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 U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Ar:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new re,new re],this._cascadeMatrices=[new F,new F,new F,new F],this._cascadeDistances=new re;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 qft(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,K8(this),this._clearCommand=new ii({depth:1,color:new D}),this._clearPassState=new ac(t),this._size=e.size??2048,this.size=this._size}rp.MAXIMUM_DISTANCE=2e4;function qft(e){this.camera=new vO,this.passState=new ac(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function H8(e,t){return Ue.fromCache({cull:{enabled:!0,face:Ti.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 K8(e){let t=!e._usesDepthTexture;e._primitiveRenderState=H8(t,e._primitiveBias),e._terrainRenderState=H8(t,e._terrainBias),e._pointRenderState=H8(t,e._pointBias)}rp.prototype.debugCreateRenderStates=function(){K8(this)};Object.defineProperties(rp.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){opt(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 J8(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 $ft(e,t){let n=new md({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Nc.DEPTH_COMPONENT16}),i=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ot.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:tn.NEAREST}),o=new Fr({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function ept(e,t){let n=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ot.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:tn.NEAREST}),i=new Fr({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function tpt(e,t){let n=new md({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Nc.DEPTH_COMPONENT16}),i=new Lr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ot.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:tn.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Fr({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function X_e(e,t){e._isPointLight?tpt(e,t):e._usesDepthTexture?ept(e,t):$ft(e,t)}function npt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,K8(e),J8(e),X_e(e,t))}function ipt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(J8(e),X_e(e,t),npt(e,t),W_e(e,t))}function W_e(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function opt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Dt.maximumCubeMapSize>=t?t:Dt.maximumCubeMapSize,o.x=t,o.y=t;let r=new ze(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=Dt.maximumTextureSize>=t?t:Dt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new ze(0,0,t,t)):i===4&&(t=Dt.maximumTextureSize>=t*2?t:Dt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new ze(0,0,t,t),n[1].passState.viewport=new ze(t,0,t,t),n[2].passState.viewport=new ze(0,t,t,t),n[3].passState.viewport=new ze(t,t,t,t));e._clearPassState.viewport=new ze(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,d=a.y/o.y,u=a.width/o.x,h=a.height/o.y;s.textureOffsets=new F(u,0,0,c,0,h,0,d,0,0,1,0,0,0,0,1)}}var rpt=new ze;function spt(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=Ge.OVERLAY,i}function apt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=rpt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=spt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!ze.equals(a.renderState.viewport,s))&&(a.renderState=Ue.fromCache({viewport:ze.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var sp=new Array(8);sp[0]=new re(-1,-1,-1,1);sp[1]=new re(1,-1,-1,1);sp[2]=new re(1,1,-1,1);sp[3]=new re(-1,1,-1,1);sp[4]=new re(-1,-1,1,1);sp[5]=new re(1,-1,1,1);sp[6]=new re(1,1,1,1);sp[7]=new re(-1,1,1,1);var ky=new F,Q8=new Array(8);for(let e=0;e<8;++e)Q8[e]=new re;function cpt(e,t){let n=new Xt({geometry:new vm({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:Kt.fromColor(t)}}),i=new Xt({geometry:new eb({radius:.5}),attributes:{color:Kt.fromColor(t)}});return new Wn({geometryInstances:[n,i],appearance:new hn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var lpt=[D.RED,D.GREEN,D.BLUE,D.MAGENTA],dpt=new m;function upt(e,t){apt(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 ep({camera:e._sceneCamera,color:D.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new ep({camera:e._shadowMapCamera,color:D.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new ep({camera:e._passes[i].camera,color:lpt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=we.IDENTITY,r=e._pointLightRadius*2,s=m.fromElements(r,r,r,dpt),a=F.fromTranslationQuaternionRotationScale(i,o,s,ky);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=cpt(a,D.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new ep({camera:e._shadowMapCamera,color:D.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function vO(){this.viewMatrix=new F,this.inverseViewMatrix=new F,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new F}vO.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var mpt=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);vO.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(mpt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var hpt=new Array(5),fpt=new Ci,ppt=new Array(4),P_e=new m,v_e=new m;function bpt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,d=r/o,u=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,u=.9);let p=ppt,g=hpt;for(g[0]=o,g[s]=r,a=0;a<s;++a){let A=(a+1)/s,b=o*Math.pow(d,A),R=o+c*A,G=X.lerp(R,b,u);g[a+1]=G,p[a]=G-g[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let A=g[0];for(a=0;a<s-1;++a)A+=p[a],g[a+1]=A}re.unpack(g,0,e._cascadeSplits[0]),re.unpack(g,1,e._cascadeSplits[1]),re.unpack(p,0,e._cascadeDistances);let f=n.frustum,y=f.left,x=f.right,S=f.bottom,C=f.top,V=f.near,L=f.far,Z=n.positionWC,E=n.directionWC,P=n.upWC,W=i.frustum.clone(fpt),v=n.getViewProjection();for(a=0;a<s;++a){W.near=g[a],W.far=g[a+1];let A=F.multiply(W.projectionMatrix,i.viewMatrix,ky),b=F.inverse(A,ky),R=F.multiply(v,b,ky),G=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,P_e),I=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,v_e);for(let B=0;B<8;++B){let N=re.clone(sp[B],Q8[B]);F.multiplyByVector(R,N,N),m.divideByScalar(N,N.w,N),m.minimumByComponent(N,G,G),m.maximumByComponent(N,I,I)}G.x=Math.max(G.x,0),G.y=Math.max(G.y,0),G.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let w=e._passes[a],M=w.camera;M.clone(n);let O=M.frustum;O.left=y+G.x*(x-y),O.right=y+I.x*(x-y),O.bottom=S+G.y*(C-S),O.top=S+I.y*(C-S),O.near=V+G.z*(L-V),O.far=V+I.z*(L-V),w.cullingVolume=M.frustum.computeCullingVolume(Z,E,P);let k=e._cascadeMatrices[a];F.multiply(M.getViewProjection(),i.inverseViewMatrix,k),F.multiply(w.textureOffsets,k,k)}}var gpt=new F,ypt=new m,xpt=new m,E_e=new m;function _pt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,ky),r=F.inverse(o,ky),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,X.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,ypt);a=m.cross(c,s,xpt),m.normalize(a,a),m.normalize(c,c);let d=m.fromElements(0,0,0,E_e),u=F.computeView(d,s,a,c,gpt),h=F.multiply(u,r,ky),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,P_e),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,v_e);for(let L=0;L<8;++L){let Z=re.clone(sp[L],Q8[L]);F.multiplyByVector(h,Z,Z),m.divideByScalar(Z,Z.w,Z),m.minimumByComponent(Z,p,p),m.maximumByComponent(Z,g,g)}g.z+=1e3,p.z-=10;let f=E_e;f.x=-(.5*(p.x+g.x)),f.y=-(.5*(p.y+g.y)),f.z=-g.z;let y=F.fromTranslation(f,ky);u=F.multiply(y,u,u);let x=.5*(g.x-p.x),S=.5*(g.y-p.y),C=g.z-p.z,V=n.frustum;V.left=-x,V.right=x,V.bottom=-S,V.top=S,V.near=.01,V.far=C,F.clone(u,n.viewMatrix),F.inverse(u,n.inverseViewMatrix),F.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var Tpt=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],Spt=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],Cpt=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function Vpt(e,t){let n=new Ci;n.fov=X.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=Tpt[i],o.upWC=Spt[i],o.rightWC=Cpt[i],F.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),F.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Lpt=new m,Rpt=new m,w_e=new de,I_e=w_e.center;function Zpt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=w_e;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Lpt),s=m.negate(i.directionWC,Rpt),a=m.dot(r,s);if(e.fadingEnabled){let c=X.clamp(a/.1,0,1);e._darkness=X.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===Jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),de.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,r,I_e),I_e);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),de.clone(o,e._boundingSphere)}}function Gpt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,r.directionWC):e._isPointLight?m.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;F.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),m.normalize(s,s),m.negate(s,s),F.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=lo.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Zpt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}rp.prototype.update=function(e){if(Gpt(this,e),this._needsUpdate)if(ipt(this,e.context),this._isPointLight&&Vpt(this,e),this._cascadesEnabled&&(_pt(this,e),this._numberOfCascades>1&&bpt(this,e)),this._isPointLight)this._shadowMapCullingVolume=bs.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&upt(this,e)};rp.prototype.updatePass=function(e,t){W_e(this,e,t)};var Ept=new U;function F_e(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=Ept;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,re.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return re.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new re,combinedUniforms2:new re};return Rt(t,o,!1)}function Ipt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=$e.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Ge.GLOBE,h=n.pass!==Ge.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,f=op.getShadowCastShaderKeyword(p,u,g,h);if(s=i.shaderCache.getDerivedShaderProgram(d,f),!l(s)){let x=d.vertexShaderSource,S=d.fragmentShaderSource,C=op.createShadowCastVertexShader(x,p,u),V=op.createShadowCastFragmentShader(S,p,g,h);s=i.shaderCache.createDerivedShaderProgram(d,f,{vertexShaderSource:C,fragmentShaderSource:V,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Be(a,!1),a.cull=Be(a.cull,!1),a.cull.enabled=!1,a=Ue.fromCache(a)),c=F_e(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}rp.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,d=t.pass===Ge.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;l(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=$e.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(h)||f||n||g){let y=op.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(h=i.shaderCache.getDerivedShaderProgram(s,y),!l(h)){let x=op.createShadowReceiveVertexShader(a,d,u),S=op.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);h=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:x,fragmentShaderSource:S,attributeLocations:s._attributeLocations})}p=F_e(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};rp.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=Ipt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};rp.prototype.isDestroyed=function(){return!1};rp.prototype.destroy=function(){J8(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 me(this)};var _0=rp;var uki=_(T(),1);var D5i=_(T(),1),$F=`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 B5i=_(T(),1),aS=`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 Xpt=!1;function Uy(e){this._drawClassificationFBO=new pi({createDepthAttachments:!1}),this._accumulationFBO=new pi({createDepthAttachments:!1}),this._packFBO=new pi,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 ii({color:new D(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ii({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new ze,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(Uy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function A_e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function M_e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function Wpt(e,t,n,i){A_e(e),e._translucentDepthStencilTexture=new vt({context:t,width:n,height:i,pixelFormat:ot.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:tn.NEAREST})}function Ppt(e,t,n,i){M_e(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 vpt(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)&&(Wpt(e,t,o,r),Ppt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new De({sources:[$F]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new De({sources:[aS]}),a={colorTexture:function(){return e._textureToComposite}},Xpt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,h=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new De({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),g=$e.shallowClone(u);g.shaderProgram=p,u.derivedCommands.pick=g}l(e._copyCommand)||(s=new De({sources:[aS]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new De({sources:[aS]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!ze.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,ze.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=ze.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!ze.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!ze.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Bn.EQUAL,reference:Yt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!ze.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:fn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Uy.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,d.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){vpt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,!d.depthForTranslucentClassification)continue;let u=d.derivedCommands.depth.depthOnlyCommand;t(u,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};Uy.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Ge.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ge.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Ge.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(c[u],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};Uy.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),wpt(this,e,t)};function wpt(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}Uy.prototype.isSupported=function(){return this._supported};Uy.prototype.isDestroyed=function(){return!1};Uy.prototype.destroy=function(){return A_e(this),M_e(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()),me(this)};var eA=Uy;function Fpt(){this.command=void 0,this.near=void 0,this.far=void 0}function wO(e,t,n){let i=e.context,o;i.depthTexture&&(o=new YF);let r;e._useOIT&&i.depthTexture&&(r=new KF(i));let s=new ac(i);s.viewport=ze.clone(n),this.camera=t,this._cameraClone=lo.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new qF(i),this.pickDepthFramebuffer=new QF,this.sceneFramebuffer=new rS,this.globeDepth=o,this.globeTranslucencyFramebuffer=new zF,this.oit=r,this.translucentTileClassification=new eA(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var j8=new m,q8=new m;function Apt(e,t,n){let i=Math.max(m.maximumComponent(m.abs(e.position,j8)),m.maximumComponent(m.abs(t.position,q8))),o=1/Math.max(1,i);return m.multiplyByScalar(e.position,o,j8),m.multiplyByScalar(t.position,o,q8),m.equalsEpsilon(j8,q8,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}wO.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Apt(t,n,X.EPSILON15)?(this._cameraStartFired&&xi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=xi(),lo.clone(t,n),!0)};function Mpt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===oe.SCENE2D,d=t.nearToFarDistance2D;i*=1+X.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 u;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=u;for(let p=0;p<u;++p){let g,f;c?(g=Math.min(i-d,n+p*d),f=Math.min(i,g+d)):(g=Math.max(n,Math.pow(a,p)*n),f=Math.min(i,a*g));let y=h[p];l(y)?(y.near=g,y.far=f):y=h[p]=new BF(g,f)}}function Npt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,d=a.commandsInFrustums;d[c]=l(d[c])?d[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var N_e=new bs,kpt=new Pa;wO.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,d=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList;for(let v=0;v<u.length;++v)for(let A=0;A<Ge.NUMBER_OF_PASSES;++A)u[v].indices[A]=0;c.length=0,d.length=0;let h=this._commandExtents,p=h.length,g=0,f=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:x}=o,S=+Number.MAX_VALUE,C=-Number.MAX_VALUE,V=Number.MAX_VALUE,L=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:Z}=t,E=N_e.planes;for(let v=0;v<5;++v)E[v]=Z.planes[v];Z=N_e;for(let v=0;v<i.length;++v){let A=i[v],{pass:b,boundingVolume:R}=A;if(b===Ge.COMPUTE)c.push(A);else if(b===Ge.OVERLAY)d.push(A);else{let G,I;if(l(R)){if(!e.isVisible(Z,A,L))continue;let M=R.computePlaneDistances(r,s,kpt);if(G=M.start,I=M.stop,f=Math.min(f,G),y=Math.max(y,I),x&&A.receiveShadows&&G<_0.MAXIMUM_DISTANCE&&!(b===Ge.GLOBE&&G<-100&&I>100)){let O=I-G;b!==Ge.GLOBE&&G<100&&(V=Math.min(V,O)),S=Math.min(S,G),C=Math.max(C,I)}}else A instanceof ii?(G=a.near,I=a.far):(G=a.near,I=a.far,f=Math.min(f,G),y=Math.max(y,I));let w=h[g];l(w)||(w=h[g]=new Fpt),w.command=A,w.near=G,w.far=I,g++}}x&&(S=Math.min(Math.max(S,a.near),a.far),C=Math.max(Math.min(C,a.far),S),o.nearPlane=S,o.farPlane=C,o.closestObjectSize=V),Mpt(this,e,f,y);for(let v=0;v<g;v++)Npt(this,e,h[v]);if(g<p)for(let v=g;v<p;v++){let A=h[v];if(!l(A.command))break;A.command=void 0}let P=u.length,{frustumSplits:W}=t;W.length=P+1;for(let v=0;v<P;++v)W[v]=u[v].near,v===P-1&&(W[v+1]=u[v].far)};wO.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var cS=wO;var U_e=.1,Upt=new um({pass:Fo.MOST_DETAILED_PRELOAD}),Dpt=new um({pass:Fo.MOST_DETAILED_PICK}),tA=new um({pass:Fo.PICK});function da(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new ze(0,0,1,1),n=new lo(e);n.frustum=new un({width:U_e,aspectRatio:1,near:.1}),this._pickOffscreenView=new cS(e,n,t)}da.prototype.update=function(){this._pickPositionCacheDirty=!0};da.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new OF,n[t]=i),i};var Opt=new Ar,Bpt=new m,FO=new m,Ypt=new U,zpt=new F;function Hpt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let d=2*(o.height-t.y-o.y)/o.height-1;d*=(s.top-s.bottom)*.5;let u=F.clone(r.transform,zpt);r._setTransform(F.IDENTITY);let h=m.clone(r.position,Bpt);m.multiplyByScalar(r.right,c,FO),m.add(FO,h,h),m.multiplyByScalar(r.up,d,FO),m.add(FO,h,h),r._setTransform(u),e.mode===oe.SCENE2D&&m.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,Ypt),g=Opt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(h,r.directionWC,r.upWC)}var Kpt=new Qc,Jpt=new U;function Qpt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),d=s.aspectRatio*c,u=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,g=h*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,Jpt),y=f.x*n*.5,x=f.y*i*.5,S=Kpt;return S.top=g+x,S.bottom=g-x,S.right=p+y,S.left=p-y,S.near=a,S.far=s.far,S.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function AO(e,t,n,i,o){let r=e.camera.frustum;return r instanceof un||r instanceof Ar?Hpt(e,t,n,i,o):Qpt(e,t,n,i,o)}var MO=new ze(0,0,3,3),NO=new U,nA=new D(0,0,0,0);function $8(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}da.prototype.pick=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=ze.clone(a,d.viewport);let u=Oi.transformWindowToDrawingBuffer(e,t,NO),h=$8(o.drawingBufferHeight,u,n,i,MO);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=AO(e,u,h.width,h.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=tA,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(h,a),e.updateAndExecuteCommands(d,nA),e.resolveFramebuffers(d);let p=c.end(h);return o.endFrame(),p};da.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=ze.clone(a,d.viewport);let u=Oi.transformWindowToDrawingBuffer(e,t,NO),h=$8(o.drawingBufferHeight,u,n,i,MO);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=AO(e,u,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=tA,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(h,a),e.updateAndExecuteCommands(d,nA),e.resolveFramebuffers(d);let p=c.readCenterPixel(h);return o.endFrame(),p};da.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=ze.clone(s,c.viewport);let d=Oi.transformWindowToDrawingBuffer(e,t,NO),u=$8(i.drawingBufferHeight,d,1,1,MO);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=AO(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=tA,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,nA);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=h;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,DF.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function jpt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=ze.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=AO(e,t,1,1,s),o.tilesetPassState=tA,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,nA),e.resolveFramebuffers(c),i.endFrame()}var qpt=new Ci,$pt=new Qc,ebt=new un,tbt=new Ar;da.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let d=Oi.transformWindowToDrawingBuffer(e,t,NO);e.pickTranslucentDepth?jpt(e,d):(e.updateFrameState(),c.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;l(s.frustum.fov)?u=s.frustum.clone(qpt):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone($pt):l(s.frustum.width)?u=s.frustum.clone(ebt):u=s.frustum.clone(tbt);let{frustumCommandsList:h}=a,p=h.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(o,d.x,d.y);if(l(y)&&y>0&&y<1){let x=h[g],S;return e.mode===oe.SCENE2D?(S=s.position.z,s.position.z=S-x.near+1,u.far=Math.max(1,x.far-x.near),u.near=1,c.update(r),c.updateFrustum(u)):(u.near=x.near*(g!==0?e.opaqueFrustumNearOffset:1),u.far=x.far,c.updateFrustum(u)),n=Oi.drawingBufferToWorldCoordinates(e,d,y,n),e.mode===oe.SCENE2D&&(s.position.z=S,c.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var nbt=new he;da.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==oe.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,nbt);o.cartographicToCartesian(r,n)}return n};function D_e(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let d=c.object,u=c.position,h=c.exclude;if(l(u)&&!l(d)){o.push(c);break}if(!l(d)||!l(d.primitive)||!h&&(o.push(c),0>=--e))break;let p=d.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(d.id)&&(i=p.getGeometryInstanceAttributes(d.id),l(i)&&l(i.show)&&(g=!0,i.show=Sn.toValue(!1,i.show),s.push(i))),d instanceof js&&(g=!0,d.show=!1,a.push(d)),g||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=Sn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}da.prototype.drillPick=function(e,t,n,i,o){let r=this;return D_e(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var k_e=new m,ibt=new m;function obt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function O_e(e,t,n,i){let o=t.direction,r=m.mostOrthogonalAxis(o,k_e),s=m.cross(o,r,k_e),a=m.cross(o,s,ibt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??U_e,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function rbt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=O_e(e,o,r,a),d=Upt;d.camera=a,d.cullingVolume=c;let u=!0,h=s.length;for(let p=0;p<h;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}da.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)rbt(this,e,t[n])&&t.splice(n--,1)};function B_e(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof ml&&B_e(o,t,n))}}function kO(e,t,n,i,o,r){let s=[];if(B_e(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new obt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function sbt(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 abt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,O_e(e,n,o,u.camera);let h=ze.clone(u.viewport,MO),p=u.pickFramebuffer.begin(h,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=Dpt:c.tilesetPassState=tA,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,nA),t.resolveFramebuffers(p);let g,f=u.pickFramebuffer.end(h);if(t.context.depthTexture){let{frustumCommandsList:y}=u,x=y.length;for(let S=0;S<x;++S){let V=e.getPickDepth(t,S).getDepth(a,0,0);if(l(V)&&V>0&&V<1){let L=y[S],Z=L.near*(S!==0?t.opaqueFrustumNearOffset:1),E=L.far,P=Z+V*(E-Z);g=yn.getPoint(n,P);break}}}if(t.view=t.defaultView,a.endFrame(),l(f)||l(g))return{object:f,position:g,exclude:!l(g)&&r||sbt(f,i)}}function Y_e(e,t,n,i,o,r,s,a){return D_e(i,function(){return abt(e,t,n,o,r,s,a)})}function VL(e,t,n,i,o,r,s){let a=Y_e(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function z_e(e,t,n,i,o,r,s,a){return Y_e(e,t,n,i,o,r,s,a)}function UO(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)})})}da.prototype.pickFromRay=function(e,t,n,i){return VL(this,e,t,n,i,!1,!1)};da.prototype.drillPickFromRay=function(e,t,n,i,o){return z_e(this,e,t,n,i,o,!1,!1)};da.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=yn.clone(t),n=l(n)?n.slice():n,UO(e,kO(o,e,t,n,i,function(){return VL(o,e,t,n,i,!1,!0)}))};da.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=yn.clone(t),i=l(i)?i.slice():i,UO(e,kO(r,e,t,i,o,function(){return z_e(r,e,t,n,i,o,!1,!0)}))};var cbt=new m,lbt=new m,dbt=new yn,H_e=new he;function e7(e,t){let n=e.ellipsoid,i=ui._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,lbt),r=he.toCartesian(t,n,cbt),s=dbt;s.origin=r,s.direction=o;let a=new yn;return yn.getPoint(s,i,a.origin),m.negate(o,a.direction),a}function K_e(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,H_e);return e7(e,i)}function J_e(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,H_e).height}function ubt(e,t,n,i,o){let r=e7(t,n);return kO(e,t,r,i,o,function(){let s=VL(e,t,r,i,o,!0,!0);if(l(s))return J_e(t,s.position)})}function mbt(e,t,n,i,o,r){let s=K_e(t,n);return kO(e,t,s,i,o,function(){let a=VL(e,t,s,i,o,!0,!0);if(l(a))return m.clone(a.position,r)})}da.prototype.sampleHeight=function(e,t,n,i){let o=e7(e,t),r=VL(this,e,o,n,i,!0,!1);if(l(r))return J_e(e,r.position)};da.prototype.clampToHeight=function(e,t,n,i,o){let r=K_e(e,t),s=VL(this,e,r,n,i,!0,!1);if(l(s))return m.clone(s.position,o)};da.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=ubt(this,e,t[s],n,i);return UO(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};da.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=mbt(this,e,t[s],n,i,t[s]);return UO(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};da.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var iA=da;var vOi=_(T(),1);var cOi=_(T(),1);var lUi=_(T(),1),oA=`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 uUi=_(T(),1),rA=`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 hUi=_(T(),1),sA=`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 pUi=_(T(),1),aA=`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 gUi=_(T(),1),cA=`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 xUi=_(T(),1),lA=`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 TUi=_(T(),1),dA=`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 CUi=_(T(),1),uA=`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 LUi=_(T(),1),mA=`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 ZUi=_(T(),1),hA=`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 EUi=_(T(),1),fA=`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 XUi=_(T(),1),pA=`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 PUi=_(T(),1),bA=`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 wUi=_(T(),1),Dy=`#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 AUi=_(T(),1),gA=`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 NUi=_(T(),1),yA=`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 UUi=_(T(),1),xA=`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 OUi=_(T(),1),_A=`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 YUi=_(T(),1),TA=`uniform sampler2D colorTexture;
|
|
|
uniform sampler2D silhouetteTexture;
|
|
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
|
|
void main(void)
|
|
|
{
|
|
|
vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);
|
|
|
vec4 color = texture(colorTexture, v_textureCoordinates);
|
|
|
out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
|
|
|
}
|
|
|
`;var HUi=_(T(),1);/**
|
|
|
* @license
|
|
|
* Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
|
|
|
*
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
* are met:
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
* * Neither the name of NVIDIA CORPORATION nor the names of its
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
* from this software without specific prior written permission.
|
|
|
*
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
|
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
*/var SA=`/**
|
|
|
* @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 FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/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 nDi=_(T(),1);function lS(){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 pi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new U,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(lS.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 Q_e(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 hbt(e,t){Q_e(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new pi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function j_e(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 fbt(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 pbt(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 bbt(e,t){j_e(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(pbt(r,i),{framebuffer:n[r].framebuffer,uniformMap:fbt(e,r)});e._commands=o}lS.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ii({color:new D(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};lS.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,hbt(this,e),bbt(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};lS.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)};lS.prototype.isDestroyed=function(){return!1};lS.prototype.destroy=function(){return Q_e(this),j_e(this),me(this)};var CA=lS;var LDi=_(T(),1);var oDi=_(T(),1),gbt={NEAREST:0,LINEAR:1},nu=gbt;function dS(e){e=e??Y.EMPTY_OBJECT;let{name:t=Hn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=nu.NEAREST,pixelFormat:a=ot.RGBA,pixelDatatype:c=je.UNSIGNED_BYTE,clearColor:d=D.BLACK,scissorRectangle:u}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=d,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let h=new ac;h.scissorTest={enabled:!0,rectangle:l(u)?ze.clone(u):new ze},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(dS.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 ybt=/uniform\s+sampler2D\s+depthTexture/g;dS.prototype._isSupported=function(e){return!ybt.test(this._fragmentShader)||e.depthTexture};function xbt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof vt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${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):s[n]=o}}}function _bt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Tbt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Sbt(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]=_bt(e,r),n[r]=xbt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof vt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=Tbt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Rt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Cbt(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 Vbt(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=Cbt(n,o)}let i=new De({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Lbt(e){let t=e._sampleMode,n,i;t===nu.LINEAR?(n=en.LINEAR,i=fi.LINEAR):(n=en.NEAREST,i=fi.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new tn({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Rbt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Zbt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Gbt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:d}=i[a];e._actualUniforms[c]=new vt({context:t,source:d})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],d=r[c],u=e._textureCache.getStageByName(d);if(l(u))e._actualUniforms[c]=Zbt(e,d);else if(typeof d=="string"){let h=new Re({url:d});s.push(h.fetchImage().then(Rbt(e,c)))}else e._texturesToCreate.push({name:c,source:d})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function q_e(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 Ebt(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 Ibt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];l(a.pickIds)?i+=a.pickIds.length:l(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new vt({context:t,pixelFormat:ot.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:tn.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,d=c.length;for(let u=0;u<d;++u){let h=c[u].color;r[o]=D.floatToByte(h.red),r[o+1]=D.floatToByte(h.green),r[o+2]=D.floatToByte(h.blue),r[o+3]=D.floatToByte(h.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=D.floatToByte(c.red),r[o+1]=D.floatToByte(c.green),r[o+2]=D.floatToByte(c.blue),r[o+3]=D.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new vt({context:t,pixelFormat:ot.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:tn.NEAREST})}dS.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&q_e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Ebt(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,Ibt(this,e),Sbt(this),Gbt(this,e),Vbt(this,e),Lbt(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=Ue.fromCache({viewport:new ze(0,0,i.width,i.height)}))),this._command.renderState=o};dS.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,tn.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)};dS.prototype.isDestroyed=function(){return!1};dS.prototype.destroy=function(){return q_e(this),me(this)};var go=dS;var XDi=_(T(),1);function uS(e){e=e??Y.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Hn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(uS.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}}});uS.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};uS.prototype.get=function(e){return this._stages[e]};function Xbt(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}uS.prototype.update=function(e,t){this._selectedDirty=Xbt(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)}};uS.prototype.isDestroyed=function(){return!1};uS.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var nd=uS;var Pr={};function t7(e){let o=`#define USE_STEP_SIZE
|
|
|
${Dy}`,r=new go({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:nu.LINEAR}),s=new go({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:nu.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=c}}}),new nd({name:e,stages:[r,s],uniforms:a})}Pr.createBlurStage=function(){return t7("czm_blur")};Pr.createDepthOfFieldStage=function(){let e=t7("czm_depth_of_field_blur"),t=new go({name:"czm_depth_of_field_composite",fragmentShader:uA,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new nd({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Pr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Pr.createEdgeDetectionStage=function(){let e=Hn();return new go({name:`czm_edge_detection_${e}`,fragmentShader:hA,uniforms:{length:.25,color:D.clone(D.BLACK)}})};Pr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Wbt(e){if(!l(e))return Pr.createEdgeDetectionStage();let t=new nd({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a};
|
|
|
`,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates);
|
|
|
if (edge${a}.a > 0.0)
|
|
|
{
|
|
|
color = edge${a};
|
|
|
break;
|
|
|
}
|
|
|
`,n[`edgeTexture${a}`]=e[a].name;let r=`${i}in vec2 v_textureCoordinates;
|
|
|
void main() {
|
|
|
vec4 color = vec4(0.0);
|
|
|
for (int i = 0; i < ${e.length}; i++)
|
|
|
{
|
|
|
${o} }
|
|
|
out_FragColor = color;
|
|
|
}
|
|
|
`,s=new go({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new nd({name:"czm_edge_detection_composite",stages:[t,s]})}Pr.createSilhouetteStage=function(e){let t=Wbt(e),n=new go({name:"czm_silhouette_color_edges",fragmentShader:TA,uniforms:{silhouetteTexture:t.name}});return new nd({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Pr.isSilhouetteSupported=function(e){return e.context.depthTexture};Pr.createBloomStage=function(){let e=new go({name:"czm_bloom_contrast_bias",fragmentShader:dA,uniforms:{contrast:128,brightness:-.3}}),t=t7("czm_bloom_blur"),n=new nd({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new go({name:"czm_bloom_generate_composite",fragmentShader:cA,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new nd({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Pr.createAmbientOcclusionStage=function(){let e=new go({name:"czm_ambient_occlusion_generate",fragmentShader:rA,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new go({name:"czm_ambient_occlusion_composite",fragmentShader:sA,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new nd({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Pr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var Pbt=`#define FXAA_QUALITY_PRESET 39
|
|
|
${SA}
|
|
|
${bA}`;Pr.createFXAAStage=function(){return new go({name:"czm_FXAA",fragmentShader:Pbt,sampleMode:nu.LINEAR})};Pr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
|
`:"";return t+=oA,new go({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
|
`:"";return t+=fA,new go({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
|
`:"";return t+=pA,new go({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
|
`:"";return t+=_A,new go({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
|
`:"";return t+=yA,new go({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:D.WHITE,autoExposure:void 0,exposure:1}})};Pr.createAutoExposureStage=function(){return new CA};Pr.createBlackAndWhiteStage=function(){return new go({name:"czm_black_and_white",fragmentShader:aA,uniforms:{gradations:5}})};Pr.createBrightnessStage=function(){return new go({name:"czm_brightness",fragmentShader:lA,uniforms:{brightness:.5}})};Pr.createNightVisionStage=function(){return new go({name:"czm_night_vision",fragmentShader:xA})};Pr.createDepthViewStage=function(){return new go({name:"czm_depth_view",fragmentShader:mA})};Pr.createLensFlareStage=function(){return new go({name:"czm_lens_flare",fragmentShader:gA,uniforms:{dirtTexture:sn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:sn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ne.WGS84.maximumRadius}})};var iu=Pr;var bOi=_(T(),1);function T0(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function LA(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function n7(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[LA(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let d=0;d<c;++d){let u=s[a[d]];if(typeof u=="string"){let h=e.getStageByName(u);l(h)&&(r[LA(h)]=!0)}}}return i.name}function VA(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let h=0;h<c;++h){let p=i.get(h);l(p.length)?a=VA(e,t,n,p,o):a=n7(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=LA(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=LA(i.get(d));let h=n[u];for(let p=0;p<d;++p)h[LA(i.get(p))]=!0}return a}function vbt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=VA(e,t,n,i,void 0);a=VA(e,t,n,o,a),a=n7(e,t,n,r,a),a=VA(e,t,n,e,a),n7(e,t,n,s,a)}else VA(e,t,n,e,void 0);return n}function wbt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,d=o._clearColor,u,h,p=e._framebuffers,g=p.length;for(u=0;u<g;++u){if(h=p[u],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||c!==h.pixelDatatype||!D.equals(d,h.clearColor))continue;let f=h.stages,y=f.length,x=!1;for(let S=0;S<y;++S)if(n[f[S]]){x=!0;break}if(!x)break}return l(h)&&u<g?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new pi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(h),h)}function Fbt(e,t){let n=vbt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=wbt(e,i,n[i]))}function i7(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function Abt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,d=Math.ceil(n*c),u=Math.ceil(i*c),h=Math.min(d,u);a.forcePowerOfTwo&&(X.isPowerOfTwo(h)||(h=X.nextPowerOfTwo(h)),d=h,u=h),a.buffer.update(t,d,u),a.clear=new ii({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}T0.prototype.updateDependencies=function(){this._updateDependencies=!0};T0.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(i7(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&Fbt(this,e);let c=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==c||this._height!==d;!n&&!u||(this._width=c,this._height=d,this._updateDependencies=!1,i7(this),Abt(this,e))};T0.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};T0.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};T0.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};T0.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};T0.prototype.isDestroyed=function(){return!1};T0.prototype.destroy=function(){return i7(this),me(this)};var mS=T0;var yOi=_(T(),1),Mbt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var S0=Object.freeze(Mbt);var o7=[];function gl(){let e=iu.createFXAAStage(),t=iu.createAmbientOcclusionStage(),n=iu.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=iu.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=S0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new mS(this),r={},s=o7;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let d=c.length;if(l(d))for(let u=0;u<d;++u)s.push(c.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(gl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return r7(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case S0.REINHARD:n=iu.createReinhardTonemappingStage(t);break;case S0.MODIFIED_REINHARD:n=iu.createModifiedReinhardTonemappingStage(t);break;case S0.FILMIC:n=iu.createFilmicTonemappingStage(t);break;case S0.PBR_NEUTRAL:n=iu.createPbrNeutralTonemappingStage(t);break;default:n=iu.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 r7(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}gl.prototype.add=function(e){let t=this._stageNames,n=o7;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};gl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=o7;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};gl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};gl.prototype.get=function(e){return r7(this),this._stages[e]};gl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};gl.prototype.getStageByName=function(e){return this._stageNames[e]};gl.prototype.update=function(e,t,n){r7(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let S=0;S<r.length;++S){let C=r[S];C.ready&&C.enabled&&C._isSupported(e)&&(o[s++]=C)}o.length=s;let a=s!==i.length;if(!a){for(let S=0;S<s;++S)if(o[S]!==i[S]){a=!0;break}}let c=this._ao,d=this._bloom,u=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let g=c.enabled&&c._isSupported(e),f=d.enabled&&d._isSupported(e),y=h.enabled&&h._isSupported(e),x=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||f!==this._bloomEnabled||y!==this._tonemappingEnabled||x!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=f,this._tonemappingEnabled=y,this._fxaaEnabled=x,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let C=new Uint8Array(196608);for(let V=0;V<196608;V+=3)C[V]=Math.floor(Math.random()*255);this._randomTexture=new vt({context:e,pixelFormat:ot.RGB,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:C,width:256,height:256},sampler:new tn({wrapS:Ln.REPEAT,wrapT:Ln.REPEAT,minificationFilter:en.NEAREST,magnificationFilter:fi.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),d.update(e,t),h.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let S=0;S<r.length;++S)r[S].update(e,t);s=0;for(let S=0;S<r.length;++S){let C=r[S];C.ready&&C.enabled&&C._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};gl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function hS(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}gl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return hS(t)};function ap(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){ap(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)ap(e.get(r),t,hS(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)ap(e.get(r),t,n,i,o)}gl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,d=this._autoExposure,u=this._tonemapping,h=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!h&&!p&&!f&&r===0)return;let x=t;h&&a.ready&&(ap(a,e,x,n,i),x=hS(a)),p&&c.ready&&(ap(c,e,x,n,i),x=hS(c)),g&&d.ready&&ap(d,e,x,n,i),f&&u.ready&&(ap(u,e,x,n,i),x=hS(u));let S=x;if(r>0){ap(o[0],e,x,n,i);for(let C=1;C<r;++C)ap(o[C],e,hS(o[C-1]),n,i);S=hS(o[r-1])}y&&s.ready&&ap(s,e,S,n,i)};gl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(td,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};gl.prototype.isDestroyed=function(){return!1};gl.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(),me(this)};var RA=gl;var qOi=_(T(),1);function fS(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}fS.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};fS.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof un,!(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(F.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?g0t(this,e):V0t(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Nbt=new m,kbt=new m,Ubt=new m,Dbt=new m,Obt=new m,Bbt=new m,Ybt=new m,zbt=new he,Hbt=new F,Kbt=new Ci,Jbt=new un,Qbt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};fS.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(F.IDENTITY);let i=Nbt,o=kbt,r=Ubt;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,o),o),m.cross(m.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===oe.SCENE2D)m.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,m.negate(m.UNIT_Z,o),m.clone(m.UNIT_Y,r);else{m.clone(d.positionWC,i),m.clone(d.directionWC,o),m.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,Ybt),h=Ft.eastNorthUpToFixedFrame(u,t,Hbt);F.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,zbt),i),F.multiplyByPointAsVector(h,o,o),F.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=Jbt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Kbt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=X.toRadians(60));let a=Qbt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=R0t(a);ZA(this,c),this._previousMode===oe.SCENE2D?L0t(this,e,a,c):(a.position2D=F.multiplyByPoint(lo.TRANSFORM_2D,i,Dbt),a.direction2D=F.multiplyByPointAsVector(lo.TRANSFORM_2D,o,Obt),a.up2D=F.multiplyByPointAsVector(lo.TRANSFORM_2D,r,Bbt),n._mode=oe.MORPHING,lTe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var c7={position:new m,direction:new m,up:new m,frustum:void 0},eTe=new Ci;fS.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(F.IDENTITY),this._previousMode===oe.SCENE2D)a0t(this,e,t);else{let i;e>0?(i=c7,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=tTe(this,t);let o,r=n.camera;r.frustum instanceof un?o=r.frustum.clone():(o=eTe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=X.toRadians(60)),i.frustum=o;let s=uTe(i);ZA(this,s),a7(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};fS.prototype.isDestroyed=function(){return!1};fS.prototype.destroy=function(){return DO(this),me(this)};function ZA(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Td(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Tn.LEFT_DOWN),e._morphHandler.setInputAction(n,Tn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Tn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Tn.WHEEL)}}function DO(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 jbt=new he,qbt=new m,$bt=new F;function tTe(e,t){let n=e._scene,i=n.camera,o=c7,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,jbt);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,qbt),u=Ft.eastNorthUpToFixedFrame(d,t,$bt);return F.multiplyByPointAsVector(u,i.direction,s),F.multiplyByPointAsVector(u,i.up,a),o}var e0t=new m,t0t=new m,n0t=new m,i0t=new m,o0t=new m,r0t=new m;function a7(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(r.position,e0t),a=m.clone(r.direction,t0t),c=m.clone(r.up,n0t),d=F.multiplyByPoint(lo.TRANSFORM_2D_INVERSE,n.position,i0t),u=F.multiplyByPointAsVector(lo.TRANSFORM_2D_INVERSE,n.direction,o0t),h=F.multiplyByPointAsVector(lo.TRANSFORM_2D_INVERSE,n.up,r0t);function p(f){hm(s,d,f.time,r.position),hm(a,u,f.time,r.direction),hm(c,h,f.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){dTe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var s0t=new un,nTe=new m,iTe=new m,oTe=new m,l7=new m,rTe=new m,sTe=new m;function a0t(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=c7,m.fromDegrees(0,0,5*n.maximumRadius,n,r.position),m.negate(r.position,r.direction),m.normalize(r.direction,r.direction),m.clone(m.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=tTe(e,n));let s;e._morphToOrthographic?(s=s0t,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=eTe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=X.toRadians(60)),r.frustum=s;let a=uTe(r);ZA(e,a);let c;e._morphToOrthographic?c=function(){a7(e,t,r,a)}:c=function(){cTe(e,t,r,function(){a7(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,l7),complete:function(){i._mode=oe.MORPHING,c()}})):c()}function hm(e,t,n,i){return m.lerp(e,t,n,i)}function aTe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof un)return;let a=s.frustum.fov,c=X.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(c*.5)+1e7;function u(p){s.frustum.fov=X.lerp(a,c,p.time);let g=d/Math.tan(s.frustum.fov*.5);i(s,g)}let h=r.tweens.add({duration:t,easingFunction:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var c0t=new m,l0t=new m,d0t=new m,s7=new m,u0t=new m,m0t=new m,h0t=new Ar,f0t=new yn,p0t=new m,b0t={position:void 0,direction:void 0,up:void 0,frustum:void 0};function g0t(e,t){t*=.5;let n=e._scene,i=n.camera,o=m.clone(i.position,c0t),r=m.clone(i.direction,l0t),s=m.clone(i.up,d0t),a=m.negate(m.UNIT_Z,u0t),c=m.clone(m.UNIT_Y,m0t),d=s7;if(t>0)m.clone(m.ZERO,s7),d.z=5*n.ellipsoid.maximumRadius;else{m.clone(o,s7);let x=f0t;F.multiplyByPoint(lo.TRANSFORM_2D,o,x.origin),F.multiplyByPointAsVector(lo.TRANSFORM_2D,r,x.direction);let S=n.globe;if(l(S)){let C=S.pickWorldCoordinates(x,n,!0,p0t);l(C)&&(F.multiplyByPoint(lo.TRANSFORM_2D_INVERSE,C,d),d.z+=m.distance(o,d))}}let u=h0t;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let h=b0t;h.position=d,h.direction=a,h.up=c,h.frustum=u;let p=mTe(h);ZA(e,p);function g(x){hm(o,d,x.time,i.position),hm(r,a,x.time,i.direction),hm(s,c,x.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(x,S){x.position.z=S}let y=n.tweens.add({duration:t,easingFunction:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){aTe(e,t,h,f,p)}});e._currentTweens.push(y)}var $_e=new he,y0t={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new Ar},x0t={position:new m,direction:new m,up:new m,frustum:void 0},_0t=new m,T0t=new yn,S0t=new F,C0t=new m;function V0t(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=y0t;if(t>0)m.clone(m.ZERO,r.position),r.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,$_e),i.mapProjection.project($_e,r.position),m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);let h=T0t;m.clone(r.position2D,h.origin);let p=m.clone(o.directionWC,h.direction),g=n.scaleToGeodeticSurface(o.positionWC,C0t),f=Ft.eastNorthUpToFixedFrame(g,n,S0t);F.inverseTransformation(f,f),F.multiplyByPointAsVector(f,p,p),F.multiplyByPointAsVector(lo.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let x=y.pickWorldCoordinates(h,i,!0,_0t);if(l(x)){let S=m.distance(r.position2D,x);x.x+=S,m.clone(x,r.position2D)}}}function s(h,p){h.position.x=p}F.multiplyByPoint(lo.TRANSFORM_2D,r.position,r.position2D),F.multiplyByPointAsVector(lo.TRANSFORM_2D,r.direction,r.direction2D),F.multiplyByPointAsVector(lo.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=x0t;F.multiplyByPoint(lo.TRANSFORM_2D_INVERSE,r.position2D,c.position),m.clone(r.direction,c.direction),m.clone(r.up,c.up),c.frustum=a;let d=mTe(c);ZA(e,d);function u(){aTe(e,t,r,s,d)}lTe(e,t,r,u)}function cTe(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=X.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(c*.5)+1e7,r.frustum.fov=c;function u(p){r.frustum.fov=X.lerp(c,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(h)}function L0t(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(n.position,l7),a=m.clone(n.direction,rTe),c=m.clone(n.up,sTe);o._mode=oe.MORPHING;function d(){r.frustum=n.frustum.clone();let u=m.clone(r.position,nTe),h=m.clone(r.direction,iTe),p=m.clone(r.up,oTe);u.z=s.z;function g(y){hm(u,s,y.time,r.position),hm(h,a,y.time,r.direction),hm(p,c,y.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():cTe(e,0,n,d)}function lTe(e,t,n,i){let o=e._scene,r=o.camera,s=m.clone(r.position,nTe),a=m.clone(r.direction,iTe),c=m.clone(r.up,oTe),d=m.clone(n.position2D,l7),u=m.clone(n.direction2D,rTe),h=m.clone(n.up2D,sTe);function p(f){hm(s,d,f.time,r.position),hm(a,u,f.time,r.direction),hm(c,h,f.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){dTe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function dTe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:kr.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function uTe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),DO(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE3D,r)}}function mTe(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),DO(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE2D,o)}}function R0t(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),DO(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.COLUMBUS_VIEW,r)}}var GA=fS;var z3i=_(T(),1);var d3i=_(T(),1);var e3i=_(T(),1),Z0t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Mi=Object.freeze(Z0t);function ua(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function G0t(e,t){U.clone(e.distance.startPosition,t.distance.startPosition),U.clone(e.distance.endPosition,t.distance.endPosition),U.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),U.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function hTe(e,t,n){let i=ua(Mi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new U;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new U,endPosition:new U},d.angleAndHeight={startPosition:new U,endPosition:new U},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,U.lerp(u.position1,u.position2,.5,s[i])},Tn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Tn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(G0t(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(U.clone(u.distance.endPosition,d.distance.endPosition),U.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let h=d.angleAndHeight.endPosition.x,p=d.prevAngle,g=Math.PI*2;for(;h>=p+Math.PI;)h-=g;for(;h<p-Math.PI;)h+=g;d.angleAndHeight.endPosition.x=-h*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Tn.PINCH_MOVE,t)}function fTe(e,t){let n=ua(Mi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new U,endPosition:new U,valid:!1}),s.startPosition=new U,U.clone(U.ZERO,s.startPosition),s.endPosition=new U,e._eventHandler.setInputAction(function(c){let d=7.5*X.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=d,U.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Tn.WHEEL,t)}function LL(e,t,n){let i=ua(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new U;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new U,endPosition:new U,valid:!1});let c,d;n===Mi.LEFT_DRAG?(c=Tn.LEFT_DOWN,d=Tn.LEFT_UP):n===Mi.RIGHT_DRAG?(c=Tn.RIGHT_DOWN,d=Tn.RIGHT_UP):n===Mi.MIDDLE_DRAG&&(c=Tn.MIDDLE_DOWN,d=Tn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,U.clone(u.position,r[i])},c,t),e._eventHandler.setInputAction(function(){d7(ua(n,void 0),e);for(let u of Object.values(Js)){let h=ua(n,u);d7(h,e)}},d,t)}function d7(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 pTe(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function E0t(e,t,n){let i=n._isDown,o=!1,r=ua(e,t);for(let[c,d]of Object.entries(i))c.startsWith(e)&&d&&c!==r&&(o=!0,d7(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new U,endPosition:new U,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function bTe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Mi)if(Mi.hasOwnProperty(s)){let a=Mi[s];if(l(a)){let c=ua(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new U,endPosition:new U,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new U,endPosition:new U})}}e._eventHandler.setInputAction(function(s){for(let a in Mi)if(Mi.hasOwnProperty(a)){let c=Mi[a];if(l(c)){let d=ua(c,t);E0t(c,t,e),r[d]&&(n[d]?(pTe(i[d],o[d]),o[d].valid=!0,pTe(s,i[d]),n[d]=!1):U.clone(s.endPosition,i[d].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},Tn.MOUSE_MOVE,t)}function fm(e){this._eventHandler=new Td(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,fTe(this,void 0),hTe(this,void 0,e),LL(this,void 0,Mi.LEFT_DRAG),LL(this,void 0,Mi.RIGHT_DRAG),LL(this,void 0,Mi.MIDDLE_DRAG),bTe(this,void 0);for(let t in Js)if(Js.hasOwnProperty(t)){let n=Js[t];l(n)&&(fTe(this,n),hTe(this,n,e),LL(this,n,Mi.LEFT_DRAG),LL(this,n,Mi.RIGHT_DRAG),LL(this,n,Mi.MIDDLE_DRAG),bTe(this,n))}}Object.defineProperties(fm.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[ua(Mi.WHEEL)]||!this._update[ua(Mi.WHEEL,Js.SHIFT)]||!this._update[ua(Mi.WHEEL,Js.CTRL)]||!this._update[ua(Mi.WHEEL,Js.ALT)];return this._buttonsDown>0||e}}});fm.prototype.isMoving=function(e,t){let n=ua(e,t);return!this._update[n]};fm.prototype.getMovement=function(e,t){let n=ua(e,t);return this._movement[n]};fm.prototype.getLastMovement=function(e,t){let n=ua(e,t),i=this._lastMovement[n];if(i.valid)return i};fm.prototype.isButtonDown=function(e,t){let n=ua(e,t);return this._isDown[n]};fm.prototype.getStartMousePosition=function(e,t){if(e===Mi.WHEEL)return this._currentMousePosition;let n=ua(e,t);return this._eventStartPosition[n]};fm.prototype.getButtonPressTime=function(e,t){let n=ua(e,t);return this._pressTime[n]};fm.prototype.getButtonReleaseTime=function(e,t){let n=ua(e,t);return this._releaseTime[n]};fm.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};fm.prototype.isDestroyed=function(){return!1};fm.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),me(this)};var EA=fm;var x3i=_(T(),1);function OO(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=Be(n),this._stopObject=Be(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(OO.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}}});OO.prototype.cancelTween=function(){this._tweens.remove(this)};function Dh(){this._tweens=[]}Object.defineProperties(Dh.prototype,{length:{get:function(){return this._tweens.length}}});Dh.prototype.add=function(e){if(e=e??Y.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new OO(this);let t=e.duration/Jn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Jn.SECONDS_PER_MILLISECOND,o=e.easingFunction??kr.LINEAR_NONE,r=e.startObject,s=new ore(r);s.to(Be(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new OO(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Dh.prototype.addProperty=function(e){e=e??Y.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Dh.prototype.addAlpha=function(e){e=e??Y.EMPTY_OBJECT;let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Dh.prototype.addOffsetIncrement=function(e){e=e??Y.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})};Dh.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};Dh.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};Dh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Dh.prototype.get=function(e){return this._tweens[e]};Dh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Jn.SECONDS_PER_MILLISECOND:xi();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var pS=Dh;function XA(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=Mi.LEFT_DRAG,this.zoomEventTypes=[Mi.RIGHT_DRAG,Mi.WHEEL,Mi.PINCH],this.rotateEventTypes=Mi.LEFT_DRAG,this.tiltEventTypes=[Mi.MIDDLE_DRAG,Mi.PINCH,{eventType:Mi.LEFT_DRAG,modifier:Js.CTRL},{eventType:Mi.RIGHT_DRAG,modifier:Js.CTRL}],this.lookEventTypes={eventType:Mi.LEFT_DRAG,modifier:Js.SHIFT};let t=e.ellipsoid??ne.default;this.minimumPickingTerrainHeight=ne.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ne.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ne.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ne.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 EA(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 pS,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new U(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new U(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new U,this._strafeEndMousePosition=new U,this._zoomMouseStart=new U(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._panLastMousePosition=new U,this._panLastWorldPosition=new m,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,X.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 I0t(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function X0t(e){return U.equalsEpsilon(e.startPosition,e.endPosition,X.EPSILON14)}var W0t=.4;function P0t(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new U,endPosition:new U,motion:new U,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=c&&d&&(d.getTime()-c.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(c&&d&&u<W0t){let g=I0t(p,i),f=e.getLastMovement(t,n);if(!l(f)||X0t(f)||!a.inertiaEnabled||(a.motion.x=(f.endPosition.x-f.startPosition.x)*.5,a.motion.y=(f.endPosition.y-f.startPosition.y)*.5,a.startPosition=U.clone(f.startPosition,a.startPosition),a.endPosition=U.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=U.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||U.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);o(r,y,a)}}}function v0t(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 gTe=[];function yl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(gTe[0]=n,n=gTe);let a=n.length;for(let c=0;c<a;++c){let d=n[c],u=l(d.eventType)?d.eventType:d,h=d.modifier,p=s.isMoving(u,h)&&s.getMovement(u,h),g=s.getStartMousePosition(u,h);e.enableInputs&&t&&(p?(i(e,g,p),v0t(e,r)):o<1&&P0t(s,u,h,o,i,e,r))}}var BO=new yn,w0t=new m,F0t=new U,A0t=new m,M0t=new U,N0t=new m,k0t=new m,U0t=new m,D0t=new m,ETe=new m,O0t=new m,B0t=new m,Y0t=new m,z0t=new m,H0t=new m,K0t=new m,J0t=new m,Q0t=new m,j0t=new m,q0t=new m,bS=new m,yTe=new m,xTe=new m,u7={orientation:new Xa};function x7(e,t,n,i,o,r){let s=1;l(r)&&(s=X.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,d=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,h=o-d,p=i*h;p=X.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let f=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(f>0&&Math.abs(o-d)<1||f<0&&Math.abs(o-u)<1)return;o-f<d?f=o-d-1:o-f>u&&(f=o-u)}let y=e._scene,x=y.camera,S=y.mode,C=u7.orientation;C.heading=x.heading,C.pitch=x.pitch,C.roll=x.roll;let V=n.inertiaEnabled??U.equals(t,e._zoomMouseStart),L=e._zoomingOnVector,Z=e._rotatingZoom,E;if(V||(e._zoomMouseStart=U.clone(t,e._zoomMouseStart),l(e._globe)&&S===oe.SCENE2D?(E=x.getPickRay(t,BO).origin,E=m.fromElements(E.y,E.z,E.x)):l(e._globe)&&(E=C0(e,t,w0t)),l(E)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(E,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,L=e._zoomingOnVector=!1,Z=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){x.zoomIn(f);return}let P=S===oe.COLUMBUS_VIEW;if(x.positionCartographic.height<2e6&&(Z=!0),!V||Z){if(S===oe.SCENE2D){let W=e._zoomWorldPosition,v=x.position;if(!m.equals(W,v)&&x.positionCartographic.height<e._maxCoord.x*2){let A=x.position.x,b=m.subtract(W,v,A0t);m.normalize(b,b);let R=m.distance(W,v)*f/(x.getMagnitude()*.5);x.move(b,R*.5),(x.position.x<0&&A>0||x.position.x>0&&A<0)&&(E=x.getPickRay(t,BO).origin,E=m.fromElements(E.y,E.z,E.x),e._zoomWorldPosition=m.clone(E,e._zoomWorldPosition))}}else if(S===oe.SCENE3D){let W=m.normalize(x.position,ETe);if(e._cameraUnderground||e._zoomingUnderground||x.positionCartographic.height<3e3&&Math.abs(m.dot(x.direction,W))<.6)P=!0;else{let v=y.canvas,A=M0t;A.x=v.clientWidth/2,A.y=v.clientHeight/2;let b=C0(e,A,N0t);if(!l(b))P=!0;else if(x.positionCartographic.height<1e6)if(m.dot(x.direction,W)>=-.5)P=!0;else{let R=B0t;m.clone(x.position,R);let G=e._zoomWorldPosition,I=O0t;if(I=m.normalize(G,I),m.dot(I,W)<0)return;let w=q0t,M=H0t;m.clone(x.direction,M),m.add(R,m.multiplyByScalar(M,1e3,bS),w);let O=K0t,k=J0t;m.subtract(G,R,O),m.normalize(O,k);let B=m.dot(W,k);if(B>=0){e._zoomMouseStart.x=-1;return}let N=Math.acos(-B),z=m.magnitude(R),K=m.magnitude(G),te=z-f,H=m.magnitude(O),j=Math.asin(X.clamp(H/K*Math.sin(N),-1,1)),ee=Math.asin(X.clamp(te/K*Math.sin(N),-1,1)),pe=j-ee+N,_e=Y0t;m.normalize(R,_e);let ae=z0t;ae=m.cross(k,_e,ae),ae=m.normalize(ae,ae),m.normalize(m.cross(_e,ae,bS),M),m.multiplyByScalar(m.normalize(w,bS),m.magnitude(w)-f,w),m.normalize(R,R),m.multiplyByScalar(R,te,R);let ye=Q0t;m.multiplyByScalar(m.add(m.multiplyByScalar(_e,Math.cos(pe)-1,yTe),m.multiplyByScalar(M,Math.sin(pe),xTe),bS),te,ye),m.add(R,ye,R),m.normalize(w,_e),m.normalize(m.cross(_e,ae,bS),M);let Se=j0t;m.multiplyByScalar(m.add(m.multiplyByScalar(_e,Math.cos(pe)-1,yTe),m.multiplyByScalar(M,Math.sin(pe),xTe),bS),m.magnitude(w),Se),m.add(w,Se,w),m.clone(R,x.position),m.normalize(m.subtract(w,R,bS),x.direction),m.clone(x.direction,x.direction),m.cross(x.direction,x.up,x.right),m.cross(x.right,x.direction,x.up),x.setView(u7);return}else{let R=m.normalize(b,k0t),G=m.normalize(e._zoomWorldPosition,U0t),I=m.dot(G,R);if(I>0&&I<1){let w=X.acosClamped(I),M=m.cross(G,R,D0t),O=Math.abs(w)>X.toRadians(20)?x.positionCartographic.height*.75:x.positionCartographic.height-f,k=f/O;x.rotate(M,w*k)}}}}e._rotatingZoom=!P}if(!V&&P||L){let W,v=Oi.worldToWindowCoordinates(y,e._zoomWorldPosition,F0t);S!==oe.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(v)?W=x.getPickRay(v,BO):W=x.getPickRay(t,BO);let A=W.direction;(S===oe.COLUMBUS_VIEW||S===oe.SCENE2D)&&m.fromElements(A.y,A.z,A.x,A),x.move(A,f),e._zoomingOnVector=!0}else x.zoomIn(f);e._cameraUnderground||x.setView(u7)}var $0t=new yn,egt=new yn,tgt=new m;function ngt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,$0t).origin,s=o.getPickRay(n.endPosition,egt).origin;r=m.fromElements(r.y,r.z,r.x,r),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(r,s,tgt),c=m.magnitude(a);c>0&&(m.normalize(a,a),o.move(a,c))}function _Te(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;x7(e,t,n,e.zoomFactor,o.getMagnitude())}var igt=new U,ogt=new U;function TTe(e,t,n){if(l(n.angleAndHeight)){rgt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=igt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let d=ogt;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=U.normalize(d,d);let u=X.acosClamped(c.x);c.y<0&&(u=X.TWO_PI-u);let h=X.acosClamped(d.x);d.y<0&&(h=X.TWO_PI-h);let p=h-u;o.twistRight(p)}function rgt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function sgt(e){let t=e._scene.mapMode2D===ed.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(yl(e,e.enableTranslate,e.translateEventTypes,ngt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),yl(e,e.enableZoom,e.zoomEventTypes,_Te,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&yl(e,e.enableRotate,e.tiltEventTypes,TTe,e.inertiaSpin,"_lastInertiaTiltMovement")):(yl(e,e.enableZoom,e.zoomEventTypes,_Te,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&yl(e,e.enableRotate,e.translateEventTypes,TTe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var ITe=new yn,agt=new m,cgt=new m;function C0(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,agt)),!l(o))return m.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,ITe),d=o.pickWorldCoordinates(c,i,a,cgt),u=l(s)?m.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=l(d)?m.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<h?m.clone(s,n):m.clone(d,n)}var lgt=new he;function jO(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,lgt);l(c)&&(r=c.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var dgt=new m;function XTe(e,t){let n=t.origin,i=t.direction,o=jO(e),r=m.normalize(n,dgt),s=Math.abs(m.dot(r,i));return s=Math.max(s,.5)*2,o*s}function WTe(e,t,n,i){let o=m.distance(t.origin,n),r=jO(e),s=X.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),yn.getPoint(t,o,i)}function PTe(e,t,n,i){let o;return l(n)?(o=m.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=jO(e))):o=jO(e),yn.getPoint(t,o,i)}var ugt=new U;function vTe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,ugt),o=e._strafeEndMousePosition;U.add(o,i,o),t.endPosition=o,_7(e,t,e._strafeStartPosition),t.endPosition=n}var STe=new yn,mgt=new yn,m7=new m,hgt=new m,fgt=new m,pgt=new m,bgt=new dn(m.UNIT_X,0),ggt=new U,ygt=new U;function xgt(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){ru(e,t,n);return}if(e._strafing){vTe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=U.clone(n.startPosition,ggt),a=U.clone(n.endPosition,ygt),c=o.getPickRay(s,STe),d=m.clone(m.ZERO,pgt),u=m.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=C0(e,s,m7),l(h)&&(d.x=h.x)),r||d.x>o.position.z&&l(h)){let V=h;r&&(V=PTe(e,c,h,m7)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),m.clone(V,e._strafeStartPosition),e._strafing=!0,_7(e,n,e._strafeStartPosition);return}let p=dn.fromPointNormal(d,u,bgt);c=o.getPickRay(s,STe);let g=ei.rayPlane(c,p,m7),f=o.getPickRay(a,mgt),y=ei.rayPlane(f,p,hgt);if(!l(g)||!l(y)){e._looking=!0,ru(e,t,n),U.clone(t,e._translateMousePosition);return}let x=m.subtract(g,y,fgt),S=x.x;x.x=x.y,x.y=x.z,x.z=S;let C=m.magnitude(x);C>X.EPSILON6&&(m.normalize(x,x),o.move(x,C))}var wTe=new U,HO=new yn,KO=new m,_gt=new m,FTe=new F,Tgt=new F,Sgt=new m,Cgt=new dn(m.UNIT_X,0),h7=new m,b7=new he,ATe=new F,Vgt=new we,Lgt=new $,JO=new m;function Rgt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){ru(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Zgt(e,t,n)):Ggt(e,t,n)}function Zgt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=wTe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,HO),c=m.UNIT_X,d=a.origin,u=a.direction,h,p=m.dot(c,u);if(Math.abs(p)>X.EPSILON6&&(h=-m.dot(c,d)/p),!l(h)||h<=0){e._looking=!0,ru(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(u,h,KO);m.add(d,g,g);let f=i.mapProjection,y=f.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let x=f.unproject(g,b7);y.cartographicToCartesian(x,g);let S=Ft.eastNorthUpToFixedFrame(g,y,FTe),C=e._globe,V=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let L=F.clone(o.transform,ATe);o._setTransform(S),ou(e,t,n,m.UNIT_Z),o._setTransform(L),e._globe=C,e._ellipsoid=V;let Z=V.maximumRadius;e._rotateFactor=1/Z,e._rotateRateRangeAdjustment=Z}function Ggt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=m.UNIT_X;if(U.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,KO);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=C0(e,t,KO)),!l(s)){a=o.getPickRay(t,HO);let b=a.origin,R=a.direction,G,I=m.dot(c,R);if(Math.abs(I)>X.EPSILON6&&(G=-m.dot(c,b)/I),!l(G)||G<=0){e._looking=!0,ru(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(R,G,KO),m.add(b,s,s)}r&&(l(a)||(a=o.getPickRay(t,HO)),WTe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let d=i.canvas,u=wTe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,HO);let h=m.clone(m.ZERO,Sgt);h.x=s.x;let p=dn.fromPointNormal(h,c,Cgt),g=ei.rayPlane(a,p,_gt),f=o._projection,y=f.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let x=f.unproject(s,b7);y.cartographicToCartesian(x,s);let S=Ft.eastNorthUpToFixedFrame(s,y,FTe),C;l(g)?(m.fromElements(g.y,g.z,g.x,g),x=f.unproject(g,b7),y.cartographicToCartesian(x,g),C=Ft.eastNorthUpToFixedFrame(g,y,Tgt)):C=S;let V=e._globe,L=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let Z=m.UNIT_Z,E=F.clone(o.transform,ATe);o._setTransform(S);let P=m.cross(m.UNIT_Z,m.normalize(o.position,h7),h7),W=m.dot(o.right,P);if(ou(e,t,n,Z,!1,!0),o._setTransform(C),W<0){let b=n.startPosition.y-n.endPosition.y;(r&&b<0||!r&&b>0)&&(Z=void 0);let R=o.constrainedAxis;o.constrainedAxis=void 0,ou(e,t,n,Z,!0,!1),o.constrainedAxis=R}else ou(e,t,n,Z,!0,!1);if(l(o.constrainedAxis)){let b=m.cross(o.direction,o.constrainedAxis,JO);m.equalsEpsilon(b,m.ZERO,X.EPSILON6)||(m.dot(b,o.right)<0&&m.negate(b,b),m.cross(b,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(E),e._globe=V,e._ellipsoid=L;let v=L.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v;let A=m.clone(o.positionWC,h7);if(e.enableCollisionDetection&&C7(e,!0),!m.equals(o.positionWC,A)){o._setTransform(C),o.worldToCameraCoordinatesPoint(A,A);let b=m.magnitudeSquared(A);m.magnitudeSquared(o.position)>b&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(b),o.position));let R=m.angleBetween(A,o.position),G=m.cross(A,o.position,A);m.normalize(G,G);let I=we.fromAxisAngle(G,R,Vgt),w=$.fromQuaternion(I,Lgt);$.multiplyByVector(w,o.direction,o.direction),$.multiplyByVector(w,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(E)}}var MTe=new U,NTe=new yn,kTe=new m;function Egt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=MTe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,NTe),d=c.origin,u=c.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=C0(e,a,kTe));let g;if(l(p)&&(g=m.distance(d,p)),s){let f=XTe(e,c,h);l(g)?g=Math.min(g,f):g=f}if(!l(g)){let f=m.UNIT_X;g=-m.dot(f,d)/m.dot(f,u)}x7(e,t,n,e.zoomFactor,g)}function Igt(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))yl(e,e.enableRotate,e.rotateEventTypes,ou,e.inertiaSpin,"_lastInertiaSpinMovement"),yl(e,e.enableZoom,e.zoomEventTypes,DTe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),yl(e,e.enableTilt,e.tiltEventTypes,Rgt,e.inertiaSpin,"_lastInertiaTiltMovement"),yl(e,e.enableTranslate,e.translateEventTypes,xgt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),yl(e,e.enableZoom,e.zoomEventTypes,Egt,e.inertiaZoom,"_lastInertiaZoomMovement"),yl(e,e.enableLook,e.lookEventTypes,ru),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var Xgt=new yn,Wgt=new dn(m.UNIT_X,0),Pgt=new m,vgt=new m;function _7(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Xgt),s=m.clone(o.direction,vgt);i.mode===oe.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=dn.fromPointNormal(n,s,Wgt),c=ei.rayPlane(r,a,Pgt);l(c)&&(s=m.subtract(n,c,s),i.mode===oe.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(o.position,s,o.position))}var CTe=new m,UTe=new he,g7=new m,y7=new ne,wgt=new m,Fgt=new m,Agt=new m;function Mgt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(o.transform,F.IDENTITY)){ou(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,wgt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)ru(e,t,n,d);else if(e._rotating)ou(e,t,n);else if(e._strafing)vTe(e,n);else{if(m.magnitude(o.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=g7,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,y7),p7(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,UTe).height,h=e._globe;if(l(h)&&u<e._minimumPickingTerrainHeight){let p=C0(e,n.startPosition,Agt);if(l(p)){let g=!1,f=o.getPickRay(n.startPosition,ITe);if(r)g=!0,PTe(e,f,p,p);else{let y=s.geodeticSurfaceNormal(p,Fgt);Math.abs(m.dot(f.direction,y))<.05?g=!0:g=m.magnitude(o.position)<m.magnitude(p)}g?(U.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,_7(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=g7,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,y7),p7(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,ru(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,CTe))?(p7(e,t,n,e._ellipsoid),m.clone(CTe,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,ou(e,t,n)):(e._looking=!0,ru(e,t,n,d));U.clone(t,e._rotateMousePosition)}function ou(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,c=s.canvas,d=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let u=m.magnitude(a.position),h=e._rotateFactor*(u-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let f=h*p*Math.PI*2,y=h*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let x=e.maximumTiltAngle,S=m.dot(a.direction,i),C=Math.PI-Math.acos(S)+y;C>x&&(y-=C-x)}o||a.rotateRight(f),r||a.rotateUp(y),a.constrainedAxis=d}var f7=re.clone(re.UNIT_W),VTe=re.clone(re.UNIT_W),YO=new m,RL=new m,zO=new m,LTe=new m,Ngt=new U,kgt=new U,Ugt=new U,Dgt=new U,Ogt=new yn;function p7(e,t,n,i){let o=e._scene,r=o.camera,s=U.clone(n.startPosition,Ngt),a=U.clone(n.endPosition,kgt),c=i.cartesianToCartographic(r.positionWC,UTe).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=m.clone(e._panLastWorldPosition,f7),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(d=C0(e,s,f7)),!l(e._globe)&&l(d))){let h=m.subtract(d,r.positionWC,RL),p=m.multiplyByScalar(r.directionWC,m.dot(r.directionWC,h),RL),g=m.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,Dgt),y=U.subtract(a,s,Ugt),x=m.multiplyByScalar(r.rightWC,y.x*f.x,RL),S=m.normalize(r.positionWC,ETe),C=r.getPickRay(a,Ogt).direction,V=m.subtract(C,m.projectVector(C,r.rightWC,zO),zO),L=m.angleBetween(V,r.directionWC),Z=1;l(r.frustum.fov)&&(Z=Math.max(Math.tan(L),.1));let E=Math.abs(m.dot(r.directionWC,S)),P=-y.y*f.y*2/Math.sqrt(Z)*(1-E),W=m.multiplyByScalar(C,P,zO);E=Math.abs(m.dot(r.upWC,S));let v=m.multiplyByScalar(r.upWC,-y.y*(1-E)*f.y,LTe);u=m.add(d,x,VTe),u=m.add(u,W,u),u=m.add(u,v,u),m.clone(u,e._panLastWorldPosition),U.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,f7),u=r.pickEllipsoid(a,i,VTe)),!l(d)||!l(u)){e._rotating=!0,ou(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),l(r.constrainedAxis)){let h=r.constrainedAxis,p=m.mostOrthogonalAxis(h,YO);m.cross(p,h,p),m.normalize(p,p);let g=m.cross(h,p,RL),f=m.magnitude(d),y=m.dot(h,d),x=Math.acos(y/f),S=m.multiplyByScalar(h,y,zO);m.subtract(d,S,S),m.normalize(S,S);let C=m.magnitude(u),V=m.dot(h,u),L=Math.acos(V/C),Z=m.multiplyByScalar(h,V,LTe);m.subtract(u,Z,Z),m.normalize(Z,Z);let E=Math.acos(m.dot(S,p));m.dot(S,g)<0&&(E=X.TWO_PI-E);let P=Math.acos(m.dot(Z,p));m.dot(Z,g)<0&&(P=X.TWO_PI-P);let W=E-P,v;m.equalsEpsilon(h,r.position,X.EPSILON2)?v=r.right:v=m.cross(h,r.position,YO);let A=m.cross(h,v,YO),b=m.dot(A,m.subtract(d,h,RL)),R=m.dot(A,m.subtract(u,h,RL)),G;b>0&&R>0?G=L-x:b>0&&R<=0?m.dot(r.position,h)>0?G=-x-L:G=x+L:G=x-L,r.rotateRight(W),r.rotateUp(G)}else{m.normalize(d,d),m.normalize(u,u);let h=m.dot(d,u),p=m.cross(d,u,YO);if(h<1&&!m.equalsEpsilon(p,m.ZERO,X.EPSILON14)){let g=Math.acos(h);r.rotate(p,g)}}}var Bgt=new m,Ygt=new he,RTe=0;function DTe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,d;c?d=t:(d=MTe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,NTe),h,p=o.cartesianToCartographic(s.position,Ygt).height,g=Math.abs(RTe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(h=C0(e,d,kTe));let y;if(l(h)&&(y=m.distance(u.origin,h),RTe=y),c){let S=XTe(e,u,p);l(y)?y=Math.min(y,S):y=S}l(y)||(y=p);let x=m.normalize(s.position,Bgt);x7(e,t,n,e.zoomFactor,y,m.dot(x,s.direction))}var OTe=new U,QO=new yn,IA=new m,zgt=new m,BTe=new F,Hgt=new F,YTe=new F,Kgt=new we,Jgt=new $,T7=new he,S7=new m;function Qgt(e,t,n){let o=e._scene.camera;if(!F.equals(o.transform,F.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,S7);ru(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,T7);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,qgt(e,t,n)):$gt(e,t,n)}var jgt=new he;function qgt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,jgt).height;if(a-s-1<X.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=OTe;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,QO),h,p=ei.rayEllipsoid(u,i);if(l(p))h=yn.getPoint(u,p.start,IA);else if(a>e._minimumTrackBallHeight){let C=ei.grazingAltitudeLocation(u,i);if(!l(C))return;let V=i.cartesianToCartographic(C,T7);V.height=0,h=i.cartographicToCartesian(V,IA)}else{e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(r.position,S7);ru(e,t,n,C),U.clone(t,e._tiltCenterMousePosition);return}let g=Ft.eastNorthUpToFixedFrame(h,i,BTe),f=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let x=F.clone(r.transform,YTe);r._setTransform(g),ou(e,t,n,m.UNIT_Z),r._setTransform(x),e._globe=f,e._ellipsoid=y;let S=y.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function $gt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(U.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,IA);else{if(a=C0(e,t,IA),!l(a)){if(c=r.getPickRay(t,QO),d=ei.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,T7).height<=e._minimumTrackBallHeight){e._looking=!0;let R=e._ellipsoid.geodeticSurfaceNormal(r.position,S7);ru(e,t,n,R),U.clone(t,e._tiltCenterMousePosition)}return}a=yn.getPoint(c,d.start,IA)}s&&(l(c)||(c=r.getPickRay(t,QO)),WTe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let u=o.canvas,h=OTe;h.x=u.clientWidth/2,h.y=e._tiltCenterMousePosition.y,c=r.getPickRay(h,QO);let p=m.magnitude(a),g=m.fromElements(p,p,p,g7),f=ne.fromCartesian3(g,y7);if(d=ei.rayEllipsoid(c,f),!l(d))return;let y=m.magnitude(c.origin)>p?d.start:d.stop,x=yn.getPoint(c,y,zgt),S=Ft.eastNorthUpToFixedFrame(a,i,BTe),C=Ft.eastNorthUpToFixedFrame(x,f,Hgt),V=e._globe,L=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let Z=m.UNIT_Z,E=F.clone(r.transform,YTe);r._setTransform(C);let P=m.cross(x,r.positionWC,JO);if(m.dot(r.rightWC,P)<0){let b=n.startPosition.y-n.endPosition.y;(s&&b<0||!s&&b>0)&&(Z=void 0);let R=r.constrainedAxis;r.constrainedAxis=void 0,ou(e,t,n,Z,!0,!1),r.constrainedAxis=R}else ou(e,t,n,Z,!0,!1);if(r._setTransform(S),ou(e,t,n,Z,!1,!0),l(r.constrainedAxis)){let b=m.cross(r.direction,r.constrainedAxis,JO);m.equalsEpsilon(b,m.ZERO,X.EPSILON6)||(m.dot(b,r.right)<0&&m.negate(b,b),m.cross(b,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(E),e._globe=V,e._ellipsoid=L;let v=L.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v;let A=m.clone(r.positionWC,JO);if(e.enableCollisionDetection&&C7(e,!0),!m.equals(r.positionWC,A)){r._setTransform(C),r.worldToCameraCoordinatesPoint(A,A);let b=m.magnitudeSquared(A);m.magnitudeSquared(r.position)>b&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(b),r.position));let R=m.angleBetween(A,r.position),G=m.cross(A,r.position,A);m.normalize(G,G);let I=we.fromAxisAngle(G,R,Kgt),w=$.fromQuaternion(I,Jgt);$.multiplyByVector(w,r.direction,r.direction),$.multiplyByVector(w,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(E)}}var eyt=new U,tyt=new U,ZTe=new yn,GTe=new yn,nyt=new m,iyt=new m;function ru(e,t,n,i){let r=e._scene.camera,s=eyt;s.x=n.startPosition.x,s.y=0;let a=tyt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,ZTe),d=r.getPickRay(a,GTe),u=0,h,p;r.frustum instanceof un?(h=c.origin,p=d.origin,m.add(r.direction,h,h),m.add(r.direction,p,p),m.subtract(h,r.position,h),m.subtract(p,r.position,p),m.normalize(h,h),m.normalize(p,p)):(h=c.direction,p=d.direction);let g=m.dot(h,p);g<1&&(u=Math.acos(g)),u=n.startPosition.x>n.endPosition.x?-u:u;let f=e._horizontalRotationAxis;if(l(i)?r.look(i,-u):l(f)?r.look(f,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,ZTe),d=r.getPickRay(a,GTe),u=0,r.frustum instanceof un?(h=c.origin,p=d.origin,m.add(r.direction,h,h),m.add(r.direction,p,p),m.subtract(h,r.position,h),m.subtract(p,r.position,p),m.normalize(h,h),m.normalize(p,p)):(h=c.direction,p=d.direction),g=m.dot(h,p),g<1&&(u=Math.acos(g)),u=n.startPosition.y>n.endPosition.y?-u:u,i=i??f,l(i)){let y=r.direction,x=m.negate(i,nyt),S=m.equalsEpsilon(y,i,X.EPSILON2),C=m.equalsEpsilon(y,x,X.EPSILON2);if(!S&&!C){g=m.dot(y,i);let V=X.acosClamped(g);u>0&&u>V&&(u=V-X.EPSILON4),g=m.dot(y,x),V=X.acosClamped(g),u<0&&-u>V&&(u=-V+X.EPSILON4);let L=m.cross(i,y,iyt);r.look(L,u)}else(S&&u<0||C&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function oyt(e){yl(e,e.enableRotate,e.rotateEventTypes,Mgt,e.inertiaSpin,"_lastInertiaSpinMovement"),yl(e,e.enableZoom,e.zoomEventTypes,DTe,e.inertiaZoom,"_lastInertiaZoomMovement"),yl(e,e.enableTilt,e.tiltEventTypes,Qgt,e.inertiaSpin,"_lastInertiaTiltMovement"),yl(e,e.enableLook,e.lookEventTypes,ru)}var ryt=new F,syt=new he;function C7(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??ne.WGS84,s=n.mapProjection,a,c;F.equals(o.transform,F.IDENTITY)||(a=F.clone(o.transform,ryt),c=m.magnitude(o.position),o._setTransform(F.IDENTITY));let d=syt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(l(h)){let p=h+e.minimumZoomDistance,g=h-e._lastGlobeHeight,f=g/e._lastGlobeHeight;d.height<p&&(t||Math.abs(f)<=.1)&&(d.height=p,i===oe.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(f)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=g*.1}}l(a)&&(o._setTransform(a),u&&(m.normalize(o.position,o.position),m.negate(o.position,o.direction),m.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),m.normalize(o.direction,o.direction),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up)))}XA.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 ayt=new m,cyt=new m;XA.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ne.default):(this._globe=void 0,this._ellipsoid=ne.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Zr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Zr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Zr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,ayt),c=m.clone(t.directionWC,cyt);if(i===oe.SCENE2D?sgt(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,Igt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,oyt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC);C7(this,d)}this._aggregator.reset()};XA.prototype.isDestroyed=function(){return!1};XA.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),me(this)};var WA=XA;var pBi=_(T(),1);var K3i=_(T(),1),PA=`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 Q3i=_(T(),1),vA=`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 V0(){this._sceneFramebuffer=new rS;let e=.125,t=new Array(6);t[0]=new go({fragmentShader:td,textureScale:e,forcePowerOfTwo:!0,sampleMode:nu.LINEAR});let n=t[1]=new go({fragmentShader:vA,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new U,t[2]=new go({fragmentShader:Dy,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 go({fragmentShader:Dy,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 go({fragmentShader:td,sampleMode:nu.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new go({fragmentShader:PA,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new nd({stages:t});let o=new mS(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}V0.prototype.get=function(e){return this._stages.get(e)};V0.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 lyt=new re,zTe=new U,dyt=new U,HTe=new F;function uyt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=F.computeViewportTransformation(n,0,1,HTe),d=F.multiplyByPoint(r,o,lyt),u=Ft.pointToGLWindowCoordinates(s,c,o,zTe);d.x+=X.SOLAR_RADIUS;let h=Ft.pointToGLWindowCoordinates(a,c,d,d),p=U.magnitude(U.subtract(h,u,h))*30*2,g=dyt;g.x=p,g.y=p,e._uCenter=U.clone(u,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let f=t.drawingBufferWidth,y=t.drawingBufferHeight,x=e._stages,S=x.get(0),C=S.outputTexture.width,V=S.outputTexture.height,L=new ze;L.width=C,L.height=V,c=F.computeViewportTransformation(L,0,1,HTe),u=Ft.pointToGLWindowCoordinates(s,c,o,zTe),g.x*=C/f,g.y*=V/y;let Z=S.scissorRectangle;Z.x=Math.max(u.x-g.x*.5,0),Z.y=Math.max(u.y-g.y*.5,0),Z.width=Math.min(g.x,f),Z.height=Math.min(g.y,y);for(let E=1;E<4;++E)ze.clone(Z,x.get(E).scissorRectangle)}V0.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};V0.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),uyt(this,t,n),o};V0.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)};V0.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(td,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};V0.prototype.isDestroyed=function(){return!1};V0.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),me(this)};var wA=V0;var SBi=_(T(),1);function KTe(){this._cachedShowFrustumsShaders={}}function myt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function hyt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=De.replaceMain(u,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor;
|
|
|
`,a+=`uniform vec3 debugShowFrustumsColor;
|
|
|
`,a+=`void main()
|
|
|
{
|
|
|
czm_Debug_main();
|
|
|
`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor;
|
|
|
`,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor;
|
|
|
`;else a+=` out_FragColor.rgb *= debugShowCommandsColor;
|
|
|
`,a+=` out_FragColor.rgb *= debugShowFrustumsColor;
|
|
|
`;a+="}",o.sources.push(a);let d=myt(i);return nn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var FA=new D;function fyt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=D.fromRandom()),t._debugColor):D.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(FA.red=t.debugOverlappingFrustums&1?1:0,FA.green=t.debugOverlappingFrustums&2?1:0,FA.blue=t.debugOverlappingFrustums&4?1:0,FA.alpha=1,FA):D.WHITE}),n}var pyt=new $e;KTe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=hyt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=$e.shallowClone(t,pyt);r.shaderProgram=o,r.uniformMap=fyt(e,t),r.execute(e.context,n)};var AA=KTe;var GBi=_(T(),1);function gS(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Xn}gS.fromKeyframeNode=function(e,t,n,i){let o=new gS(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=byt(e,s,n),o._orientedBoundingBox=yyt(e,r,n,o._orientedBoundingBox),o};function byt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],d=mt.getComponentCount(o[a]),u=r[a].slice(n*d,(n+1)*d);s[c]=u}return s}var JTe=new m,gyt=new m;function yyt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),d=a-c*o.x,u=m.fromElements(d,c,s,JTe),h=m.divideComponents(m.subtract(u,e._paddingBefore,JTe),e.dimensions,gyt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(gS.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()}}});gS.prototype.hasProperty=function(e){return l(this._metadata[e])};gS.prototype.getNames=function(){return Object.keys(this._metadata)};gS.prototype.getProperty=function(e){return this._metadata[e]};var MA=gS;var wKi=_(T(),1);var QYi=_(T(),1);var WYi=_(T(),1);var IBi=_(T(),1),NA=`struct Ray {
|
|
|
vec3 pos;
|
|
|
vec3 dir;
|
|
|
vec3 rawDir;
|
|
|
};
|
|
|
|
|
|
#if defined(JITTER)
|
|
|
/**
|
|
|
* Generate a pseudo-random value for a given 2D screen coordinate.
|
|
|
* Similar to https://www.shadertoy.com/view/4djSRW with a modified hashscale.
|
|
|
*/
|
|
|
float hash(vec2 p)
|
|
|
{
|
|
|
vec3 p3 = fract(vec3(p.xyx) * 50.0);
|
|
|
p3 += dot(p3, p3.yzx + 19.19);
|
|
|
return fract((p3.x + p3.y) * p3.z);
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
float minComponent(in vec3 v) {
|
|
|
return min(min(v.x, v.y), v.z);
|
|
|
}
|
|
|
|
|
|
float maxComponent(in vec3 v) {
|
|
|
return max(max(v.x, v.y), v.z);
|
|
|
}
|
|
|
|
|
|
struct PointJacobianT {
|
|
|
vec3 point;
|
|
|
mat3 jacobianT;
|
|
|
};
|
|
|
`;var WBi=_(T(),1),kA=`// See Intersection.glsl for the definition of intersectScene
|
|
|
// See IntersectionUtils.glsl for the definition of nextIntersection
|
|
|
// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl
|
|
|
// for the definition of convertUvToShapeUvSpace. The appropriate function is
|
|
|
// 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 mat3 u_transformDirectionViewToLocal;
|
|
|
uniform vec3 u_cameraPositionUv;
|
|
|
uniform float u_stepSize;
|
|
|
|
|
|
#if defined(PICKING)
|
|
|
uniform vec4 u_pickColor;
|
|
|
#endif
|
|
|
|
|
|
vec3 getSampleSize(in int level) {
|
|
|
vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions);
|
|
|
vec3 sampleSizeUv = 1.0 / sampleCount;
|
|
|
return scaleShapeUvToShapeSpace(sampleSizeUv);
|
|
|
}
|
|
|
|
|
|
#define MINIMUM_STEP_SCALAR (0.02)
|
|
|
#define SHIFT_FRACTION (0.001)
|
|
|
|
|
|
/**
|
|
|
* 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) {
|
|
|
// The Jacobian is computed in a space where the shape spans [-1, 1].
|
|
|
// But the ray is marched in a space where the shape fills [0, 1].
|
|
|
// So we need to scale the Jacobian by 2.
|
|
|
vec3 gradient = 2.0 * viewRay.rawDir * jacobianT;
|
|
|
vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;
|
|
|
|
|
|
RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);
|
|
|
|
|
|
// Transform normal from shape space to Cartesian space
|
|
|
vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz);
|
|
|
// 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);
|
|
|
}
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
vec4 fragCoord = gl_FragCoord;
|
|
|
vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]
|
|
|
vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz);
|
|
|
vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case
|
|
|
vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case
|
|
|
vec3 viewPosUv = u_cameraPositionUv;
|
|
|
#if defined(SHAPE_ELLIPSOID)
|
|
|
// viewDirUv has been scaled to a space where the ellipsoid is a sphere.
|
|
|
// Undo this scaling to get the raw direction.
|
|
|
vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv;
|
|
|
Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir);
|
|
|
#else
|
|
|
Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv);
|
|
|
#endif
|
|
|
|
|
|
Intersections ix;
|
|
|
RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix);
|
|
|
|
|
|
// 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 positionUv = viewPosUv + currentT * viewDirUv;
|
|
|
PointJacobianT pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);
|
|
|
|
|
|
// Traverse the tree from the start position
|
|
|
TraversalData traversalData;
|
|
|
SampleData sampleDatas[SAMPLE_COUNT];
|
|
|
traverseOctreeFromBeginning(pointJacobian.point, traversalData, sampleDatas);
|
|
|
vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);
|
|
|
|
|
|
#if defined(JITTER)
|
|
|
float noise = hash(screenCoord); // [0,1]
|
|
|
currentT += noise * step.w;
|
|
|
positionUv += noise * step.w * viewDirUv;
|
|
|
#endif
|
|
|
|
|
|
FragmentInput fragmentInput;
|
|
|
#if defined(STATISTICS)
|
|
|
setStatistics(fragmentInput.metadata.statistics);
|
|
|
#endif
|
|
|
|
|
|
vec4 colorAccum = vec4(0.0);
|
|
|
|
|
|
for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
|
|
|
// Read properties from the megatexture based on the traversal state
|
|
|
Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);
|
|
|
|
|
|
// Prepare the custom shader inputs
|
|
|
copyPropertiesToMetadata(properties, fragmentInput.metadata);
|
|
|
fragmentInput.voxel.positionUv = positionUv;
|
|
|
fragmentInput.voxel.positionShapeUv = pointJacobian.point;
|
|
|
fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv;
|
|
|
fragmentInput.voxel.viewDirUv = viewDirUv;
|
|
|
fragmentInput.voxel.viewDirWorld = viewDirWorld;
|
|
|
fragmentInput.voxel.surfaceNormal = step.xyz;
|
|
|
fragmentInput.voxel.travelDistance = step.w;
|
|
|
fragmentInput.voxel.stepCount = stepCount;
|
|
|
fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
|
|
|
fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]);
|
|
|
|
|
|
// Run the custom shader
|
|
|
czm_modelMaterial materialOutput;
|
|
|
fragmentMain(fragmentInput, materialOutput);
|
|
|
|
|
|
// Sanitize the custom shader output
|
|
|
vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
|
|
|
color.rgb = max(color.rgb, vec3(0.0));
|
|
|
color.a = clamp(color.a, 0.0, 1.0);
|
|
|
|
|
|
// Pre-multiplied alpha blend
|
|
|
colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);
|
|
|
|
|
|
// Stop traversing if the alpha has been fully saturated
|
|
|
if (colorAccum.a > ALPHA_ACCUM_MAX) {
|
|
|
colorAccum.a = ALPHA_ACCUM_MAX;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
if (step.w == 0.0) {
|
|
|
// Shape is infinitely thin. The ray may have hit the edge of a
|
|
|
// foreground voxel. Step ahead slightly to check for more voxels
|
|
|
step.w == 0.00001;
|
|
|
}
|
|
|
|
|
|
// Keep raymarching
|
|
|
currentT += step.w;
|
|
|
positionUv = viewPosUv + currentT * viewDirUv;
|
|
|
|
|
|
// 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;
|
|
|
positionUv = viewPosUv + currentT * viewDirUv;
|
|
|
}
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
// 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.
|
|
|
pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);
|
|
|
traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas);
|
|
|
step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.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 vBi=_(T(),1),UA=`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 FBi=_(T(),1),DA=`/* 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];
|
|
|
|
|
|
#if (INTERSECTION_COUNT > 1)
|
|
|
// Maintain state for future nextIntersection calls
|
|
|
int index;
|
|
|
int surroundCount;
|
|
|
bool surroundIsPositive;
|
|
|
#endif
|
|
|
};
|
|
|
|
|
|
RayShapeIntersection getFirstIntersection(in Intersections ix)
|
|
|
{
|
|
|
return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);
|
|
|
}
|
|
|
|
|
|
vec4 encodeIntersectionType(vec4 intersection, int index, bool entry)
|
|
|
{
|
|
|
float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;
|
|
|
return vec4(intersection.xyz * scale, intersection.w);
|
|
|
}
|
|
|
|
|
|
// Use defines instead of real functions because WebGL1 cannot access array with non-constant index.
|
|
|
#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t))
|
|
|
#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y)
|
|
|
#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = encodeIntersectionType((intersection), int(!positive), (enter))
|
|
|
#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false)
|
|
|
|
|
|
#if (INTERSECTION_COUNT > 1)
|
|
|
void initializeIntersections(inout Intersections ix) {
|
|
|
// Sort the intersections from min T to max T with bubble sort.
|
|
|
// Note: If this sorting function changes, some of the intersection test may
|
|
|
// need to be updated. Search for "bubble sort" to find those areas.
|
|
|
const int sortPasses = INTERSECTION_COUNT * 2 - 1;
|
|
|
for (int n = sortPasses; n > 0; --n) {
|
|
|
for (int i = 0; i < sortPasses; ++i) {
|
|
|
// The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot
|
|
|
// loop with non-constant condition, so it has to break early instead
|
|
|
if (i >= n) { break; }
|
|
|
|
|
|
vec4 intersect0 = ix.intersections[i + 0];
|
|
|
vec4 intersect1 = ix.intersections[i + 1];
|
|
|
|
|
|
bool inOrder = intersect0.w <= intersect1.w;
|
|
|
|
|
|
ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;
|
|
|
ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// Prepare initial state for nextIntersection
|
|
|
ix.index = 0;
|
|
|
ix.surroundCount = 0;
|
|
|
ix.surroundIsPositive = false;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#if (INTERSECTION_COUNT > 1)
|
|
|
RayShapeIntersection nextIntersection(inout Intersections ix) {
|
|
|
vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);
|
|
|
RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);
|
|
|
|
|
|
const int passCount = INTERSECTION_COUNT * 2;
|
|
|
|
|
|
if (ix.index == passCount) {
|
|
|
return shapeIntersection;
|
|
|
}
|
|
|
|
|
|
for (int i = 0; i < passCount; ++i) {
|
|
|
// The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot
|
|
|
// loop with non-constant condition, so it has to continue instead.
|
|
|
if (i < ix.index) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
ix.index = i + 1;
|
|
|
|
|
|
surfaceIntersection = ix.intersections[i];
|
|
|
int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);
|
|
|
bool currShapeIsPositive = intersectionType < 2;
|
|
|
bool enter = intMod(intersectionType, 2) == 0;
|
|
|
|
|
|
ix.surroundCount += enter ? +1 : -1;
|
|
|
ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;
|
|
|
|
|
|
// entering positive or exiting negative
|
|
|
if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
|
|
|
shapeIntersection.entry = surfaceIntersection;
|
|
|
}
|
|
|
|
|
|
// exiting positive or entering negative after being inside positive
|
|
|
bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
|
|
|
bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
|
|
|
if (exitPositive || enterNegativeFromPositive) {
|
|
|
shapeIntersection.exit = surfaceIntersection;
|
|
|
|
|
|
// entry and exit have been found, so the loop can stop
|
|
|
if (exitPositive) {
|
|
|
// After exiting positive shape there is nothing left to intersect, so jump to the end index.
|
|
|
ix.index = passCount;
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return shapeIntersection;
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1
|
|
|
`;var MBi=_(T(),1),OA=`// 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 ###
|
|
|
*/
|
|
|
|
|
|
uniform mat4 u_transformPositionViewToUv;
|
|
|
|
|
|
void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
|
|
|
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
|
|
|
if (logDepthOrDepth != 0.0) {
|
|
|
// Calculate how far the ray must travel before it hits the depth buffer.
|
|
|
vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
|
|
|
eyeCoordinateDepth /= eyeCoordinateDepth.w;
|
|
|
vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);
|
|
|
float t = dot(depthPositionUv - ray.pos, ray.dir);
|
|
|
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT));
|
|
|
} else {
|
|
|
// There's no depth at this location.
|
|
|
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT));
|
|
|
}
|
|
|
}
|
|
|
`;var kBi=_(T(),1),BA=`// 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);
|
|
|
}
|
|
|
|
|
|
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, u_clippingPlanesMatrix);
|
|
|
vec4 intersection = intersectPlane(ray, planeUv);
|
|
|
bool reflects = dot(ray.dir, intersection.xyz) < 0.0;
|
|
|
clippingVolume.entry = reflects ? backSide : intersection;
|
|
|
clippingVolume.exit = reflects ? intersection : farSide;
|
|
|
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
|
|
|
#elif defined(CLIPPING_PLANES_UNION)
|
|
|
vec4 firstTransmission = vec4(ray.dir, +INF_HIT);
|
|
|
vec4 lastReflection = vec4(-ray.dir, -INF_HIT);
|
|
|
for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
|
|
|
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
|
|
|
vec4 intersection = intersectPlane(ray, planeUv);
|
|
|
if (dot(ray.dir, planeUv.xyz) > 0.0) {
|
|
|
firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;
|
|
|
} else {
|
|
|
lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;
|
|
|
}
|
|
|
}
|
|
|
clippingVolume.entry = backSide;
|
|
|
clippingVolume.exit = lastReflection;
|
|
|
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);
|
|
|
clippingVolume.entry = firstTransmission;
|
|
|
clippingVolume.exit = farSide;
|
|
|
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);
|
|
|
#else // intersection
|
|
|
vec4 lastTransmission = vec4(ray.dir, -INF_HIT);
|
|
|
vec4 firstReflection = vec4(-ray.dir, +INF_HIT);
|
|
|
for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
|
|
|
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
|
|
|
vec4 intersection = intersectPlane(ray, planeUv);
|
|
|
if (dot(ray.dir, planeUv.xyz) > 0.0) {
|
|
|
lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;
|
|
|
} else {
|
|
|
firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;
|
|
|
}
|
|
|
}
|
|
|
if (lastTransmission.w < firstReflection.w) {
|
|
|
clippingVolume.entry = lastTransmission;
|
|
|
clippingVolume.exit = firstReflection;
|
|
|
} else {
|
|
|
clippingVolume.entry = vec4(-ray.dir, NO_HIT);
|
|
|
clippingVolume.exit = vec4(ray.dir, NO_HIT);
|
|
|
}
|
|
|
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
|
|
|
#endif
|
|
|
}
|
|
|
`;var DBi=_(T(),1),ZL=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,
|
|
|
// RayShapeIntersection
|
|
|
|
|
|
vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) {
|
|
|
float normalSign = positiveNormal ? 1.0 : -1.0;
|
|
|
vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign;
|
|
|
|
|
|
vec2 position = ray.pos.xy;
|
|
|
vec2 direction = ray.dir.xy;
|
|
|
float approachRate = dot(direction, planeNormal);
|
|
|
float distance = -dot(position, planeNormal);
|
|
|
|
|
|
float t = (approachRate == 0.0)
|
|
|
? NO_HIT
|
|
|
: distance / approachRate;
|
|
|
|
|
|
return vec4(planeNormal, 0.0, t);
|
|
|
}
|
|
|
|
|
|
RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal)
|
|
|
{
|
|
|
vec4 intersection = intersectLongitude(ray, angle, positiveNormal);
|
|
|
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
|
|
|
|
bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0);
|
|
|
if (!hitFront) {
|
|
|
return RayShapeIntersection(intersection, farSide);
|
|
|
} else {
|
|
|
return RayShapeIntersection(-1.0 * farSide, intersection);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2])
|
|
|
{
|
|
|
intersections[0] = intersectHalfSpace(ray, minMaxAngle.x, false);
|
|
|
intersections[1] = intersectHalfSpace(ray, minMaxAngle.y, true);
|
|
|
}
|
|
|
|
|
|
bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) {
|
|
|
float normalSign = positiveNormal ? 1.0 : -1.0;
|
|
|
vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign;
|
|
|
vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy;
|
|
|
return dot(hit, planeDirection) > 0.0;
|
|
|
}
|
|
|
|
|
|
void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) {
|
|
|
vec4 intersection = intersectLongitude(ray, angle, true);
|
|
|
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
|
|
|
|
if (hitPositiveHalfPlane(ray, intersection, true)) {
|
|
|
intersections[0].entry = -1.0 * farSide;
|
|
|
intersections[0].exit = vec4(-1.0 * intersection.xy, 0.0, intersection.w);
|
|
|
intersections[1].entry = intersection;
|
|
|
intersections[1].exit = farSide;
|
|
|
} else {
|
|
|
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
|
|
|
intersections[0].entry = -1.0 * farSide;
|
|
|
intersections[0].exit = farSide;
|
|
|
intersections[1].entry = miss;
|
|
|
intersections[1].exit = miss;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle)
|
|
|
{
|
|
|
// 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 RayShapeIntersection(first, last);
|
|
|
} else if (!exitFromInside && enterFromOutside) {
|
|
|
// Ray starts inside wedge. last is in shadow wedge, and first is actually the entry
|
|
|
return RayShapeIntersection(-1.0 * farSide, first);
|
|
|
} else if (exitFromInside && !enterFromOutside) {
|
|
|
// First intersection was in the shadow wedge, so last is actually the exit
|
|
|
return RayShapeIntersection(last, farSide);
|
|
|
} else { // !exitFromInside && !enterFromOutside
|
|
|
// Both intersections were in the shadow wedge
|
|
|
return RayShapeIntersection(miss, miss);
|
|
|
}
|
|
|
}
|
|
|
`;var BBi=_(T(),1),YA=`// 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 vec3 u_renderMinBounds;
|
|
|
uniform vec3 u_renderMaxBounds;
|
|
|
|
|
|
RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound)
|
|
|
{
|
|
|
// Consider the box as the intersection of the space between 3 pairs of parallel planes
|
|
|
// Compute the distance along the ray to each plane
|
|
|
vec3 t0 = (minBound - ray.pos) / ray.dir;
|
|
|
vec3 t1 = (maxBound - ray.pos) / ray.dir;
|
|
|
|
|
|
// Identify candidate entries/exits based on distance from ray.pos
|
|
|
vec3 entries = min(t0, t1);
|
|
|
vec3 exits = max(t0, t1);
|
|
|
|
|
|
vec3 directions = sign(ray.dir);
|
|
|
|
|
|
// The actual intersection points are the furthest entry and the closest exit
|
|
|
float lastEntry = maxComponent(entries);
|
|
|
bvec3 isLastEntry = equal(entries, vec3(lastEntry));
|
|
|
vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
|
|
|
vec4 entry = vec4(entryNormal, lastEntry);
|
|
|
|
|
|
float firstExit = minComponent(exits);
|
|
|
bvec3 isFirstExit = equal(exits, vec3(firstExit));
|
|
|
vec3 exitNormal = vec3(isLastEntry) * directions;
|
|
|
vec4 exit = vec4(exitNormal, firstExit);
|
|
|
|
|
|
if (entry.w > exit.w) {
|
|
|
entry.w = NO_HIT;
|
|
|
exit.w = NO_HIT;
|
|
|
}
|
|
|
|
|
|
return RayShapeIntersection(entry, exit);
|
|
|
}
|
|
|
|
|
|
void intersectShape(in Ray ray, inout Intersections ix)
|
|
|
{
|
|
|
RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds);
|
|
|
setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
|
|
|
}
|
|
|
`;var zBi=_(T(),1),zA=`// 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;
|
|
|
uniform vec2 u_cylinderRenderHeightMinMax;
|
|
|
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
|
|
|
uniform vec2 u_cylinderRenderAngleMinMax;
|
|
|
#endif
|
|
|
|
|
|
/**
|
|
|
* Find the intersection of a ray with the volume defined by two planes of constant z
|
|
|
*/
|
|
|
RayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex)
|
|
|
{
|
|
|
float zPosition = ray.pos.z;
|
|
|
float zDirection = ray.dir.z;
|
|
|
|
|
|
float tmin = (minMaxHeight.x - zPosition) / zDirection;
|
|
|
float tmax = (minMaxHeight.y - zPosition) / zDirection;
|
|
|
|
|
|
// Normals point outside the volume
|
|
|
float signFlip = convex ? 1.0 : -1.0;
|
|
|
vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin);
|
|
|
vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax);
|
|
|
|
|
|
bool topEntry = zDirection < 0.0;
|
|
|
vec4 entry = topEntry ? intersectMax : intersectMin;
|
|
|
vec4 exit = topEntry ? intersectMin : intersectMax;
|
|
|
|
|
|
return RayShapeIntersection(entry, exit);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 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;
|
|
|
vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1);
|
|
|
vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2);
|
|
|
|
|
|
return RayShapeIntersection(intersect1, intersect2);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 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 float radius, in vec2 minMaxHeight)
|
|
|
{
|
|
|
RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
|
|
|
RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true);
|
|
|
return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
|
|
|
}
|
|
|
|
|
|
void intersectShape(Ray ray, inout Intersections ix)
|
|
|
{
|
|
|
// Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
|
|
|
// Direction is scaled as well to be in sync with position.
|
|
|
ray.pos = ray.pos * 2.0 - 1.0;
|
|
|
ray.dir *= 2.0;
|
|
|
|
|
|
RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax);
|
|
|
|
|
|
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);
|
|
|
|
|
|
if (outerIntersect.entry.w == NO_HIT) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
|
|
|
// 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 KBi=_(T(),1),HA=`// 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;
|
|
|
|
|
|
RayShapeIntersection intersectZPlane(in Ray ray, in float z) {
|
|
|
float t = -ray.pos.z / ray.dir.z;
|
|
|
|
|
|
bool startsOutside = sign(ray.pos.z) == sign(z);
|
|
|
bool entry = (t >= 0.0) != startsOutside;
|
|
|
|
|
|
vec4 intersect = vec4(0.0, 0.0, z, t);
|
|
|
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
|
|
|
|
if (entry) {
|
|
|
return RayShapeIntersection(intersect, farSide);
|
|
|
} else {
|
|
|
return RayShapeIntersection(-1.0 * farSide, intersect);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex)
|
|
|
{
|
|
|
// Scale the ray by the ellipsoid axes to make it a unit sphere
|
|
|
// Note: approximating ellipsoid + height as an ellipsoid
|
|
|
vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight);
|
|
|
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 * normalize(position + tmin * direction);
|
|
|
vec3 d2 = directionScale * normalize(position + tmax * direction);
|
|
|
|
|
|
return RayShapeIntersection(vec4(d1, tmin), vec4(d2, 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 = 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]) {
|
|
|
// Undo the scaling from ellipsoid to sphere
|
|
|
ray.pos = ray.pos * u_ellipsoidRadiiUv;
|
|
|
ray.dir = ray.dir * u_ellipsoidRadiiUv;
|
|
|
// 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) {
|
|
|
// Undo the scaling from ellipsoid to sphere
|
|
|
ray.pos = ray.pos * u_ellipsoidRadiiUv;
|
|
|
ray.dir = ray.dir * u_ellipsoidRadiiUv;
|
|
|
// 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, inout Intersections ix) {
|
|
|
// Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
|
|
|
// Direction is scaled as well to be in sync with position.
|
|
|
ray.pos = ray.pos * 2.0 - 1.0;
|
|
|
ray.dir *= 2.0;
|
|
|
|
|
|
// 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 QBi=_(T(),1),yS=`// 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, out Intersections ix) {
|
|
|
// Do a ray-shape intersection to find the exact starting and ending points.
|
|
|
intersectShape(ray, 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
|
|
|
#if defined(DEPTH_TEST)
|
|
|
intersectDepth(screenCoord, ray, ix);
|
|
|
#endif
|
|
|
|
|
|
// 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 qBi=_(T(),1),KA=`/* Box defines (set in Scene/VoxelBoxShape.js)
|
|
|
#define BOX_HAS_SHAPE_BOUNDS
|
|
|
*/
|
|
|
|
|
|
#if defined(BOX_HAS_SHAPE_BOUNDS)
|
|
|
uniform vec3 u_boxUvToShapeUvScale;
|
|
|
uniform vec3 u_boxUvToShapeUvTranslate;
|
|
|
#endif
|
|
|
|
|
|
PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
|
|
|
// For BOX, UV space = shape space, so we can use positionUv as-is,
|
|
|
// and the Jacobian is the identity matrix, except that a step of 1
|
|
|
// only spans half the shape space [-1, 1], so the identity is scaled.
|
|
|
return PointJacobianT(positionUv, mat3(0.5));
|
|
|
}
|
|
|
|
|
|
vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
|
|
|
#if defined(BOX_HAS_SHAPE_BOUNDS)
|
|
|
return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate;
|
|
|
#else
|
|
|
return positionShape;
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
|
|
|
PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
|
|
|
pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
|
|
|
return pointJacobian;
|
|
|
}
|
|
|
|
|
|
vec3 convertShapeUvToUvSpace(in vec3 shapeUv) {
|
|
|
#if defined(BOX_HAS_SHAPE_BOUNDS)
|
|
|
return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale;
|
|
|
#else
|
|
|
return shapeUv;
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
|
|
|
#if defined(BOX_HAS_SHAPE_BOUNDS)
|
|
|
return shapeUv / u_boxUvToShapeUvScale;
|
|
|
#else
|
|
|
return shapeUv;
|
|
|
#endif
|
|
|
}`;var eYi=_(T(),1),JA=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
|
|
|
#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS
|
|
|
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT
|
|
|
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE
|
|
|
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY
|
|
|
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY
|
|
|
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED
|
|
|
*/
|
|
|
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
|
|
|
uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset
|
|
|
#endif
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
|
|
|
uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset
|
|
|
#endif
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
|
|
|
uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset
|
|
|
#endif
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
|
|
|
uniform vec2 u_cylinderShapeUvAngleMinMax;
|
|
|
#endif
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
|
|
|
uniform float u_cylinderShapeUvAngleRangeZeroMid;
|
|
|
#endif
|
|
|
|
|
|
PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
|
|
|
// Convert from Cartesian UV space [0, 1] to Cartesian local space [-1, 1]
|
|
|
vec3 position = positionUv * 2.0 - 1.0;
|
|
|
|
|
|
float radius = length(position.xy); // [0, 1]
|
|
|
vec3 radial = normalize(vec3(position.xy, 0.0));
|
|
|
|
|
|
// Shape space height is defined within [0, 1]
|
|
|
float height = positionUv.z; // [0, 1]
|
|
|
vec3 z = vec3(0.0, 0.0, 1.0);
|
|
|
|
|
|
float angle = atan(position.y, position.x);
|
|
|
vec3 east = normalize(vec3(-position.y, position.x, 0.0));
|
|
|
|
|
|
vec3 point = vec3(radius, angle, height);
|
|
|
mat3 jacobianT = mat3(radial, z, east / length(position.xy));
|
|
|
return PointJacobianT(point, jacobianT);
|
|
|
}
|
|
|
|
|
|
vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
|
|
|
float radius = positionShape.x;
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
|
|
|
radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y;
|
|
|
#endif
|
|
|
|
|
|
float angle = (positionShape.y + czm_pi) / czm_twoPi;
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
|
|
|
// Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative.
|
|
|
angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);
|
|
|
#endif
|
|
|
|
|
|
// Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)
|
|
|
angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;
|
|
|
#elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
|
|
|
angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;
|
|
|
#endif
|
|
|
|
|
|
angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y;
|
|
|
#endif
|
|
|
|
|
|
float height = positionShape.z;
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
|
|
|
height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y;
|
|
|
#endif
|
|
|
|
|
|
return vec3(radius, angle, height);
|
|
|
}
|
|
|
|
|
|
PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
|
|
|
PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
|
|
|
pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
|
|
|
return pointJacobian;
|
|
|
}
|
|
|
|
|
|
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
|
|
|
float radius = shapeUv.x;
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
|
|
|
radius /= u_cylinderUvToShapeUvRadius.x;
|
|
|
#endif
|
|
|
|
|
|
float angle = shapeUv.y * czm_twoPi;
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
|
|
|
angle /= u_cylinderUvToShapeUvAngle.x;
|
|
|
#endif
|
|
|
|
|
|
float height = shapeUv.z;
|
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
|
|
|
height /= u_cylinderUvToShapeUvHeight.x;
|
|
|
#endif
|
|
|
|
|
|
return vec3(radius, angle, height);
|
|
|
}
|
|
|
`;var nYi=_(T(),1),QA=`/* 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_ellipsoidRadiiUv; // [0,1]
|
|
|
uniform vec2 u_evoluteScale; // (radiiUv.x ^ 2 - radiiUv.z ^ 2) * vec2(1.0, -1.0) / radiiUv;
|
|
|
uniform vec3 u_ellipsoidInverseRadiiSquaredUv;
|
|
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
|
|
|
uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid;
|
|
|
#endif
|
|
|
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
|
|
|
uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset
|
|
|
#endif
|
|
|
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
|
|
|
uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset
|
|
|
#endif
|
|
|
uniform float u_ellipsoidInverseHeightDifferenceUv;
|
|
|
|
|
|
// 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));
|
|
|
}
|
|
|
|
|
|
PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
|
|
|
// Convert from UV space [0, 1] to local space [-1, 1]
|
|
|
vec3 position = positionUv * 2.0 - 1.0;
|
|
|
// Undo the scaling from ellipsoid to sphere
|
|
|
position = position * u_ellipsoidRadiiUv;
|
|
|
|
|
|
float longitude = atan(position.y, position.x);
|
|
|
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_ellipsoidRadiiUv.xz);
|
|
|
vec2 surfacePoint = surfacePointAndRadius.xy;
|
|
|
|
|
|
vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquaredUv.xz);
|
|
|
float latitude = atan(normal2d.y, normal2d.x);
|
|
|
vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x));
|
|
|
|
|
|
float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0;
|
|
|
float height = heightSign * length(posEllipse - surfacePoint);
|
|
|
vec3 up = normalize(cross(east, north));
|
|
|
|
|
|
vec3 point = vec3(longitude, latitude, height);
|
|
|
mat3 jacobianT = mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
|
|
|
return PointJacobianT(point, jacobianT);
|
|
|
}
|
|
|
|
|
|
vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
|
|
|
// Longitude: shift & scale to [0, 1]
|
|
|
float longitude = (positionShape.x + czm_pi) / czm_twoPi;
|
|
|
|
|
|
// Correct the angle when max < min
|
|
|
// Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.
|
|
|
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
|
|
|
longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);
|
|
|
#endif
|
|
|
|
|
|
// Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
|
|
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)
|
|
|
longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;
|
|
|
#endif
|
|
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)
|
|
|
longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;
|
|
|
#endif
|
|
|
|
|
|
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
|
|
|
longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;
|
|
|
#endif
|
|
|
|
|
|
// Latitude: shift and scale to [0, 1]
|
|
|
float latitude = (positionShape.y + czm_piOverTwo) / czm_pi;
|
|
|
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
|
|
|
latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;
|
|
|
#endif
|
|
|
|
|
|
// Height: scale to the range [0, 1]
|
|
|
float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv;
|
|
|
|
|
|
return vec3(longitude, latitude, height);
|
|
|
}
|
|
|
|
|
|
PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
|
|
|
PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
|
|
|
pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
|
|
|
return pointJacobian;
|
|
|
}
|
|
|
|
|
|
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
|
|
|
// Convert from [0, 1] to radians [-pi, pi]
|
|
|
float longitude = shapeUv.x * czm_twoPi;
|
|
|
#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
|
|
|
longitude /= u_ellipsoidUvToShapeUvLongitude.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_ellipsoidUvToShapeUvLatitude.x;
|
|
|
#endif
|
|
|
|
|
|
float height = shapeUv.z / u_ellipsoidInverseHeightDifferenceUv;
|
|
|
|
|
|
return vec3(longitude, latitude, height);
|
|
|
}
|
|
|
`;var oYi=_(T(),1),jA=`// 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 SampleData {
|
|
|
int megatextureIndex;
|
|
|
ivec4 tileCoords;
|
|
|
vec3 tileUv;
|
|
|
vec3 inputCoordinate;
|
|
|
#if (SAMPLE_COUNT > 1)
|
|
|
float weight;
|
|
|
#endif
|
|
|
};
|
|
|
|
|
|
// Integer mod: For WebGL1 only
|
|
|
int intMod(in int a, in int b) {
|
|
|
return a - (b * (a / b));
|
|
|
}
|
|
|
int normU8_toInt(in float value) {
|
|
|
return int(value * 255.0);
|
|
|
}
|
|
|
int normU8x2_toInt(in vec2 value) {
|
|
|
return int(value.x * 255.0) + 256 * int(value.y * 255.0);
|
|
|
}
|
|
|
float normU8x2_toFloat(in vec2 value) {
|
|
|
return float(normU8x2_toInt(value)) / 65535.0;
|
|
|
}
|
|
|
|
|
|
OctreeNodeData getOctreeNodeData(in vec2 octreeUv) {
|
|
|
vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);
|
|
|
|
|
|
OctreeNodeData data;
|
|
|
data.data = normU8x2_toInt(texData.xy);
|
|
|
data.flag = normU8x2_toInt(texData.zw);
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {
|
|
|
int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;
|
|
|
int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;
|
|
|
int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;
|
|
|
vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
|
|
|
return getOctreeNodeData(octreeUv);
|
|
|
}
|
|
|
|
|
|
int getOctreeParentIndex(in int octreeIndex) {
|
|
|
int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9;
|
|
|
int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;
|
|
|
vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
|
|
|
vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);
|
|
|
int parentOctreeIndex = normU8x2_toInt(parentData.xy);
|
|
|
return parentOctreeIndex;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Convert a position in the uv-space of the tileset bounding shape
|
|
|
* into the uv-space of a tile within the tileset
|
|
|
*/
|
|
|
vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
|
|
|
// PERFORMANCE_IDEA: use bit-shifting (only in WebGL2)
|
|
|
float dimAtLevel = exp2(float(octreeCoords.w));
|
|
|
return shapePosition * dimAtLevel - vec3(octreeCoords.xyz);
|
|
|
}
|
|
|
|
|
|
vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
|
|
|
vec3 tileUv = getTileUv(shapePosition, octreeCoords);
|
|
|
return clamp(tileUv, vec3(0.0), vec3(1.0));
|
|
|
}
|
|
|
|
|
|
void addSampleCoordinates(in vec3 shapePosition, inout SampleData sampleData) {
|
|
|
vec3 tileUv = getClampedTileUv(shapePosition, sampleData.tileCoords);
|
|
|
|
|
|
vec3 inputCoordinate = tileUv * vec3(u_dimensions);
|
|
|
#if defined(PADDING)
|
|
|
inputCoordinate += vec3(u_paddingBefore);
|
|
|
#endif
|
|
|
#if defined(Y_UP_METADATA_ORDER)
|
|
|
#if defined(SHAPE_BOX)
|
|
|
float inputY = inputCoordinate.y;
|
|
|
inputCoordinate.y = float(u_inputDimensions.y) - inputCoordinate.z;
|
|
|
inputCoordinate.z = inputY;
|
|
|
#elif defined(SHAPE_CYLINDER)
|
|
|
float angle = inputCoordinate.y;
|
|
|
float height = inputCoordinate.z;
|
|
|
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
|
|
|
// Account for the different 0-angle convention in glTF vs 3DTiles
|
|
|
if (sampleData.tileCoords.w == 0) {
|
|
|
float angleCount = float(u_inputDimensions.z);
|
|
|
angle = mod(angle + angleCount / 2.0, angleCount);
|
|
|
}
|
|
|
#endif
|
|
|
inputCoordinate.y = height;
|
|
|
inputCoordinate.z = angle;
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
sampleData.tileUv = tileUv;
|
|
|
sampleData.inputCoordinate = inputCoordinate;
|
|
|
}
|
|
|
|
|
|
void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {
|
|
|
sampleData.megatextureIndex = data.data;
|
|
|
sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)
|
|
|
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
|
|
|
: octreeCoords;
|
|
|
}
|
|
|
|
|
|
#if (SAMPLE_COUNT > 1)
|
|
|
void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {
|
|
|
int leafIndex = data.data;
|
|
|
int leafNodeTexelCount = 2;
|
|
|
// Adding 0.5 moves to the center of the texel
|
|
|
float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
|
|
|
float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;
|
|
|
|
|
|
// Get an interpolation weight and a flag to determine whether to read the parent texture
|
|
|
vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);
|
|
|
vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);
|
|
|
float lerp = normU8x2_toFloat(leafData0.xy);
|
|
|
sampleDatas[0].weight = 1.0 - lerp;
|
|
|
sampleDatas[1].weight = lerp;
|
|
|
// TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT
|
|
|
sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)
|
|
|
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
|
|
|
: octreeCoords;
|
|
|
sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)
|
|
|
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
|
|
|
: octreeCoords;
|
|
|
|
|
|
// Get megatexture indices for both samples
|
|
|
vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);
|
|
|
vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);
|
|
|
sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);
|
|
|
sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) {
|
|
|
float sizeAtLevel = exp2(-1.0 * float(traversalData.octreeCoords.w));
|
|
|
vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel;
|
|
|
vec3 end = start + vec3(sizeAtLevel);
|
|
|
OctreeNodeData childData;
|
|
|
|
|
|
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
|
|
|
// Find out which octree child contains the position
|
|
|
// 0 if before center, 1 if after
|
|
|
vec3 center = 0.5 * (start + end);
|
|
|
vec3 childCoord = step(center, shapePosition);
|
|
|
|
|
|
// Get octree coords for the next level down
|
|
|
ivec4 octreeCoords = traversalData.octreeCoords;
|
|
|
traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1);
|
|
|
|
|
|
childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord));
|
|
|
|
|
|
if (childData.flag != OCTREE_FLAG_INTERNAL) {
|
|
|
// leaf tile - stop traversing
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
// interior tile - keep going deeper
|
|
|
start = mix(start, center, childCoord);
|
|
|
end = mix(center, end, childCoord);
|
|
|
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 vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {
|
|
|
traversalData.octreeCoords = ivec4(0);
|
|
|
traversalData.parentOctreeIndex = 0;
|
|
|
|
|
|
OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));
|
|
|
if (nodeData.flag != OCTREE_FLAG_LEAF) {
|
|
|
nodeData = traverseOctreeDownwards(shapePosition, traversalData);
|
|
|
}
|
|
|
|
|
|
#if (SAMPLE_COUNT == 1)
|
|
|
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
|
|
|
addSampleCoordinates(shapePosition, sampleDatas[0]);
|
|
|
#else
|
|
|
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
|
|
|
addSampleCoordinates(shapePosition, sampleDatas[0]);
|
|
|
addSampleCoordinates(shapePosition, sampleDatas[1]);
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) {
|
|
|
return clamp(v, minVal, maxVal) == v;
|
|
|
}
|
|
|
|
|
|
bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) {
|
|
|
vec3 tileUv = getTileUv(shapePosition, octreeCoords);
|
|
|
bool inside = inRange(tileUv, vec3(0.0), vec3(1.0));
|
|
|
// Assume (!) the position is always inside the root tile.
|
|
|
return inside || octreeCoords.w == 0;
|
|
|
}
|
|
|
|
|
|
void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
|
|
|
if (insideTile(shapePosition, traversalData.octreeCoords)) {
|
|
|
for (int i = 0; i < SAMPLE_COUNT; i++) {
|
|
|
addSampleCoordinates(shapePosition, sampleDatas[i]);
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// Go up tree until we find a parent tile containing shapePosition
|
|
|
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
|
|
|
traversalData.octreeCoords.xyz /= 2;
|
|
|
traversalData.octreeCoords.w -= 1;
|
|
|
|
|
|
if (insideTile(shapePosition, traversalData.octreeCoords)) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
|
|
|
}
|
|
|
|
|
|
// Go down tree
|
|
|
OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData);
|
|
|
|
|
|
#if (SAMPLE_COUNT == 1)
|
|
|
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
|
|
|
addSampleCoordinates(shapePosition, sampleDatas[0]);
|
|
|
#else
|
|
|
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
|
|
|
addSampleCoordinates(shapePosition, sampleDatas[0]);
|
|
|
addSampleCoordinates(shapePosition, sampleDatas[1]);
|
|
|
#endif
|
|
|
}
|
|
|
`;var sYi=_(T(),1),qA=`// See Octree.glsl for the definitions of SampleData and intMod
|
|
|
|
|
|
/* Megatexture defines (set in Scene/VoxelRenderResources.js)
|
|
|
#define SAMPLE_COUNT ###
|
|
|
#define NEAREST_SAMPLING
|
|
|
#define PADDING
|
|
|
*/
|
|
|
|
|
|
uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions
|
|
|
uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions
|
|
|
uniform vec2 u_megatextureVoxelSizeUv;
|
|
|
uniform vec2 u_megatextureSliceSizeUv;
|
|
|
uniform vec2 u_megatextureTileSizeUv;
|
|
|
|
|
|
// Integer min, max, clamp: For WebGL1 only
|
|
|
int intMin(int a, int b) {
|
|
|
return a <= b ? a : b;
|
|
|
}
|
|
|
int intMax(int a, int b) {
|
|
|
return a >= b ? a : b;
|
|
|
}
|
|
|
int intClamp(int v, int minVal, int maxVal) {
|
|
|
return intMin(intMax(v, minVal), maxVal);
|
|
|
}
|
|
|
|
|
|
vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale)
|
|
|
{
|
|
|
int indexX = intMod(index, dimensions.x);
|
|
|
int indexY = index / dimensions.x;
|
|
|
return vec2(indexX, indexY) * uvScale;
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
How is 3D data stored in a 2D megatexture?
|
|
|
|
|
|
In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total).
|
|
|
The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and
|
|
|
the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1).
|
|
|
Note that there could be empty space in the megatexture because it's a power of two.
|
|
|
|
|
|
0 1 2 3
|
|
|
+---+---+---+---+
|
|
|
| | | | | 3
|
|
|
+---+---+---+---+
|
|
|
| | | | | 2
|
|
|
+-------+-------+
|
|
|
|010|110|011|111| 1
|
|
|
|--- ---|--- ---|
|
|
|
|000|100|001|101| 0
|
|
|
+-------+-------+
|
|
|
|
|
|
When doing linear interpolation the megatexture needs to be sampled twice: once for
|
|
|
the Z slice above the voxel coordinate and once for the slice below. The two slices
|
|
|
are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is
|
|
|
halfway between two Z slices so the interpolation factor is 0.5. Below is a side view
|
|
|
of the 3D voxel grid with voxel coordinates on the left side.
|
|
|
|
|
|
2 +---+
|
|
|
|001|
|
|
|
1 +-z-+
|
|
|
|000|
|
|
|
0 +---+
|
|
|
|
|
|
When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice.
|
|
|
*/
|
|
|
|
|
|
Properties getPropertiesFromMegatexture(in SampleData sampleData) {
|
|
|
int tileIndex = sampleData.megatextureIndex;
|
|
|
|
|
|
vec3 voxelCoord = sampleData.inputCoordinate;
|
|
|
#if defined(NEAREST_SAMPLING)
|
|
|
// Round to the center of the nearest voxel
|
|
|
voxelCoord = floor(voxelCoord) + vec3(0.5);
|
|
|
#endif
|
|
|
|
|
|
// Tile location
|
|
|
vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);
|
|
|
|
|
|
// Slice location
|
|
|
float slice = voxelCoord.z - 0.5;
|
|
|
int sliceIndex = int(floor(slice));
|
|
|
int sliceIndex0 = intClamp(sliceIndex, 0, u_inputDimensions.z - 1);
|
|
|
vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
|
|
|
|
|
|
// Voxel location
|
|
|
vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(u_inputDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;
|
|
|
|
|
|
// Final location in the megatexture
|
|
|
vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset;
|
|
|
|
|
|
#if defined(NEAREST_SAMPLING)
|
|
|
return getPropertiesFromMegatextureAtUv(uv0);
|
|
|
#else
|
|
|
float sliceLerp = fract(slice);
|
|
|
int sliceIndex1 = intMin(sliceIndex + 1, u_inputDimensions.z - 1);
|
|
|
vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
|
|
|
vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset;
|
|
|
Properties properties0 = getPropertiesFromMegatextureAtUv(uv0);
|
|
|
Properties properties1 = getPropertiesFromMegatextureAtUv(uv1);
|
|
|
return mixProperties(properties0, properties1, sliceLerp);
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
// Convert an array of sample datas to a final weighted properties.
|
|
|
Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
|
|
|
#if (SAMPLE_COUNT == 1)
|
|
|
return getPropertiesFromMegatexture(sampleDatas[0]);
|
|
|
#else
|
|
|
// When more than one sample is taken the accumulator needs to start at 0
|
|
|
Properties properties = clearProperties();
|
|
|
for (int i = 0; i < SAMPLE_COUNT; ++i) {
|
|
|
float weight = sampleDatas[i].weight;
|
|
|
|
|
|
// Avoid reading the megatexture when the weight is 0 as it can be costly.
|
|
|
if (weight > 0.0) {
|
|
|
Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
|
|
|
tempProperties = scaleProperties(tempProperties, weight);
|
|
|
properties = sumProperties(properties, tempProperties);
|
|
|
}
|
|
|
}
|
|
|
return properties;
|
|
|
#endif
|
|
|
}
|
|
|
`;var cYi=_(T(),1),xyt={Z_UP:0,Y_UP:1},pm=Object.freeze(xyt);function _yt(e){let t=new Cx;this.shaderBuilder=t;let n=e._customShader,i=Rt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,ge.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ge.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([UA]),e.provider.metadataOrder===pm.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,ge.FRAGMENT);let a=e._provider.shape;a==="BOX"?t.addDefine("SHAPE_BOX",void 0,ge.FRAGMENT):a==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,ge.FRAGMENT):a==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,ge.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",jA,NA,DA,qA]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ge.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ge.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ge.FRAGMENT),t.addFragmentLines([BA])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ge.FRAGMENT),t.addFragmentLines([OA])),a==="BOX"?t.addFragmentLines([KA,YA,yS]):a==="CYLINDER"?t.addFragmentLines([JA,ZL,zA,yS]):a==="ELLIPSOID"&&t.addFragmentLines([QA,ZL,HA,yS]),t.addFragmentLines([kA]);let c=e._shape,d=c.shaderDefines;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,ge.FRAGMENT))}let u=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,ge.FRAGMENT),s===1?u+=1:r.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,ge.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,ge.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,ge.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ge.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ge.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,ge.FRAGMENT)}var $A=_yt;var AYi=_(T(),1);function Tyt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,d=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,ge.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,ge.FRAGMENT);for(let W=0;W<c;W++){let v=i[W],A=o[W],b=`PropertyStatistics_${v}`,R=`PropertyStatistics_${v}`;n.addStruct(b,R,ge.FRAGMENT);let G=qO(A);n.addStructField(b,G,"min"),n.addStructField(b,G,"max")}let u="Statistics",h="Statistics",p="statistics";n.addStruct(u,h,ge.FRAGMENT);for(let W=0;W<c;W++){let v=i[W],A=`PropertyStatistics_${v}`,b=v;n.addStructField(u,A,b)}let g="Metadata",f="Metadata",y="metadata";n.addStruct(g,f,ge.FRAGMENT),n.addStructField(g,h,p);for(let W=0;W<c;W++){let v=i[W],A=o[W],b=qO(A);n.addStructField(g,b,v)}for(let W=0;W<c;W++){let v=i[W],A=o[W],b=Cyt(A),R=`VoxelProperty_${v}`,G=`VoxelProperty_${v}`;n.addStruct(R,G,ge.FRAGMENT),n.addStructField(R,b,"partialDerivativeLocal"),n.addStructField(R,b,"partialDerivativeWorld"),n.addStructField(R,b,"partialDerivativeView"),n.addStructField(R,b,"partialDerivativeValid")}let x="Voxel",S="Voxel",C="voxel";n.addStruct(x,S,ge.FRAGMENT);for(let W=0;W<c;W++){let v=i[W],A=`VoxelProperty_${v}`;n.addStructField(x,A,v)}n.addStructField(x,"vec3","positionEC"),n.addStructField(x,"vec3","positionUv"),n.addStructField(x,"vec3","positionShapeUv"),n.addStructField(x,"vec3","positionUvLocal"),n.addStructField(x,"vec3","viewDirUv"),n.addStructField(x,"vec3","viewDirWorld"),n.addStructField(x,"vec3","surfaceNormal"),n.addStructField(x,"float","travelDistance"),n.addStructField(x,"int","stepCount"),n.addStructField(x,"int","tileIndex"),n.addStructField(x,"int","sampleIndex");let V="FragmentInput";n.addStruct(V,"FragmentInput",ge.FRAGMENT),n.addStructField(V,f,y),n.addStructField(V,S,C);let Z="Properties",E="Properties",P="properties";n.addStruct(Z,E,ge.FRAGMENT);for(let W=0;W<c;W++){let v=i[W],A=o[W],b=qO(A);n.addStructField(Z,b,v)}{let W="clearProperties";n.addFunction(W,`${E} clearProperties()`,ge.FRAGMENT),n.addFunctionLines(W,[`${E} ${P};`]);for(let v=0;v<c;v++){let A=i[v],b=o[v],R=r[v],G=qO(b,R);n.addFunctionLines(W,[`${P}.${A} = ${G}(0.0);`])}n.addFunctionLines(W,[`return ${P};`])}{let W="sumProperties";n.addFunction(W,`${E} sumProperties(${E} propertiesA, ${E} propertiesB)`,ge.FRAGMENT),n.addFunctionLines(W,[`${E} ${P};`]);for(let v=0;v<c;v++){let A=i[v];n.addFunctionLines(W,[`${P}.${A} = propertiesA.${A} + propertiesB.${A};`])}n.addFunctionLines(W,[`return ${P};`])}{let W="scaleProperties";n.addFunction(W,`${E} scaleProperties(${E} ${P}, float scale)`,ge.FRAGMENT),n.addFunctionLines(W,[`${E} scaledProperties = ${P};`]);for(let v=0;v<c;v++){let A=i[v];n.addFunctionLines(W,[`scaledProperties.${A} *= scale;`])}n.addFunctionLines(W,["return scaledProperties;"])}{let W="mixProperties";n.addFunction(W,`${E} mixProperties(${E} propertiesA, ${E} propertiesB, float mixFactor)`,ge.FRAGMENT),n.addFunctionLines(W,[`${E} ${P};`]);for(let v=0;v<c;v++){let A=i[v];n.addFunctionLines(W,[`${P}.${A} = mix(propertiesA.${A}, propertiesB.${A}, mixFactor);`])}n.addFunctionLines(W,[`return ${P};`])}{let W="copyPropertiesToMetadata";n.addFunction(W,`void copyPropertiesToMetadata(in ${E} ${P}, inout ${f} ${y})`,ge.FRAGMENT);for(let v=0;v<c;v++){let A=i[v];n.addFunctionLines(W,[`${y}.${A} = ${P}.${A};`])}}if(d){let W="setStatistics";n.addFunction(W,`void setStatistics(inout ${h} ${p})`,ge.FRAGMENT);for(let v=0;v<c;v++){let A=i[v],b=o[v],R=mt.getComponentCount(b);for(let G=0;G<R;G++){let I=Vyt(b,G),w=s[v][G],M=a[v][G];!l(w)||!l(M)||n.addFunctionLines(W,[`${p}.${A}.min${I} = ${QTe(w)};`,`${p}.${A}.max${I} = ${QTe(M)};`])}}}{let W="getPropertiesFromMegatextureAtUv";n.addFunction(W,`${E} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ge.FRAGMENT),n.addFunctionLines(W,[`${E} ${P};`]);for(let v=0;v<c;v++){let A=i[v],b=o[v],R=r[v],G=Syt(b,R);n.addFunctionLines(W,[`properties.${A} = texture(u_megatextureTextures[${v}], texcoord)${G};`])}n.addFunctionLines(W,[`return ${P};`])}}function qO(e){if(e===mt.SCALAR)return"float";if(e===mt.VEC2)return"vec2";if(e===mt.VEC3)return"vec3";if(e===mt.VEC4)return"vec4"}function Syt(e){if(e===mt.SCALAR)return".r";if(e===mt.VEC2)return".ra";if(e===mt.VEC3)return".rgb";if(e===mt.VEC4)return""}function Cyt(e){if(e===mt.SCALAR)return"vec3";if(e===mt.VEC2)return"mat2";if(e===mt.VEC3)return"mat3";if(e===mt.VEC4)return"mat4"}function QTe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function Vyt(e,t){return e===mt.SCALAR?"":`[${t}]`}var e9=Tyt;function Lyt(e,t){let n=new $A(e);e9(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let S="getClippingPlane",C=u0(o,t),V=0,L=C.indexOf(")")+1,Z=C.indexOf("{",L)+1,E=C.indexOf("}",Z),P=C.slice(V,L),W=C.slice(Z,E);i.addFunction(S,P,ge.FRAGMENT),i.addFunctionLines(S,[W])}let s=i.clone();s.addDefine("PICKING",void 0,ge.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ge.FRAGMENT);let c=i.buildShaderProgram(t),d=s.buildShaderProgram(t),u=a.buildShaderProgram(t),h=Ue.fromCache({cull:{enabled:!0,face:Ti.BACK},depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,f=new $e({vertexArray:p,primitiveType:Ae.TRIANGLES,renderState:h,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ge.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),y=$e.shallowClone(f,new $e);y.shaderProgram=d,y.pickOnly=!0;let x=$e.shallowClone(f,new $e);if(x.shaderProgram=u,x.pickOnly=!0,l(e._drawCommand)){let S=e._drawCommand;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}if(l(e._drawCommandPick)){let S=e._drawCommandPick;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let S=e._drawCommandPickVoxel;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}e._drawCommand=f,e._drawCommandPick=y,e._drawCommandPickVoxel=x}var t9=Lyt;var xzi=_(T(),1);var qYi=_(T(),1),Ryt={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"},GL=Object.freeze(Ryt);var lzi=_(T(),1);function EL(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}EL.prototype.getTexture=function(e){return this._textures[e]};function Zyt(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})}EL.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):Zyt(this,e,t)};function Gyt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?$O(o,r,n):Eyt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function $O(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?qTe(e,n):new vt({context:n,source:t,sampler:o});return jTe(o)&&r.generateMipmap(),r}function Eyt(e,t,n){let{typedArray:i,sampler:o}=e,r=jTe(o),s=o.wrapS===Ln.REPEAT||o.wrapS===Ln.MIRRORED_REPEAT||o.wrapT===Ln.REPEAT||o.wrapT===Ln.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,d=[a,c].every(X.isPowerOfTwo);if((r||s)&&!d)if(l(i)){if(e.pixelDatatype===je.UNSIGNED_BYTE){let h=nI(i,a,c),p=gg(h);return $O({sampler:o},p,n)}}else{let h=gg(t);return $O(e,h,n)}else return $O(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),qTe(e,n)}function jTe(e){return[en.NEAREST_MIPMAP_NEAREST,en.NEAREST_MIPMAP_LINEAR,en.LINEAR_MIPMAP_NEAREST,en.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function qTe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new vt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}EL.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];Gyt(this,o,t)}n.length=0};EL.prototype.isDestroyed=function(){return!1};EL.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 me(this)};var n9=EL;function i9(e){e=e??Y.EMPTY_OBJECT,this.mode=e.mode??Pb.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??Y.EMPTY_OBJECT,this.varyings=e.varyings??Y.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Jg.INHERIT,this._textureManager=new n9,this._defaultTexture=void 0,this.uniformMap=Iyt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Pyt(this),vyt(this)}function Iyt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===GL.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=Xyt(e,i)):n[i]=Wyt(e,i)}return n}function Xyt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function Wyt(e,t){return function(){return e.uniforms[t].value}}function xS(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function Pyt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,xS(r,t,o),o=e.usedVariablesVertex.featureIdSet,xS(r,n,o),o=e.usedVariablesVertex.metadataSet,xS(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,xS(s,t,o),o=e.usedVariablesFragment.featureIdSet,xS(s,n,o),o=e.usedVariablesFragment.metadataSet,xS(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;xS(s,a,c)}}function $Te(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 Wc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${$Te(t)} is not available in the ${i} shader. Did you mean ${$Te(n)} instead?`;throw new fe(o)}}function vyt(e){let t=e.usedVariablesVertex.attributeSet;Wc(t,"position","positionMC","vertex"),Wc(t,"normal","normalMC","vertex"),Wc(t,"tangent","tangentMC","vertex"),Wc(t,"bitangent","bitangentMC","vertex"),Wc(t,"positionWC","positionMC","vertex"),Wc(t,"positionEC","positionMC","vertex"),Wc(t,"normalEC","normalMC","vertex"),Wc(t,"tangentEC","tangentMC","vertex"),Wc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Wc(n,"position","positionEC","fragment"),Wc(n,"normal","normalEC","fragment"),Wc(n,"tangent","tangentEC","fragment"),Wc(n,"bitangent","bitangentEC","fragment"),Wc(n,"normalMC","normalEC","fragment"),Wc(n,"tangentMC","tangentEC","fragment"),Wc(n,"bitangentMC","bitangentEC","fragment")}i9.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===GL.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};i9.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};i9.prototype.isDestroyed=function(){return!1};i9.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),me(this)};var _S=i9;var Zzi=_(T(),1);function L0(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(L0.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});L0.fromMetadataArray=function(e){return new L0({metadata:e})};L0.fromGltf=async function(e){let t=new ah({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new L0({loader:t})};L0.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=wyt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function wyt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(u=>u.class.id===i),{properties:c}=a,d=new Array(o.length);for(let u=0;u<e.length;u++){let h=c[o[u]].attribute,p=e.find(x=>x.name===h);if(!l(p))continue;let g=Mt.toComponentDatatype(s[u]),f=mt.getComponentCount(r[u]),y=p.count*f;d[u]=Q.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return d}L0.prototype.isDestroyed=function(){return!1};L0.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),me(this)};var TS=L0;var aHi=_(T(),1);var wzi=_(T(),1);function id(){this.orientedBoundingBox=new Xn,this.boundingSphere=new de,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=m.clone(id.DefaultMinBounds,new m),this._maxBounds=m.clone(id.DefaultMaxBounds,new m),this.shaderUniforms={renderMinBounds:new m,renderMaxBounds:new m,boxUvToShapeUvScale:new m,boxUvToShapeUvTranslate:new m},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var Fyt=new m,V7=new m,Ayt=new $,Myt=new m,Nyt=new m,kyt=new m,Uyt=new m,eSe=F.fromRotationTranslation($.fromUniformScale(.5,new $),new m(.5,.5,.5),new F);id.prototype.update=function(e,t,n,i,o){i=i??id.DefaultMinBounds,o=o??id.DefaultMaxBounds;let r=id.DefaultMinBounds,s=id.DefaultMaxBounds;t=this._minBounds=m.clamp(t,r,s,this._minBounds),n=this._maxBounds=m.clamp(n,r,s,this._maxBounds),i=m.clamp(i,r,s,Myt),o=m.clamp(o,r,s,Nyt);let a=m.clamp(t,i,o,kyt),c=m.clamp(n,i,o,Uyt),d=F.getScale(e,V7);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||d.x===0||d.y===0||d.z===0)return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=R7(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=de.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:u,shaderDefines:h}=this;for(let f in h)h.hasOwnProperty(f)&&(h[f]=void 0);let p=!m.equals(t,r)||!m.equals(n,s),g=0;if(h.BOX_INTERSECTION_INDEX=g,g+=1,u.renderMinBounds=F.multiplyByPoint(eSe,a,u.renderMinBounds),u.renderMaxBounds=F.multiplyByPoint(eSe,c,u.renderMaxBounds),p){h.BOX_HAS_SHAPE_BOUNDS=!0;let f=t,y=n;u.boxUvToShapeUvScale=m.fromElements(2/(f.x===y.x?1:y.x-f.x),2/(f.y===y.y?1:y.y-f.y),2/(f.z===y.z?1:y.z-f.z),u.boxUvToShapeUvScale),u.boxUvToShapeUvTranslate=m.fromElements(-u.boxUvToShapeUvScale.x*(f.x*.5+.5),-u.boxUvToShapeUvScale.y*(f.y*.5+.5),-u.boxUvToShapeUvScale.z*(f.z*.5+.5),u.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var e3=new m,L7=new m;id.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(X.lerp(r.x,s.x,a*t),X.lerp(r.y,s.y,a*n),X.lerp(r.z,s.z,a*i),e3),d=m.fromElements(X.lerp(r.x,s.x,a*(t+1)),X.lerp(r.y,s.y,a*(n+1)),X.lerp(r.z,s.z,a*(i+1)),L7);return R7(c,d,this.shapeTransform,o)};var tSe=new m;id.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,tSe),s=m.multiplyByScalar(r,o,tSe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,e3),o,e3),c=m.add(a,s,L7),d=this._minBounds,u=this._maxBounds,h=m.fromElements(X.lerp(d.x,u.x,a.x),X.lerp(d.y,u.y,a.y),X.lerp(d.z,u.z,a.z),e3),p=m.fromElements(X.lerp(d.x,u.x,c.x),X.lerp(d.y,u.y,c.y),X.lerp(d.z,u.z,c.z),L7);return R7(h,p,this.shapeTransform,i)};id.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));id.DefaultMaxBounds=Object.freeze(new m(1,1,1));function R7(e,t,n,i){let o=id.DefaultMinBounds,r=id.DefaultMaxBounds;if(m.equals(e,o)&&m.equals(t,r))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,V7),c=m.midpoint(e,t,Fyt);i.center=F.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),V7);let d=F.getRotation(n,Ayt);i.halfAxes=$.setScale(d,a,i.halfAxes)}return i}var cp=id;var Yzi=_(T(),1);function ls(){this.orientedBoundingBox=new Xn,this.boundingSphere=new de,this.boundTransform=new F,this.shapeTransform=new F,this._minimumRadius=ls.DefaultMinBounds.x,this._maximumRadius=ls.DefaultMaxBounds.x,this._minimumAngle=ls.DefaultMinBounds.y,this._maximumAngle=ls.DefaultMaxBounds.y,this._minimumHeight=ls.DefaultMinBounds.z,this._maximumHeight=ls.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderRadiusMinMax:new U,cylinderRenderAngleMinMax:new U,cylinderRenderHeightMinMax:new U,cylinderUvToShapeUvRadius:new U,cylinderUvToShapeUvAngle:new U,cylinderUvToShapeUvHeight:new U,cylinderShapeUvAngleMinMax:new U,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var rSe=new m;ls.prototype.update=function(e,t,n,i,o){i=i??ls.DefaultMinBounds,o=o??ls.DefaultMaxBounds;let r=ls.DefaultMinBounds.x,s=ls.DefaultMaxBounds.x,a=ls.DefaultMinBounds.y,c=ls.DefaultMaxBounds.y,d=ls.DefaultMinBounds.z,u=ls.DefaultMaxBounds.z,h=c-a,p=.5*h,g=X.EPSILON10,f=X.EPSILON3,y=X.EPSILON10,x=X.clamp(t.x,r,s),S=X.clamp(n.x,r,s),C=X.clamp(i.x,r,s),V=X.clamp(o.x,r,s),L=Math.max(x,C),Z=Math.min(S,V),E=X.negativePiToPi(t.y),P=X.negativePiToPi(n.y),W=X.negativePiToPi(i.y),v=X.negativePiToPi(o.y),A=Math.max(E,W),b=Math.min(P,v),R=X.clamp(t.z,d,u),G=X.clamp(n.z,d,u),I=X.clamp(i.z,d,u),w=X.clamp(o.z,d,u),M=Math.max(R,I),O=Math.min(G,w),k=F.getScale(e,rSe);if(Z===0||L>Z||M>O||X.equalsEpsilon(k.x,0,void 0,g)||X.equalsEpsilon(k.y,0,void 0,g)||X.equalsEpsilon(k.z,0,void 0,g))return!1;this._minimumRadius=x,this._maximumRadius=S,this._minimumAngle=E,this._maximumAngle=P,this._minimumHeight=R,this._maximumHeight=G,this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=G7(L,Z,A,b,M,O,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=de.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let z=x===r&&S===s,K=P<E,te=P-E+K*h,H=te>p+y&&te<h-y,j=te<p-y,ee=te>=p-y&&te<=p+y,pe=H||j||ee,_e=X.equalsEpsilon(E,a,void 0,f),ae=X.equalsEpsilon(P,c,void 0,f),ye=R===d&&G===u,Se=L===r,Ee=b<A,Ie=b-A+Ee*h,Fe=Ie>=p-y&&Ie<h-y,ve=Ie>y&&Ie<p-y,ct=Ie<=y,Je=Fe||ve||ct,{shaderUniforms:bt,shaderDefines:Qe}=this;for(let ft in Qe)Qe.hasOwnProperty(ft)&&(Qe[ft]=void 0);let Tt=0;if(Qe.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Tt,Tt+=1,Se||(Qe.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Qe.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Tt,Tt+=1),bt.cylinderRenderRadiusMinMax=U.fromElements(L,Z,bt.cylinderRenderRadiusMinMax),L===Z&&(Qe.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!z){Qe.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let ft=S-x,gt=0,En=1;ft!==0&&(gt=1/ft,En=-x/ft),bt.cylinderUvToShapeUvRadius=U.fromElements(gt,En,bt.cylinderUvToShapeUvRadius)}if(!ye){Qe.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let ft=G-R,gt=0,En=1;ft!==0&&(gt=2/ft,En=-(R+1)/ft),bt.cylinderUvToShapeUvHeight=U.fromElements(gt,En,bt.cylinderUvToShapeUvHeight)}if(bt.cylinderRenderHeightMinMax=U.fromElements(M,O,bt.cylinderRenderHeightMinMax),K&&(Qe.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Je&&(Qe.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Qe.CYLINDER_INTERSECTION_INDEX_ANGLE=Tt,Fe?(Qe.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Tt+=1):ve?(Qe.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Tt+=2):ct&&(Qe.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Tt+=2),bt.cylinderRenderAngleMinMax=U.fromElements(A,b,bt.cylinderRenderAngleMinMax)),pe){Qe.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,_e&&(Qe.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),ae&&(Qe.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let ft=(E-a)/h,gt=(P-a)/h,En=1-te/h;if(bt.cylinderShapeUvAngleMinMax=U.fromElements(ft,gt,bt.cylinderShapeUvAngleMinMax),bt.cylinderShapeUvAngleRangeZeroMid=(gt+.5*En)%1,te<=y)bt.cylinderUvToShapeUvAngle=U.fromElements(0,1,bt.cylinderUvToShapeUvAngle);else{let cn=h/te,Ce=-(E-a)/te;bt.cylinderUvToShapeUvAngle=U.fromElements(cn,Ce,bt.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=Tt,!0};ls.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumAngle,c=this._maximumAngle,d=this._minimumHeight,u=this._maximumHeight,h=1/Math.pow(2,e),p=X.lerp(r,s,t*h),g=X.lerp(r,s,(t+1)*h),f=X.lerp(a,c,n*h),y=X.lerp(a,c,(n+1)*h),x=X.lerp(d,u,i*h),S=X.lerp(d,u,(i+1)*h);return G7(p,g,f,y,x,S,this.shapeTransform,o)};var nSe=new m,iSe=new m,Dyt=new m;ls.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,nSe),s=m.multiplyByScalar(r,o,nSe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,iSe),o,iSe),c=m.add(a,s,Dyt),d=this._minimumRadius,u=this._maximumRadius,h=this._minimumHeight,p=this._maximumHeight,g=this._minimumAngle,f=this._maximumAngle,y=X.lerp(d,u,a.x),x=X.lerp(d,u,c.x),S=X.lerp(h,p,a.y),C=X.lerp(h,p,c.y),V=X.lerp(g,f,a.z),L=X.lerp(g,f,c.z);return G7(y,x,V,L,S,C,this.shapeTransform,i)};ls.DefaultMinBounds=Object.freeze(new m(0,-X.PI,-1));ls.DefaultMaxBounds=Object.freeze(new m(1,+X.PI,1));var Oyt=5,Byt=new Array(Oyt),Yyt=new m,zyt=new $,Hyt=new F,Kyt=new F,Jyt=new F,Z7=new F,Qyt=new m,jyt=new m,qyt=new m,sSe=new Array(8);for(let e=0;e<8;e++)sSe[e]=new m;function oSe(e,t,n){return Math.abs(re.dot(e,t))<n}function $yt(e){let t=F.getColumn(e,0,Qyt),n=F.getColumn(e,1,jyt),i=F.getColumn(e,2,qyt),o=X.EPSILON4;return oSe(t,n,o)&&oSe(n,i,o)}function ext(e,t){let n=sSe;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)F.multiplyByPoint(e,n[i],n[i]);return Xn.fromPoints(n,t)}function G7(e,t,n,i,o,r,s,a){let c=ls.DefaultMinBounds,d=ls.DefaultMaxBounds,u=c.x,h=d.x,p=c.y,g=d.y,f=c.z,y=d.z;if(e===u&&t===h&&o===f&&r===y&&n===p&&i===g)return a.center=F.getTranslation(s,a.center),a.halfAxes=F.getMatrix3(s,a.halfAxes),a;i<n&&(i+=X.TWO_PI);let S=i-n,C=n+S*.5,V=Byt,L=0;V[L++]=n,V[L++]=i,V[L++]=C,S>X.PI&&(V[L++]=C-X.PI_OVER_TWO,V[L++]=C+X.PI_OVER_TWO);let Z=1,E=1,P=-1,W=-1;for(let te=0;te<L;++te){let H=V[te]-C,j=Math.cos(H),ee=Math.sin(H),pe=j*e,_e=ee*e,ae=j*t,ye=ee*t;Z=Math.min(Z,pe),E=Math.min(E,_e),Z=Math.min(Z,ae),E=Math.min(E,ye),P=Math.max(P,pe),W=Math.max(W,_e),P=Math.max(P,ae),W=Math.max(W,ye)}let v=P-Z,A=W-E,b=r-o,R=(Z+P)*.5,G=(E+W)*.5,I=(o+r)*.5,w=m.fromElements(R,G,I,Yyt),M=$.fromRotationZ(C,zyt),O=m.fromElements(v,A,b,rSe),k=F.fromScale(O,Jyt),B=F.fromRotation(M,Kyt),N=F.fromTranslation(w,Hyt),z=F.multiplyTransformation(B,F.multiplyTransformation(N,k,Z7),Z7),K=F.multiplyTransformation(s,z,Z7);return $yt(K)?Xn.fromTransformation(K,a):ext(K,a)}var SS=ls;var nHi=_(T(),1);function R0(){this.orientedBoundingBox=new Xn,this.boundingSphere=new de,this.boundTransform=new F,this.shapeTransform=new F,this._rectangle=new le,this._minimumHeight=R0.DefaultMinBounds.z,this._maximumHeight=R0.DefaultMaxBounds.z,this._ellipsoid=new ne,this._translation=new m,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new m,eccentricitySquared:0,evoluteScale:new U,ellipsoidInverseRadiiSquaredUv:new m,ellipsoidRenderLongitudeMinMax:new U,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidUvToShapeUvLongitude:new U,ellipsoidUvToShapeUvLatitude:new U,ellipsoidRenderLatitudeSinMinMax:new U,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new U},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var txt=new m,nxt=new m,ixt=new m,oxt=new m,rxt=new m,sxt=new m,axt=new m,cxt=new m,lxt=new $,aSe=new m,cSe=new m,dxt=new le;R0.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=R0;i=i??r,o=o??s;let a=X.EPSILON10,c=X.EPSILON3,d=X.EPSILON10,u=X.EPSILON10,h=X.EPSILON3,p=F.getScale(e,cxt),g=m.clone(r,txt);g.z=-m.minimumComponent(p);let f=m.clamp(t,g,s,nxt),y=m.clamp(n,g,s,ixt),x=m.clamp(i,g,s,oxt),S=m.clamp(o,g,s,rxt),C=m.maximumByComponent(f,x,sxt),V=m.minimumByComponent(y,S,axt),L=m.add(p,m.fromElements(y.z,y.z,y.z,aSe),aSe),Z=m.maximumComponent(L),E=m.add(p,m.fromElements(V.z,V.z,V.z,cSe),cSe);if(C.y>V.y||C.y===s.y||V.y===r.y||C.z>V.z||X.equalsEpsilon(E,m.ZERO,void 0,a))return!1;this._rectangle=le.fromRadians(f.x,f.y,y.x,y.y),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=ne.fromCartesian3(p,this._ellipsoid),this._minimumHeight=f.z,this._maximumHeight=y.z;let P=le.fromRadians(C.x,C.y,V.x,V.y,dxt);this.orientedBoundingBox=E7(P,C.z,V.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=F.fromRotationTranslation($.setScale(this._rotation,L,lxt),this._translation,this.shapeTransform),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=de.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let W=s.x-r.x,v=.5*W,A=V.x<C.x,b=V.x-C.x+A*W,R=b<=d,G=b>=v-d&&b<W-d,I=b>d&&b<v-d,w=R||G||I,M=y.x<f.x,O=y.x-f.x+M*W,k=O>v+d&&O<W-d,B=O>=v-d&&O<=v+d,N=O<v-d,z=k||B||N,K=V.y<-h,te=V.y>=-h&&V.y<=+h,H=V.y>+h&&V.y<s.y-u,j=K||te||H,ee=C.y>r.y+u&&C.y<-h,pe=C.y>=-h&&C.y<=+h,_e=C.y>+h,ae=ee||pe||_e,ye=j||ae,Se=y.y-f.y,Ee=y.y<-h,Ie=y.y>=-h&&y.y<=+h,Fe=y.y>+h&&y.y<s.y-u,ve=Ee||Ie||Fe,ct=f.y>r.y+u&&f.y<-h,Je=f.y>=-h&&f.y<=+h,bt=f.y>+h,Tt=ve||(ct||Je||bt),{shaderUniforms:ft,shaderDefines:gt}=this;for(let mn in gt)gt.hasOwnProperty(mn)&&(gt[mn]=void 0);ft.ellipsoidRadiiUv=m.divideByScalar(L,Z,ft.ellipsoidRadiiUv);let{x:En,z:cn}=ft.ellipsoidRadiiUv,Ce=cn/En;ft.eccentricitySquared=1-Ce*Ce,ft.evoluteScale=U.fromElements((En*En-cn*cn)/En,(cn*cn-En*En)/cn,ft.evoluteScale),ft.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(ft.ellipsoidRadiiUv,ft.ellipsoidRadiiUv,ft.ellipsoidInverseRadiiSquaredUv),ft.ellipsoidInverseRadiiSquaredUv);let Le=0;gt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Le,Le+=1,gt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Le,Le+=1,ft.clipMinMaxHeight=U.fromElements((C.z-y.z)/Z,(V.z-y.z)/Z,ft.clipMinMaxHeight);let St=(y.z-f.z)/Z;if(ft.ellipsoidInverseHeightDifferenceUv=1/St,f.z===y.z&&(ft.ellipsoidInverseHeightDifferenceUv=0),w&&(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,gt.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Le,G?(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Le+=1):I?(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Le+=2):R&&(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Le+=2),ft.ellipsoidRenderLongitudeMinMax=U.fromElements(C.x,V.x,ft.ellipsoidRenderLongitudeMinMax)),z)if(gt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,y.x<f.x&&(gt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),O<=d)ft.ellipsoidUvToShapeUvLongitude=U.fromElements(0,1,ft.ellipsoidUvToShapeUvLongitude);else{let to=W/O,He=-(f.x-r.x)/O;ft.ellipsoidUvToShapeUvLongitude=U.fromElements(to,He,ft.ellipsoidUvToShapeUvLongitude)}if(w){let mn=X.equalsEpsilon(C.x,r.x,void 0,c),to=X.equalsEpsilon(V.x,s.x,void 0,c);mn&&(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),to&&(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let He=(f.x-r.x)/W,yr=(y.x-r.x)/W,cr=(V.x-r.x)/W,ma=1-b/W,Me=(cr+.5*ma)%1;ft.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(He,yr,Me,ft.ellipsoidShapeUvLongitudeMinMaxMid)}if(ye&&(ae&&(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,gt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Le,ee?(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Le+=1):pe?(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Le+=1):_e&&(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Le+=2)),j&&(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,gt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Le,K?(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Le+=2):te?(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Le+=1):H&&(gt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Le+=1)),ft.ellipsoidRenderLatitudeSinMinMax=U.fromElements(Math.sin(C.y),Math.sin(V.y),ft.ellipsoidRenderLatitudeSinMinMax)),Tt)if(gt.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Se<u)ft.ellipsoidUvToShapeUvLatitude=U.fromElements(0,1,ft.ellipsoidUvToShapeUvLatitude);else{let to=(s.y-r.y)/Se,He=(r.y-f.y)/Se;ft.ellipsoidUvToShapeUvLatitude=U.fromElements(to,He,ft.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Le,!0};var uSe=new le;R0.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,d=(n+1)*r,u=i*r,h=(i+1)*r,p=le.subsection(this._rectangle,s,c,a,d,uSe),g=X.lerp(this._minimumHeight,this._maximumHeight,u),f=X.lerp(this._minimumHeight,this._maximumHeight,h);return E7(p,g,f,this._ellipsoid,this._translation,this._rotation,o)};var lSe=new m,dSe=new m,uxt=new m;R0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,lSe),s=m.multiplyByScalar(r,o,lSe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,dSe),o,dSe),c=m.add(a,s,uxt),d=le.subsection(this._rectangle,a.x,a.y,c.x,c.y,uSe),u=X.lerp(this._minimumHeight,this._maximumHeight,a.z),h=X.lerp(this._minimumHeight,this._maximumHeight,c.z);return E7(d,u,h,this._ellipsoid,this._translation,this._rotation,i)};function E7(e,t,n,i,o,r,s){return s=Xn.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}R0.DefaultMinBounds=Object.freeze(new m(-X.PI,-X.PI_OVER_TWO,-ne.WGS84.minimumRadius));R0.DefaultMaxBounds=Object.freeze(new m(X.PI,X.PI_OVER_TWO,10*ne.WGS84.maximumRadius));var CS=R0;var su={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};su.getMinBounds=function(e){switch(e){case su.BOX:return cp.DefaultMinBounds;case su.ELLIPSOID:return CS.DefaultMinBounds;case su.CYLINDER:return SS.DefaultMinBounds}};su.getMaxBounds=function(e){switch(e){case su.BOX:return cp.DefaultMaxBounds;case su.ELLIPSOID:return CS.DefaultMaxBounds;case su.CYLINDER:return SS.DefaultMaxBounds}};su.getShapeConstructor=function(e){switch(e){case su.BOX:return cp;case su.ELLIPSOID:return CS;case su.CYLINDER:return SS}};var Ni=Object.freeze(su);var rKi=_(T(),1);var lHi=_(T(),1),I7=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function o9(e,t){this.spatialNode=e,this.keyframe=t,this.state=I7.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}o9.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=I7.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};o9.priorityComparator=function(e,t){return e.priority-t.priority};o9.searchComparator=function(e,t){return e.keyframe-t.keyframe};o9.LoadState=I7;var _o=o9;var GHi=_(T(),1);function Oy(e,t,n,i,o){if(o=Math.min(o??128*1024*1024,536870912),i===Mt.UNSIGNED_SHORT&&(i=Mt.FLOAT32),i===Mt.FLOAT32&&!e.floatingPointTexture)throw new ce("Floating point texture not supported");let s=mxt(i),a=hxt(n,e.webgl2),c=Mt.getSizeInBytes(i),d=fxt(o,n,c),u=Math.ceil(Math.sqrt(t.x)),h=Math.ceil(t.z/u),p=u*t.x,g=h*t.y,f=Math.floor(d/p),y=Math.floor(d/g);if(f===0||y===0)throw new ce("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*n*d**2,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=f*y,this.regionCountPerMegatexture=new U(f,y),this.voxelCountPerRegion=new U(p,g),this.sliceCountPerRegion=new U(u,h),this.voxelSizeUv=new U(1/d,1/d),this.sliceSizeUv=new U(t.x/d,t.y/d),this.regionSizeUv=new U(p/d,g/d),this.texture=new vt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:d,height:d,sampler:new tn({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:en.LINEAR,magnificationFilter:fi.LINEAR})});let x=Mt.toComponentDatatype(i);this.tileVoxelDataTemp=Q.createTypedArray(x,p*g*n),this.nodes=new Array(this.maximumTileCount);for(let S=0;S<this.maximumTileCount;S++)this.nodes[S]=new pxt(S);for(let S=0;S<this.maximumTileCount;S++){let C=this.nodes[S];C.previousNode=S>0?this.nodes[S-1]:void 0,C.nextNode=S<this.maximumTileCount-1?this.nodes[S+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function mxt(e){if(e===Mt.FLOAT32||e===Mt.FLOAT64)return je.FLOAT;if(e===Mt.UINT8)return je.UNSIGNED_BYTE}function hxt(e,t){if(e===1)return t?ot.RED:ot.LUMINANCE;if(e===2)return t?ot.RG:ot.LUMINANCE_ALPHA;if(e===3)return ot.RGB;if(e===4)return ot.RGBA}function fxt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(Dt.maximumTextureSize,X.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function pxt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Oy.prototype.add=function(e){if(this.isFull())throw new fe("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};Oy.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new fe("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--};Oy.prototype.isFull=function(){return this.emptyList===void 0};Oy.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Mt.UNSIGNED_SHORT&&(i=Mt.FLOAT32);let o=Mt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,d=a*t.y,u=X.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(u/c),g=Math.floor(u/d);if(p*g>=e)break;u*=2}return u*u*n*o};Oy.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,{tileVoxelDataTemp:i,voxelCountPerTile:o,sliceCountPerRegion:r,voxelCountPerRegion:s,channelCount:a,regionCountPerMegatexture:c}=this;for(let g=0;g<o.z;g++){let f=g%r.x*o.x,y=Math.floor(g/r.x)*o.y;for(let x=0;x<o.y;x++){let S=bxt(o,x,g),C=(y+x)*s.x+f;for(let V=0;V<o.x;V++){let L=S+V,Z=C+V;for(let E=0;E<a;E++)i[Z*a+E]=n[L*a+E]}}}let d=e%c.x*s.x,u=Math.floor(e/c.x)*s.y,p={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:d,yOffset:u};this.texture.copyFrom(p)};function bxt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}Oy.prototype.isDestroyed=function(){return!1};Oy.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),me(this)};var IL=Oy;var MHi=_(T(),1);function bm(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=m.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Xn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var gxt=new m;bm.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,gxt),n=2*m.maximumComponent(t);this.approximateVoxelSize=n/m.minimumComponent(this.dimensions)};bm.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,d=r+1,u=a+1,h=t+1,p=[[h,r,s,a],[h,d,s,a],[h,r,c,a],[h,d,c,a],[h,r,s,u],[h,d,s,u],[h,r,c,u],[h,d,c,u]];this.children=p.map(([g,f,y,x])=>new bm(g,f,y,x,this,e,this.dimensions))};bm.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};bm.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,X.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var mSe={keyframe:0};function r9(e,t){return mSe.keyframe=e,Wo(t,mSe,_o.searchComparator)}bm.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=yxt(i,h),g=h[p],f=o===i||i<g.keyframe?p:Math.min(p+1,h.length-1),y=h[f],x=i-g.keyframe,S=hSe(n-t.level,x);S<a&&(a=S,r=g);let C=y.keyframe-o,V=hSe(n-t.level,C);if(V<c&&(c=V,s=y),x===0&&C===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:X.clamp((e-d)/(u-d),0,1)};function yxt(e,t){let n=r9(e,t);return n<0?X.clamp(~n-1,0,t.length-1):n}function hSe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}bm.prototype.isVisited=function(e){return this.visitedFrameNumber===e};bm.prototype.createKeyframeNode=function(e){let t=r9(e,this.keyframeNodes);if(t<0){t=~t;let n=new _o(this,e);this.keyframeNodes.splice(t,0,n)}};bm.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=r9(n,this.keyframeNodes);if(i<0)throw new fe("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=r9(n,this.renderableKeyframeNodes);if(o<0)throw new fe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};bm.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new fe("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let r=0;r<t.length;r++){let s=t[r];e.megatextureIndex=s.add(n[r])}let i=this.renderableKeyframeNodes,o=r9(e.keyframe,i);if(o>=0)throw new fe("Keyframe already renderable");o=~o,i.splice(o,0,e)};bm.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 s9=bm;function By(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:c,componentTypes:d,metadataOrder:u}=o,h=m.add(r,s,new m);if(m.add(h,a,h),u===pm.Y_UP){let V=h.y;h.y=h.z,h.z=V}!l(i)&&l(o.maximumTileCount)&&(i=Xxt(o.maximumTileCount,h,c,d)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(c.length);for(let V=0;V<c.length;V++){let L=c[V],Z=mt.getComponentCount(L),E=d[V];this.megatextures[V]=new IL(t,h,Z,E,i),this.textureMemoryByteLength+=this.megatextures[V].textureMemoryByteLength}let p=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let g=e._shape;this.rootNode=new s9(0,0,0,0,void 0,g,r),this._priorityQueue=new Ox({maximumLength:p,comparator:_o.priorityComparator}),this._highPriorityKeyframeNodes=new Array(p),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(p),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let f=this._binaryTreeKeyframeWeighting;f[0]=0,f[n-1]=0,X7(f,1,n-2,0);let y=9,x=2048,S=Math.floor(x/y),C=Math.ceil(p/S);this.internalNodeTexture=new vt({context:t,pixelFormat:ot.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:x,height:C,sampler:new tn({minificationFilter:en.NEAREST,magnificationFilter:fi.NEAREST})}),this.internalNodeTilesPerRow=S,this.internalNodeTexelSizeUv=new U(1/x,1/C),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}By.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function X7(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,X7(e,t,o-1,i+1),X7(e,o+1,n,i+1)}By.simultaneousRequestCountMaximum=50;By.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,d=c>0,u=a>1,h=(d?2:1)*(u?2:1);this._sampleCount=h;let p=h>=2;if(p&&!l(this.leafNodeTexture)){let V=Math.floor(512),L=Math.ceil(s/V);this.leafNodeTexture=new vt({context:r,pixelFormat:ot.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:1024,height:L,sampler:new tn({minificationFilter:en.NEAREST,magnificationFilter:fi.NEAREST})}),this.leafNodeTexelSizeUv=U.fromElements(1/1024,1/L,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=V}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=X.clamp(t,0,a-1),n&&fSe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xi();Txt(this,e),Sxt(this,e);let f=xi();Zxt(this,h,c);let y=xi(),x=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||x){let S=f-g,C=y-f,V=y-g;Rxt(this,e,S,C,V)}};By.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};By.prototype.isDestroyed=function(){return!1};By.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(),me(this)};function fSe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];fSe(e,i)}}function xxt(e,t){if(e._simultaneousRequestCount>=By.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function s(u){e._simultaneousRequestCount--,t.content=u,t.state=l(u)?_o.LoadState.PROCESSING:_o.LoadState.UNAVAILABLE}function a(u){e._simultaneousRequestCount--,t.state=_o.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},d=i.requestData(c);l(d)&&(e._simultaneousRequestCount++,t.state=_o.LoadState.RECEIVING,d.then(s).catch(a))}function _xt(e){return e/(1+e)}function Txt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),pSe(e.rootNode,bs.MASK_INDETERMINATE,e,t);let o=e._highPriorityKeyframeNodes,r=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,o[r]=s,r++;e._highPriorityKeyframeNodeCount=r}function Sxt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(Cxt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let d=0;d<s;d++){let u=r[d];if(!(u.state===_o.LoadState.LOADED||u.spatialNode===void 0)&&(u.state===_o.LoadState.UNLOADED&&xxt(e,u),u.state===_o.LoadState.PROCESSING)){let{content:h}=u;if(h.update(e._primitive,t),!h.ready)continue;if(!Vxt(h.metadata,e)){u.content=void 0,u.state=_o.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-a,a++;let g=o[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;u.spatialNode.addKeyframeNodeToMegatextures(u,e.megatextures),u.state=_o.LoadState.LOADED,o[p]=u,e._primitive.tileLoad.raiseEvent()}}}function Cxt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function Vxt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let o=0;o<n;o++){let{voxelCountPerTile:r,channelCount:s}=i[o],{x:a,y:c,z:d}=r,u=a*c*d,h=e[o],p=u*s;if(h.length!==p)return!1}return!0}function pSe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:d}=o,h=r.drawingBufferHeight/s/d.sseDenominator;if(e.computeScreenSpaceError(c,h),t=e.visibility(i,t),t===bs.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,f=p.screenSpaceError,y=n._priorityQueue,x=n._keyframeCount,S=X.clamp(Math.floor(n._keyframeLocation),0,x-2),C=S+1;if(x===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==x)for(let P=0;P<x;P++)e.createKeyframeNode(P);let{screenSpaceError:V,keyframeNodes:L}=e,Z=_xt(V),E=!1;for(let P=0;P<L.length;P++){let W=L[P];W.priority=10*Z+Lxt(S,W.keyframe,C,n),W.state!==_o.LoadState.UNAVAILABLE&&W.state!==_o.LoadState.FAILED&&W.priority!==-Number.MAX_VALUE&&y.insert(W),W.state===_o.LoadState.LOADED&&(E=!0)}if(V<f||!E){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let P=0;P<8;P++){let W=e.children[P];pSe(W,t,n,i)}}function Lxt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return X.lerp(a,s,.15+.85*s)}function Rxt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(_o.LoadState).length,c=new Array(a),d=new Array(a),u=0;for(let E=0;E<a;E++){let P=new Array(r).fill(0);c[E]=P,d[E]=0}function h(E){let P=E.keyframeNodes;for(let W=0;W<P.length;W++){let v=P[W],A=v.keyframe,b=v.state;c[b][A]+=1,d[b]+=1,u++}if(l(E.children))for(let W=0;W<8;W++){let v=E.children[W];h(v)}}h(s),e._primitive.statistics.numberOfTilesWithContentReady=d[_o.LoadState.LOADED],e._primitive.statistics.visited=u;let p=d[_o.LoadState.RECEIVING],g=d[_o.LoadState.PROCESSING],f=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(f&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,f&&(p===0&&g===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let x=`KEYFRAMES: ${c[_o.LoadState.LOADED]}`,S=`UNLOADED: ${d[_o.LoadState.UNLOADED]} | RECEIVING: ${d[_o.LoadState.RECEIVING]} | PROCESSING: ${d[_o.LoadState.PROCESSING]} | LOADED: ${d[_o.LoadState.LOADED]} | FAILED: ${d[_o.LoadState.FAILED]} | UNAVAILABLE: ${d[_o.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,C=Math.round(n*100)/100,V=Math.round(i*100)/100,L=Math.round(o*100)/100,Z=`LOAD: ${C} | OCT: ${V} | ALL: ${L}`;console.log(`${x} || ${S} || ${Z}`)}var t3={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function Zxt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,d=[],u=[];function h(g,f,y,x,S){let C=!1;if(l(g.children))for(let V=0;V<8;V++){let L=g.children[V];L.computeSurroundingRenderableKeyframeNodes(o),L.isRenderable(r)&&(C=!0)}if(C){d[S]=t3.INTERNAL<<16|f,d[y]=x,a++,x=f,S=x*9+1;for(let V=0;V<8;V++){let L=g.children[V];f=a,y=f*9+0,h(L,f,y,x,S+V)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let V=c*5,L=g.renderableKeyframeNodePrevious,Z=g.level-L.spatialNode.level,E=L.spatialNode.parent,P=l(E)?E.renderableKeyframeNodePrevious:L,W=Gxt(g,i,n),v=Z,A=1,b=L.megatextureIndex,R=P.megatextureIndex;u[V+0]=W,u[V+1]=v,u[V+2]=A,u[V+3]=b,u[V+4]=R,d[S]=t3.LEAF<<16|c}else{let V=g.renderableKeyframeNodePrevious,Z=g.level-V.spatialNode.level===0?t3.LEAF:t3.PACKED_LEAF_FROM_PARENT;d[S]=Z<<16|V.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),Ext(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&Ixt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function Gxt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return X.clamp(s,0,1)}function Ext(e,t,n,i){let o=ot.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],g=h*o;for(let f=0;f<o;f++)c[g+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function Ixt(e,t,n,i){let o=ot.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let g=e[p*r+0],f=e[p*r+1],y=e[p*r+2],x=e[p*r+3],S=e[p*r+4],C=X.clamp(Math.floor(65536*g),0,65535);d[p*8+0]=C>>>0&255,d[p*8+1]=C>>>8&255,d[p*8+2]=f&255,d[p*8+3]=y&255,d[p*8+4]=x>>>0&255,d[p*8+5]=x>>>8&255,d[p*8+6]=S>>>0&255,d[p*8+7]=S>>>8&255}let h={source:{arrayBufferView:d,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(h)}function Xxt(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],d=mt.getComponentCount(a);o+=IL.getApproximateTextureMemoryByteLength(e,t,d,c)}return o}var a9=By;function lp(e){e=e??Y.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??lp.DefaultProvider,this._traversal=void 0,this._statistics=new xh,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new m,this._inputDimensions=new m,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._exaggeratedMinBounds=new m,this._exaggeratedMinBoundsOld=new m,this._exaggeratedMaxBounds=new m,this._exaggeratedMaxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._exaggeratedModelMatrix=F.clone(this._modelMatrix),this._compoundModelMatrix=new F,this._compoundModelMatrixOld=new F,this._customShader=e.customShader??lp.DefaultCustomShader,this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new F,this._transformPositionUvToWorld=new F,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new fh,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new U,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new U,megatextureTextures:[],megatextureSliceDimensions:new U,megatextureTileDimensions:new U,megatextureVoxelSizeUv:new U,megatextureSliceSizeUv:new U,megatextureTileSizeUv:new U,dimensions:new m,inputDimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new F,transformPositionUvToView:new F,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new re,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,stepSize:0,pickColor:new D},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}this.tileLoad=new be,this.tileVisible=new be,this.tileFailed=new be,this.tileUnload=new be,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be;let i=this._provider;Wxt(this,i)}function Wxt(e,t){let{shape:n,minBounds:i=Ni.getMinBounds(n),maxBounds:o=Ni.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=Ni.getMinBounds(n),e.maxClippingBounds=Ni.getMaxBounds(n),e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=F.clone(e._modelMatrix,e._exaggeratedModelMatrix),gSe(e,t);let r=Ni.getShapeConstructor(n);e._shape=new r,e._shapeVisible=ySe(e,e._shape,t)}Object.defineProperties(lp.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=X.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ys.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=lp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var Pxt=new re,vxt=new re,wxt=new m,Fxt=new m,Axt=new $,Mxt=new $,Nxt=new F,kxt=new F,Uxt=new F,Dxt=F.fromRotationTranslation($.fromUniformScale(.5,new $),new m(.5,.5,.5),new F),Oxt=F.fromRotationTranslation($.fromUniformScale(2,new $),new m(-1,-1,-1),new F);lp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Jxt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}Hxt(this,e);let i=gSe(this,t),o=this._shape;if(i&&(this._shapeVisible=ySe(this,o,t),jxt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=qxt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&s_t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),$xt(this,e)&&(this._shaderDirty=!0);let d=s.leafNodeTexture,u=this._uniforms;l(d)&&(u.octreeLeafNodeTexture=s.leafNodeTexture,u.octreeLeafNodeTexelSizeUv=U.clone(s.leafNodeTexelSizeUv,u.octreeLeafNodeTexelSizeUv),u.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(t9(this,n),this._shaderDirty=!1);let h=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=n_t(p,h,vxt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;u.ndcSpaceAxisAlignedBoundingBox=re.clone(g,u.ndcSpaceAxisAlignedBoundingBox);let y=n.uniformState.inverseView;u.transformPositionViewToUv=F.multiplyTransformation(this._transformPositionWorldToUv,y,u.transformPositionViewToUv);let x=n.uniformState.view;u.transformPositionUvToView=F.multiplyTransformation(x,this._transformPositionUvToWorld,u.transformPositionUvToView);let S=n.uniformState.inverseViewRotation;u.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,S,u.transformDirectionViewToLocal),u.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,u.transformNormalLocalToWorld);let C=e.camera.positionWC;u.cameraPositionUv=F.multiplyByPoint(this._transformPositionWorldToUv,C,u.cameraPositionUv),u.stepSize=this._stepSizeMultiplier;let V=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;V.boundingVolume=o.boundingSphere,e.commandList.push(V)};var Bxt=new m,W7=new m,Yxt=new he,zxt=new m;function Hxt(e,t){if(e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===Ni.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else{let n=m.fromElements(1,1,t.verticalExaggeration,Bxt);e._exaggeratedModelMatrix=F.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=F.multiplyByTranslation(e._exaggeratedModelMatrix,Kxt(e,t),e._exaggeratedModelMatrix)}}function Kxt(e,t){let{shapeTransform:n=F.IDENTITY,globalTransform:i=F.IDENTITY}=e._provider,o=F.getTranslation(n,W7),r=F.multiplyByPoint(e._modelMatrix,o,W7),s=F.multiplyByPoint(i,r,W7),c=ne.WGS84.cartesianToCartographic(s,Yxt),d=0;l(c)&&(d=c.height);let u=Zr.getHeight(d,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return m.fromElements(0,0,(u-d)/t.verticalExaggeration,zxt)}function Jxt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=D.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Be(o,!0);let s=e._uniformMap;for(let c in r)if(r.hasOwnProperty(c)){let d=`u_${c}`;s[d]=function(){return r[c]}}if(e._dimensions=m.clone(t.dimensions,e._dimensions),i.dimensions=m.clone(e._dimensions,i.dimensions),e._paddingBefore=m.clone(t.paddingBefore??m.ZERO,e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(t.paddingAfter??m.ZERO,e._paddingAfter),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=m.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=m.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===pm.Y_UP){let c=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=c}i.inputDimensions=m.clone(e._inputDimensions,i.inputDimensions);let a=t.keyframeCount??1;e._traversal=new a9(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,Qxt(e._traversal,i)}function gSe(e,t){let n=t.shapeTransform??F.IDENTITY,i=t.globalTransform??F.IDENTITY;return F.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),F.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),VS(e,"_compoundModelMatrix","_compoundModelMatrixOld")+VS(e,"_minBounds","_minBoundsOld")+VS(e,"_maxBounds","_maxBoundsOld")+VS(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+VS(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+VS(e,"_minClippingBounds","_minClippingBoundsOld")+VS(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function VS(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function ySe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=F.inverse(o,Nxt),s=F.getRotation(o,Axt),a=F.getScale(o,wxt),c=m.maximumComponent(a),d=m.divideByScalar(a,c,Fxt),u=$.multiplyByScale(s,d,Mxt);return e._transformPositionWorldToUv=F.multiplyTransformation(Dxt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=F.multiplyTransformation(o,Oxt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=F.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(u,e._transformNormalLocalToWorld),!0}function Qxt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=U.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=U.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=U.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=U.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=U.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=U.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function jxt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Be(n,!0)),i}function qxt(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=q.secondsDifference(i.stop,i.start),a=q.secondsDifference(n,i.start)/r;return o+a}function $xt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=F.transpose(F.multiplyTransformation(F.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}lp.prototype.isDestroyed=function(){return!1};lp.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(),me(this)};var bSe=new Array(new re(-1,-1,-1,1),new re(1,-1,-1,1),new re(-1,1,-1,1),new re(1,1,-1,1),new re(-1,-1,1,1),new re(1,-1,1,1),new re(-1,1,1,1),new re(1,1,1,1)),e_t=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),t_t=new Array(new re,new re,new re,new re,new re,new re,new re,new re);function n_t(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,kxt),o=F.multiply(t,i,Uxt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=t_t,h=bSe.length;for(d=0;d<h;d++)F.multiplyByVector(o,bSe[d],u[d]);for(d=0;d<h;d++){let p=u[d];if(p.z>=-p.w){let g=p.x/p.w,f=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,f),c=Math.max(c,f)}else for(let g=0;g<3;g++){let f=e_t[d*3+g],y=u[f];if(y.z>=-y.w){let x=p.z+p.w,S=y.z+y.w,C=x/(x-S),V=re.lerp(p,y,C,Pxt),L=V.x/V.w,Z=V.y/V.w;r=Math.min(r,L),s=Math.max(s,L),a=Math.min(a,Z),c=Math.max(c,Z)}}}return r=X.clamp(r,-1,1),a=X.clamp(a,-1,1),s=X.clamp(s,-1,1),c=X.clamp(c,-1,1),n=re.fromElements(r,a,s,c,n),n}var P7=3e7,i_t=new m(P7,0,0),o_t=new m(0,P7,0),r_t=new m(0,0,P7);function s_t(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,d,u,h){i.add({positions:[c,d],width:h,material:Ji.fromType("Color",{color:u})})}function r(c,d,u){let h=c.computeCorners();o(h[0],h[1],d,u),o(h[2],h[3],d,u),o(h[4],h[5],d,u),o(h[6],h[7],d,u),o(h[0],h[2],d,u),o(h[4],h[6],d,u),o(h[1],h[3],d,u),o(h[5],h[7],d,u),o(h[0],h[4],d,u),o(h[2],h[6],d,u),o(h[1],h[5],d,u),o(h[3],h[7],d,u)}function s(c){if(!n.isRenderable(c))return;let d=c.level,h=Math.max(1,5/Math.pow(2,d)),g=[D.RED,D.LIME,D.BLUE][d%3];if(r(c.orientedBoundingBox,g,h),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,D.WHITE,5),s(n.rootNode);let a=10;o(m.ZERO,i_t,D.RED,a),o(m.ZERO,o_t,D.LIME,a),o(m.ZERO,r_t,D.BLUE,a),i.update(t)}lp.DefaultCustomShader=new _S({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
|
|
|
{
|
|
|
material.diffuse = vec3(1.0);
|
|
|
material.alpha = 1.0;
|
|
|
}`});function xSe(){this.ready=!0,this.shape=Ni.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[mt.SCALAR],this.componentTypes=[Mt.FLOAT32],this.maximumTileCount=1}xSe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new TS({metadata:[new Float32Array(1)]});return Promise.resolve(n)};lp.DefaultProvider=new xSe;var Yy=lp;var MKi=_(T(),1);function a_t(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var c9=a_t;var kKi=_(T(),1);function c_t(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var l9=c_t;var OKi=_(T(),1);function l_t(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var d9=l_t;var i3=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function di(e){e=e??Y.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Be(e.contextOptions),r=l(n),s=new cE(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Hn(),this._jobScheduler=new UF,this._frameState=new NF(s,new XF(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new pR(s),this._ellipsoid=e.ellipsoid??ne.default,this._globe=void 0,this._globeTranslucencyState=new kF,this._primitives=new ml,this._groundPrimitives=new ml,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=di.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new pS,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new FF(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ii({color:new D,stencil:0,owner:this}),this._depthClearCommand=new ii({depth:1,owner:this}),this._stencilClearCommand=new ii({stencil:0}),this._classificationStencilClearCommand=new ii({stencil:0,renderState:Ue.fromCache({stencilMask:Yt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new GA(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._minimumDisableDepthTestDistance=0,this._debugInspector=new AA,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new be,this.morphComplete=new be,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=D.clone(D.BLACK),this._mode=oe.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Ii(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 sT,this.fog=new MF,this.fog.enabled=ne.WGS84.equals(this._ellipsoid),ne.WGS84.equals(this._ellipsoid)||(lo.DEFAULT_VIEW_RECTANGLE=le.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new lo(this),this.shadowMap=new _0({context:s,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=D.clone(D.WHITE),this._actualInvertClassificationColor=D.clone(this._invertClassificationColor),this._invertClassification=new TL,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new RA,this._brdfLutGenerator=new LF,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new WA(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??ed.INFINITE_SCROLL,this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=oc.requestCompletedEvent.addEventListener(i3(this)),this._removeTaskProcessorListenerCallback=yi.taskCompletedEvent.addEventListener(i3(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new ze(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new lo(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new lo(this),this.preloadFlightCullingVolume=void 0,this._picking=new iA(this),this._defaultView=new cS(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Zp,VSe(this,0,q.now()),this.updateFrameState(),this.initializeFrame()}di.defaultLogDepthBuffer=!0;function d_t(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(i3(e))),n.push(t.terrainProviderChanged.addEventListener(i3(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(di.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 Dt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Dt.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 qm.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,d_t(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 lo(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new AF(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,Dt.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}}});di.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 u_t(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function _Se(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=tp.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=tp.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=tp.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=tp.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=_0.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Ge.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}di.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,d=l(t.logDepth),u=l(t.hdr),h=l(t.originalCommand),p=o&&!d,g=c&&!u,f=(!o||!c)&&!h,y=n.pickingMetadata&&u_t(e,n);if(e.dirty=e.dirty||p||g||f||y,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:x,shadowMaps:S}=i;x&&e.castShadows&&(t.shadows=_0.createCastDerivedCommand(S,e,s,r,t.shadows)),(d||p)&&(t.logDepth=tp.createLogDepthCommand(e,r,t.logDepth),_Se(this,t.logDepth.command,s)),(h||f)&&_Se(this,e,s)};var m_t=new um({pass:Fo.RENDER}),v7=new um({pass:Fo.PRELOAD}),w7=new um({pass:Fo.PRELOAD_FLIGHT}),h_t=new um({pass:Fo.REQUEST_RENDER_MODE_DEFER_CHECK}),TSe=new de,F7;function f_t(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return TSe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,F7=hI.fromBoundingSphere(TSe,e.camera.positionWC,F7),F7}di.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function VSe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=q.clone(n,i.time)}di.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=f_t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof un||this.camera.frustum instanceof Ar),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=D.clone(this.invertClassificationColor,this._actualInvertClassificationColor),TL.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};di.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Jt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var n3=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);n3=F.inverseTransformation(n3,n3);function p_t(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=m.clone(s.center);if(o.mode!==oe.SCENE3D){a=F.multiplyByPoint(n3,a,a);let f=o.mapProjection,y=f.unproject(a);a=f.ellipsoid.cartographicToCartesian(y)}let c,d,{radius:u}=s;l(u)?(c=Ks.createGeometry(new Ks({radii:new m(u,u,u),vertexFormat:hn.FLAT_VERTEX_FORMAT})),d=F.fromTranslation(a)):(c=va.createGeometry(va.fromDimensions({dimensions:new m(2,2,2),vertexFormat:hn.FLAT_VERTEX_FORMAT})),d=F.fromRotationTranslation(s.halfAxes,a,new F)),t._debugVolume=new Wn({geometryInstances:new Xt({geometry:An.toWireframe(c),modelMatrix:d,attributes:{color:new Kt(1,0,0,1)}}),appearance:new hn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=tp.createLogDepthCommand(e,r).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(g)&&(n.framebuffer=g),o.commandList=h}function dp(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ii){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&p_t(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function SSe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function LSe(e,t,n){return t.boundingVolume?.distanceSquaredTo(n)-e.boundingVolume?.distanceSquaredTo(n)}function b_t(e,t,n){return e.boundingVolume?.distanceSquaredTo(n)-t.boundingVolume?.distanceSquaredTo(n)+X.EPSILON12}function g_t(e,t,n,i,o){Jp(i,LSe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function y_t(e,t,n,i,o){Jp(i,b_t,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function x_t(e,t,n){e.context.uniformState.updatePass(Ge.VOXELS);let i=n.commands[Ge.VOXELS];i.length=n.indices[Ge.VOXELS],Jp(i,LSe,e.camera.positionWC);for(let o=0;o<i.length;++o)dp(i[o],e,t)}var __t=new Ci,T_t=new Qc,S_t=new un,C_t=new Ar;function V_t(e){let{frustum:t}=e;return l(t.fov)?t.clone(__t):l(t.infiniteProjectionMatrix)?t.clone(T_t):l(t.width)?t.clone(S_t):t.clone(C_t)}function L_t(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?g_t:y_t}function R_t(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let d=L_t(e);o.uniformState.updatePass(Ge.TRANSLUCENT);let u=n.commands[Ge.TRANSLUCENT];u.length=n.indices[Ge.TRANSLUCENT],d(e,dp,t,u,c)}function Z_t(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Ge.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ge.TRANSLUCENT];i.executeTranslucentCommands(e,dp,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,dp,t,n)}function M7(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=V_t(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||G_t(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:f}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:x,sceneFramebuffer:S,frustumCommandsList:C}=e._view,V=C.length,L=e._globeTranslucencyState,Z=e._depthClearCommand,E=e._stencilClearCommand,P=e._classificationStencilClearCommand,W=e._depthPlane,v=n.position.z;function A(R,G){r.updatePass(G);let I=R.commands[G],w=R.indices[G];for(let M=0;M<w;++M)dp(I[M],e,t);return w}function b(R,G){r.updatePass(G);let I=R.commands[G],w=R.indices[G];for(let M=0;M<w;++M)SSe(I[M],e,t)}for(let R=0;R<V;++R){let G=V-R-1,I=C[G];e.mode===oe.SCENE2D?(n.position.z=v-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=G!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),Z.execute(i,t),i.stencilBuffer&&E.execute(i,t),L.translucent?(r.updatePass(Ge.GLOBE),L.executeGlobeCommands(I,dp,x,e,t)):A(I,Ge.GLOBE),p&&y.executeCopyDepth(i,t),u||(L.translucent?(r.updatePass(Ge.TERRAIN_CLASSIFICATION),L.executeGlobeClassificationCommands(I,dp,x,e,t)):A(I,Ge.TERRAIN_CLASSIFICATION)),d&&(Z.execute(i,t),h&&W.execute(i,t));let w;if(!g||c||u)w=A(I,Ge.CESIUM_3D_TILE),w>0&&(p&&(y.prepareColorTextures(i,d),y.executeUpdateDepth(i,t,y.depthStencilTexture)),u||(w=A(I,Ge.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let O=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,w=A(I,Ge.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),w=A(I,Ge.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=O,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),w>0&&i.stencilBuffer&&P.execute(i,t),w=A(I,Ge.CESIUM_3D_TILE_CLASSIFICATION)}if(w>0&&i.stencilBuffer&&E.execute(i,t),x_t(e,t,I),A(I,Ge.OPAQUE),G!==0&&e.mode!==oe.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),R_t(e,t,I),Z_t(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||u)){let O=e._picking.getPickDepth(e,G);O.update(i,y.depthStencilTexture),O.executeCopyDepth(i,t)}if(c||!f)continue;let M=t.framebuffer;t.framebuffer=S.getIdFramebuffer(),s.near=G!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),L.translucent?(r.updatePass(Ge.GLOBE),L.executeGlobeCommands(I,SSe,x,e,t)):b(I,Ge.GLOBE),d&&(Z.framebuffer=t.framebuffer,Z.execute(i,t),Z.framebuffer=void 0),d&&h&&W.execute(i,t),b(I,Ge.CESIUM_3D_TILE),b(I,Ge.OPAQUE),b(I,Ge.TRANSLUCENT),t.framebuffer=M}}function G_t(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Ge.ENVIRONMENT),l(i.skyBoxCommand)&&dp(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&dp(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function RSe(e){e.context.uniformState.updatePass(Ge.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 E_t(e,t){e.context.uniformState.updatePass(Ge.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function I_t(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Ge.GLOBE,Ge.CESIUM_3D_TILE,Ge.OPAQUE,Ge.TRANSLUCENT];for(let c=0;c<t.length;++c){let d=t[c];if(e.updateDerivedCommands(d),!(!d.castShadows||a.indexOf(d.pass)<0||!e.isVisible(i,d)))if(o)for(let u=0;u<s;++u)r[u].commandList.push(d);else if(s===1)r[0].commandList.push(d);else{let u=!1;for(let h=s-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,d))r[h].commandList.push(d),u=!0;else if(u)break}}}}function ZSe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:d}=c;for(let u=0;u<d.length;++u)d[u].commandList.length=0;I_t(e,n,c);for(let u=0;u<d.length;++u){let h=c.passes[u],{camera:p,commandList:g}=h;s.updateCamera(p),c.updatePass(r,u);for(let f=0;f<g.length;++f){let y=g[f];s.updatePass(y.pass);let x=y.derivedCommands.shadows.castCommands[a];dp(x,e,h.passState)}}}}var X_t=new m;di.prototype.updateAndExecuteCommands=function(e,t){B_t(this,e,t),this._environmentState.useWebVR?W_t(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===ed.ROTATE?zy(!0,this,e):U_t(this,e)};function W_t(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;GSe(e),n.createPotentiallyVisibleSet(e),RSe(e),r||ZSe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=lo.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,d=c*(e.focalLength??5),u=e.eyeSeparation??d/30,h=m.multiplyByScalar(a.right,u*.5,X_t);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;m.add(a.position,h,i.position),i.frustum.xOffset=p,M7(e,t),s.x=s.width,m.subtract(a.position,h,i.position),i.frustum.xOffset=-p,M7(e,t),lo.clone(a,i)}var P_t=new he(Math.PI,X.PI_OVER_TWO),v_t=new m,w_t=new m,F_t=new F,A_t=new F,M_t=new m,N_t=new m,k_t=new ze;function U_t(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=ze.clone(r,k_t);t.viewport=s;let a=P_t,c=v_t;e.mapProjection.project(a,c);let u=m.clone(i.position,w_t),h=F.clone(i.transform,A_t),p=i.frustum.clone();i._setTransform(F.IDENTITY);let g=F.computeViewportTransformation(s,0,1,F_t),f=i.frustum.projectionMatrix,y=i.positionWC.y,x=m.fromElements(X.sign(y)*c.x-y,0,-i.positionWC.x,M_t),S=Ft.pointToGLWindowCoordinates(f,g,x,N_t);S.x=Math.floor(S.x);let C=s.x,V=s.width;if(y===0||S.x<=C||S.x>=C+V)zy(!0,e,t);else if(Math.abs(C+V*.5-S.x)<1)s.width=S.x-s.x,i.position.x*=X.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!0,e,t),s.x=S.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!1,e,t);else if(S.x>C+V*.5){s.width=S.x-C;let L=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!0,e,t),s.x=S.x,s.width=C+V-S.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=L-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!1,e,t)}else{s.x=S.x,s.width=C+V-S.x;let L=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!0,e,t),s.x=C,s.width=S.x-C,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=L-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),zy(!1,e,t)}i._setTransform(h),m.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function zy(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),GSe(t),i.createPotentiallyVisibleSet(t),e&&(RSe(t),o||ZSe(t)),M7(t,n)}var CSe=new bs;di.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof un||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(Sb.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let S=r.dynamicLighting;s.setDynamicLighting(S),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),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 x=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(x)?x.drawCommand:void 0,n.sunComputeCommand=l(x)?x.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=d&&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,g=CSe.planes;for(let x=0;x<5;++x)g[x]=p.planes[x];p=CSe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let f=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(f)&&y?.url!==f?(y=y&&y.destroy(),this._specularEnvironmentCubeMap=new qm(f)):!l(f)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function D_t(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new ep({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 O_t(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===oe.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function GSe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),D_t(e),O_t(e),e._globe&&e._globe.render(t)}function B_t(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new wA:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;D.clone(n,u.color),u.execute(i,t);let h=r.useGlobeDepthFramebuffer=l(s.globeDepth);h&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,y=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);if(r.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),f.update(i,o.useLogDepth,e._hdr),f.clear(i),y=r.usePostProcess=f.ready,r.usePostProcessSelected=y&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&u.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let S;if(o.invertClassificationColor.alpha===1&&h&&(S=s.globeDepth.framebuffer),l(S)||i.depthTexture){if(e._invertClassification.previousFramebuffer=S,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let C=e._invertClassification.unclassifiedCommand,V=C.derivedCommands;V.oit=p.createDerivedCommands(C,i,V.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}di.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:d}=n,u=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?h.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=h;a&&!s&&(g=u);let f=this.postProcessStages,y=g.getColorTexture(0),x=p.getColorTexture(0),S=(u??h).getDepthStencilTexture();f.execute(t,y,S,x),f.copy(t,d)}!s&&!c&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function Y_t(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function z_t(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function ESe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof ml){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=ESe(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(l(o)&&o>i)return o}return i}di.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===Ke.CLAMP_TO_TERRAIN||t===Ke.RELATIVE_TO_TERRAIN,i=t===Ke.CLAMP_TO_3D_TILE||t===Ke.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=ESe(this.primitives,e,this);l(s)&&s>o&&(o=s)}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var A7=new he;di.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=g=>{he.clone(e,A7);let f;l(g)&&(f=g.height),l(f)||(f=this.getHeight(e,n)),l(f)&&(A7.height=f,t(A7))},r=n===Ke.CLAMP_TO_TERRAIN||n===Ke.RELATIVE_TO_TERRAIN,s=n===Ke.CLAMP_TO_3D_TILE||n===Ke.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let c={},d=g=>{if(r||g.isDestroyed()||!g.isCesium3DTileset)return;let f=g.updateHeight(e,o,i);c[g.id]=f};if(!r){let g=this.primitives.length;for(let f=0;f<g;++f){let y=this.primitives.get(f);d(y)}}let u=this.primitives.primitiveAdded.addEventListener(d),h=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(c[g.id])&&c[g.id](),delete c[g.id])});return()=>{a=a&&a(),Object.values(c).forEach(g=>g()),c={},u(),h()}};function H_t(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}di.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=z_t(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=H_t(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function K_t(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 g0({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 J_t(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 Q_t(e){e.primitives.postPassesUpdate(e._frameState),oc.update()}var j_t=new D;function q_t(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=m_t;let r=e.backgroundColor??D.BLACK;e._hdr&&(r=D.clone(r,j_t),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof Zp?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=ze.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,E_t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function LS(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function $_t(e){return e._picking.updateMostDetailedRayPicks(e)}di.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=q.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(q.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=q.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=X.incrementWrap(t.frameNumber,15e6,1);VSe(this,o,e),t.newFrame=!0}LS(this,J_t),this.primitives.show&&(LS(this,$_t),LS(this,eTt),LS(this,tTt),i||LS(this,nTt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),LS(this,q_t)),K_t(this,i),LS(this,Q_t),Y_t(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};di.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};di.prototype.requestRender=function(){this._renderRequested=!0};di.prototype.clampLineWidth=function(e){return Math.max(Dt.minimumAliasedLineWidth,Math.min(e,Dt.maximumAliasedLineWidth))};di.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};di.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof Yy))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return MA.fromKeyframeNode(o,s,c,a)};di.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=c9(s,t,n,i);if(!l(a))return;let c=d9(r,n,i);if(!l(c))return;let d=new l9(t,n,i,a,c);return this._picking.pickMetadata(this,e,d)};di.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};di.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};di.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};di.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function eTt(e){let t=e._frameState;v7.camera=t.camera,v7.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,v7)}function tTt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;w7.camera=e.preloadFlightCamera,w7.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,w7)}function nTt(e){e.primitives.updateForPass(e._frameState,h_t)}di.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};di.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};di.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};di.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};di.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};di.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};di.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};di.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};di.prototype.cartesianToCanvasCoordinates=function(e,t){return Oi.worldToWindowCoordinates(this,e,t)};di.prototype.completeMorph=function(){this._transitioner.completeMorph()};di.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};di.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};di.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function iTt(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()})}di.prototype.setTerrain=function(e){return iTt(this,e),e};di.prototype.isDestroyed=function(){return!1};di.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),me(this)};var u9=di;var KQi=_(T(),1);var xQi=_(T(),1),XL=`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 TQi=_(T(),1),m9=`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 CQi=_(T(),1),h9=`in vec4 position;
|
|
|
|
|
|
out vec3 v_outerPositionWC;
|
|
|
|
|
|
#ifndef PER_FRAGMENT_ATMOSPHERE
|
|
|
out vec3 v_mieColor;
|
|
|
out vec3 v_rayleighColor;
|
|
|
out float v_opacity;
|
|
|
out float v_translucent;
|
|
|
#endif
|
|
|
|
|
|
void main(void)
|
|
|
{
|
|
|
vec4 positionWC = czm_model * position;
|
|
|
float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
|
|
|
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum);
|
|
|
|
|
|
#ifndef PER_FRAGMENT_ATMOSPHERE
|
|
|
computeAtmosphereScattering(
|
|
|
positionWC.xyz,
|
|
|
lightDirection,
|
|
|
v_rayleighColor,
|
|
|
v_mieColor,
|
|
|
v_opacity,
|
|
|
v_translucent
|
|
|
);
|
|
|
#endif
|
|
|
|
|
|
v_outerPositionWC = positionWC.xyz;
|
|
|
gl_Position = czm_modelViewProjection * position;
|
|
|
}
|
|
|
`;function WL(e){e=e??ne.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new $e({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(WL.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});WL.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var N7=new F;WL.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=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,N7),o=F.multiplyTransformation(i,vo.Y_UP_TO_Z_UP,N7),r=F.multiply(this._scaleMatrix,o,N7);F.clone(r,this._modelMatrix);let s=e.context,a=oTt(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=Ks.createGeometry(new Ks({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Xe.POSITION_ONLY}));u.vertexArray=oi.fromGeometry({context:s,geometry:p,attributeLocations:An.createAttributeLocations(p),bufferUsage:ke.STATIC_DRAW}),u.renderState=Ue.fromCache({cull:{enabled:!0,face:Ti.FRONT},blending:fn.ALPHA_BLEND,depthMask:!1})}let h=a|d<<2|c<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new De({defines:p,sources:[rh,XL,h9]}),f=new De({defines:p,sources:[rh,XL,m9]});this._spSkyAtmosphere=nn.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function oTt(e){return!(X.equalsEpsilon(e.hueShift,0,X.EPSILON7)&&X.equalsEpsilon(e.saturationShift,0,X.EPSILON7)&&X.equalsEpsilon(e.brightnessShift,0,X.EPSILON7))}WL.prototype.isDestroyed=function(){return!1};WL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),me(this)};var f9=WL;var _4i=_(T(),1);var QQi=_(T(),1),p9=`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 qQi=_(T(),1),b9=`in vec3 position;
|
|
|
out vec3 v_texCoord;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
|
|
|
gl_Position = czm_projection * vec4(p, 1.0);
|
|
|
v_texCoord = position.xyz;
|
|
|
}
|
|
|
`;function vL(e){this.sources=e.sources,this._sources=void 0,this.show=e.show??!0,this._command=new $e({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}vL.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?uE(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}).catch(c=>{this._hasError=!0,this._error=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Lr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=va.createGeometry(va.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Xe.POSITION_ONLY})),c=this._attributeLocations=An.createAttributeLocations(a);s.vertexArray=oi.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:ke.STATIC_DRAW}),s.renderState=Ue.fromCache({blending:fn.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new De({defines:[t?"HDR":""],sources:[p9]});s.shaderProgram=nn.fromCache({context:r,vertexShaderSource:b9,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};vL.prototype.isDestroyed=function(){return!1};vL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),me(this)};function PL(e){return sn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}vL.createEarthSkyBox=function(){return new vL({sources:{positiveX:PL("px"),negativeX:PL("mx"),positiveY:PL("py"),negativeY:PL("my"),positiveZ:PL("pz"),negativeZ:PL("mz")}})};var g9=vL;var tji=_(T(),1);var S4i=_(T(),1),y9=`uniform sampler2D u_texture;
|
|
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
vec4 color = texture(u_texture, v_textureCoordinates);
|
|
|
out_FragColor = czm_gammaCorrect(color);
|
|
|
}
|
|
|
`;var V4i=_(T(),1),x9=`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 R4i=_(T(),1),_9=`in vec2 direction;
|
|
|
|
|
|
uniform float u_size;
|
|
|
|
|
|
out vec2 v_textureCoordinates;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
vec4 position;
|
|
|
if (czm_morphTime == 1.0)
|
|
|
{
|
|
|
position = vec4(czm_sunPositionWC, 1.0);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
position = vec4(czm_sunPositionColumbusView.zxy, 1.0);
|
|
|
}
|
|
|
|
|
|
vec4 positionEC = czm_view * position;
|
|
|
vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
|
|
|
|
|
|
vec2 halfSize = vec2(u_size * 0.5);
|
|
|
halfSize *= ((direction * 2.0) - 1.0);
|
|
|
|
|
|
gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);
|
|
|
|
|
|
v_textureCoordinates = direction;
|
|
|
}
|
|
|
`;function S9(){this.show=!0,this._drawCommand=new $e({primitiveType:Ae.TRIANGLES,boundingVolume:new de,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new de,this._boundingVolume2D=new de,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(S9.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var rTt=new U,sTt=new U,aTt=new re,T9=new re;S9.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===oe.SCENE2D||i===oe.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let L=Math.max(r,s);L=Math.pow(2,Math.ceil(Math.log(L)/Math.log(2))-2),L=Math.max(1,L);let Z=n?o.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._texture=new vt({context:o,width:L,height:L,pixelFormat:ot.RGBA,pixelDatatype:Z}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let E=this,P={u_radiusTS:function(){return E._radiusTS}};this._commands.computeCommand=new Fc({fragmentShaderSource:x9,outputTexture:this._texture,uniformMap:P,persists:!1,owner:this,postExecute:function(){E._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let L={direction:0},Z=new Uint8Array(4*2);Z[0]=0,Z[1]=0,Z[2]=255,Z[3]=0,Z[4]=255,Z[5]=255,Z[6]=0,Z[7]=255;let E=Ct.createVertexBuffer({context:o,typedArray:Z,usage:ke.STATIC_DRAW}),P=[{index:L.direction,vertexBuffer:E,componentsPerAttribute:2,normalize:!0,componentDatatype:Q.UNSIGNED_BYTE}],W=Ct.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:ke.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});a.vertexArray=new oi({context:o,attributes:P,indexBuffer:W}),a.shaderProgram=nn.fromCache({context:o,vertexShaderSource:_9,fragmentShaderSource:y9,attributeLocations:L}),a.renderState=Ue.fromCache({blending:fn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,h=this._boundingVolume2D;m.clone(c,u.center),h.center.x=d.z,h.center.y=d.x,h.center.z=d.y,u.radius=X.SOLAR_RADIUS+X.SOLAR_RADIUS*this._glowLengthTS,h.radius=u.radius,i===oe.SCENE3D?de.clone(u,a.boundingVolume):i===oe.COLUMBUS_VIEW&&de.clone(h,a.boundingVolume);let p=Oi.computeActualEllipsoidPosition(e,c,T9),g=m.magnitude(m.subtract(p,e.camera.position,T9)),f=o.uniformState.projection,y=aTt;y.x=0,y.y=0,y.z=-g,y.w=1;let x=F.multiplyByVector(f,y,T9),S=Oi.clipToGLWindowCoordinates(t.viewport,x,rTt);y.x=X.SOLAR_RADIUS;let C=F.multiplyByVector(f,y,T9),V=Oi.clipToGLWindowCoordinates(t.viewport,C,sTt);return this._size=U.magnitude(U.subtract(V,S,T9)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};S9.prototype.isDestroyed=function(){return!1};S9.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),me(this)};var C9=S9;var s8i=_(T(),1);var Dji=_(T(),1);var WSe=_(tN(),1);var iji=_(T(),1);function cTt(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 V9=cTt;var sji=_(T(),1);var lTt={modifyFragmentShader:function(t){return t=De.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}}},wL=lTt;var RS={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function L9(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=D.clone(D.DARKGRAY),this._highlightColor=D.clone(D.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=RS.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??Ge.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.time=0,this.shadows=Cn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=e.splitDirection??Br.NONE,this._splittingEnabled=!1,this._error=void 0,dTt(this,e)}Object.defineProperties(L9.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return D.clone(this._highlightColor)},set:function(e){this._highlightColor=D.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=de.clone(e,this._boundingSphere)}}});function dTt(e,t){let n=fT.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=hb.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=RS.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=D.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var uTt=new m,mTt=new m,hTt=new m,ISe,o3;function fTt(e){if(!l(o3)){ISe=new WSe.default(0),o3=new Array(e);for(let t=0;t<e;++t)o3[t]=ISe.random()}return o3}function pTt(e){let n=e.length/3,i=Math.min(n,20),o=fTt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(r,r,r,uTt),c=m.fromElements(s,s,s,mTt);for(let u=0;u<i;++u){let h=Math.floor(o[u]*n),p=m.unpack(e,h*3,hTt);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let d=de.fromCornerPoints(a,c);return d.radius+=X.EPSILON2,d}function XSe(e,t){let n=Q.fromTypedArray(e);return n===Q.INT||n===Q.UNSIGNED_INT||n===Q.DOUBLE?(Vt("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 bTt=new re,gTt=new re,yTt=new D,PSe=0,r3=1,B7=2,vSe=3,xTt=4,k7=new F,_Tt=new F;function TTt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,d=i.styleableProperties,u=l(d),h=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,f=e._isOctEncodedDraco,y=e._quantizedRange,x=e._octEncodedRange,S=e._isRGB565,C=e._isTranslucent,V=e._hasColors,L=e._hasNormals,Z=e._hasBatchIds,E,P,W=[],v={};if(e._styleableShaderAttributes=v,u){let k=xTt;for(let B in d)if(d.hasOwnProperty(B)){let N=d[B],z=XSe(N.typedArray,B);E=N.componentCount,P=Q.fromTypedArray(z);let K=Ct.createVertexBuffer({context:n,typedArray:z,usage:ke.STATIC_DRAW});e._geometryByteLength+=K.sizeInBytes;let te={index:k,vertexBuffer:K,componentsPerAttribute:E,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0};W.push(te),v[B]={location:k,componentCount:E},++k}}let A=Ct.createVertexBuffer({context:n,typedArray:r.typedArray,usage:ke.STATIC_DRAW});e._geometryByteLength+=A.sizeInBytes;let b;V&&(b=Ct.createVertexBuffer({context:n,typedArray:s.typedArray,usage:ke.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let R;L&&(R=Ct.createVertexBuffer({context:n,typedArray:a.typedArray,usage:ke.STATIC_DRAW}),e._geometryByteLength+=R.sizeInBytes);let G;Z&&(c.typedArray=XSe(c.typedArray,"batchIds"),G=Ct.createVertexBuffer({context:n,typedArray:c.typedArray,usage:ke.STATIC_DRAW}),e._geometryByteLength+=G.sizeInBytes);let I=[];if(h?P=Q.UNSIGNED_SHORT:p?P=y<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT:P=Q.FLOAT,I.push({index:PSe,vertexBuffer:A,componentsPerAttribute:3,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=de.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=pTt(r.typedArray)),V)if(S)I.push({index:r3,vertexBuffer:b,componentsPerAttribute:1,componentDatatype:Q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=C?4:3;I.push({index:r3,vertexBuffer:b,componentsPerAttribute:k,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}L&&(g?(E=2,P=Q.UNSIGNED_BYTE):f?(E=2,P=x<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT):(E=3,P=Q.FLOAT),I.push({index:B7,vertexBuffer:R,componentsPerAttribute:E,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0})),Z&&I.push({index:vSe,vertexBuffer:G,componentsPerAttribute:1,componentDatatype:Q.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(I=I.concat(W));let w=new oi({context:n,attributes:I}),M={depthTest:{enabled:!0}},O={depthTest:{enabled:!0},depthMask:!1,blending:fn.ALPHA_BLEND};e._opaquePass===Ge.CESIUM_3D_TILE&&(M.stencilTest=Yt.setCesium3DTileBit(),M.stencilMask=Yt.CESIUM_3D_TILE_MASK,O.stencilTest=Yt.setCesium3DTileBit(),O.stencilMask=Yt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ue.fromCache(M),e._translucentRenderState=Ue.fromCache(O),e._drawCommand=new $e({boundingVolume:new de,cull:e._cull,modelMatrix:new F,primitiveType:Ae.POINTS,vertexArray:w,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:C?e._translucentRenderState:e._opaqueRenderState,pass:C?Ge.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function STt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=bTt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,d;t.mode===oe.SCENE2D||c instanceof un?d=Number.POSITIVE_INFINITY:d=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=d}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return D.TRANSPARENT;let c=D.clone(a.edgeColor,yTt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return F.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;F.multiply(n.uniformState.view3D,c,k7);let d=F.multiply(k7,a.modelMatrix,k7);return F.inverseTranspose(d,_Tt)}};wL.addUniforms(e,s),(i||o||r)&&(s=Rt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=gTt;if(l(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function U7(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 D7(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 O7(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 CTt={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 VTt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,f=e._hasColors,y=e._hasNormals,x=e._hasBatchIds,S=e._backFaceCulling,C=e._normalShading,V=e._drawCommand.vertexArray,L=e.clippingPlanes,Z=e._attenuation,E,P,W,v=g,A=Be(CTt),b={},R=e._styleableShaderAttributes;for(o in R)R.hasOwnProperty(o)&&(r=R[o],A[o]=`czm_3dtiles_property_${r.location}`,b[r.location]=r);if(a){let ae={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)";E=n.getColorShaderFunction(`getColorFromStyle${ye}`,A,ae),P=n.getShowShaderFunction(`getShowFromStyle${ye}`,A,ae),W=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,A,ae),l(E)&&ae.translucent&&(v=!0)}e._styleTranslucent=v;let G=l(E),I=l(P),w=l(W),M=e.isClipped,O=[],k=[];G&&(U7(E,O),D7(E,k)),I&&(U7(P,O),D7(P,k)),w&&(U7(W,O),D7(W,k));let B=k.indexOf("COLOR")>=0,N=k.indexOf("NORMAL")>=0;if(N&&!y)throw new ce("Style references the NORMAL semantic but the point cloud does not have normals");for(o in R)if(R.hasOwnProperty(o)){r=R[o];let ae=O.indexOf(r.location)>=0,ye=O7(V,r.location);ye.enabled=ae}let z=f&&(!G||B);if(f){let ae=O7(V,r3);ae.enabled=z}let K=y&&(C||S||N);if(y){let ae=O7(V,B7);ae.enabled=K}let te={a_position:PSe};z&&(te.a_color=r3),K&&(te.a_normal=B7),x&&(te.a_batchId=vSe);let H="",j=O.length;for(i=0;i<j;++i){let ae=O[i];r=b[ae];let ye=r.componentCount,Se=`czm_3dtiles_property_${ae}`,Ee;ye===1?Ee="float":Ee=`vec${ye}`,H+=`in ${Ee} ${Se};
|
|
|
`,te[Se]=r.location}STt(e,t);let ee=`in vec3 a_position;
|
|
|
out vec4 v_color;
|
|
|
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier;
|
|
|
uniform vec4 u_constantColor;
|
|
|
uniform vec4 u_highlightColor;
|
|
|
`;ee+=`float u_pointSize;
|
|
|
float tiles3d_tileset_time;
|
|
|
`,Z&&(ee+=`float u_geometricError;
|
|
|
float u_depthMultiplier;
|
|
|
`),ee+=H,z&&(g?ee+=`in vec4 a_color;
|
|
|
`:p?ee+=`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;
|
|
|
`:ee+=`in vec3 a_color;
|
|
|
`),K&&(u||h?ee+=`in vec2 a_normal;
|
|
|
`:ee+=`in vec3 a_normal;
|
|
|
`),x&&(ee+=`in float a_batchId;
|
|
|
`),(c||d||h)&&(ee+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange;
|
|
|
`),G&&(ee+=E),I&&(ee+=P),w&&(ee+=W),ee+=`void main()
|
|
|
{
|
|
|
u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x;
|
|
|
tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y;
|
|
|
`,Z&&(ee+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z;
|
|
|
u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w;
|
|
|
`),z?g?ee+=` vec4 color = a_color;
|
|
|
`:p?ee+=` 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);
|
|
|
`:ee+=` vec4 color = vec4(a_color, 1.0);
|
|
|
`:ee+=` vec4 color = u_constantColor;
|
|
|
`,c||d?ee+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz;
|
|
|
`:ee+=` vec3 position = a_position;
|
|
|
`,ee+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0));
|
|
|
`,K?(u?ee+=` vec3 normal = czm_octDecode(a_normal);
|
|
|
`:h?ee+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy;
|
|
|
`:ee+=` vec3 normal = a_normal;
|
|
|
`,ee+=` vec3 normalEC = czm_normal * normal;
|
|
|
`):ee+=` vec3 normal = vec3(1.0);
|
|
|
`,G&&(ee+=` color = getColorFromStyle(position, position_absolute, color, normal);
|
|
|
`),I&&(ee+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
|
|
|
`),w?ee+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio;
|
|
|
`:Z?ee+=` vec4 positionEC = czm_modelView * vec4(position, 1.0);
|
|
|
float depth = -positionEC.z;
|
|
|
gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize);
|
|
|
`:ee+=` gl_PointSize = u_pointSize;
|
|
|
`,ee+=` color = color * u_highlightColor;
|
|
|
`,K&&C&&(ee+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC);
|
|
|
diffuseStrength = max(diffuseStrength, 0.4);
|
|
|
color.xyz *= diffuseStrength * czm_lightColor;
|
|
|
`),ee+=` v_color = color;
|
|
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
|
`,K&&S&&(ee+=` float visible = step(-normalEC.z, 0.0);
|
|
|
gl_Position *= visible;
|
|
|
gl_PointSize *= visible;
|
|
|
`),I&&(ee+=` gl_Position.w *= float(show);
|
|
|
gl_PointSize *= float(show);
|
|
|
`),ee+=`}
|
|
|
`;let pe=`in vec4 v_color;
|
|
|
`;M&&(pe+=`uniform highp sampler2D u_clippingPlanes;
|
|
|
uniform mat4 u_clippingPlanesMatrix;
|
|
|
uniform vec4 u_clippingPlanesEdgeStyle;
|
|
|
`,pe+=`
|
|
|
`,pe+=u0(L,s),pe+=`
|
|
|
`),pe+=`void main()
|
|
|
{
|
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
|
`,M&&(pe+=V9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),pe+=`}
|
|
|
`,e.splitDirection!==Br.NONE&&(pe=wL.modifyFragmentShader(pe)),l(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),l(e._fragmentShaderLoaded)&&(pe=e._fragmentShaderLoaded(pe));let _e=e._drawCommand;l(_e.shaderProgram)&&_e.shaderProgram.destroy(),_e.shaderProgram=nn.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:pe,attributeLocations:te});try{_e.shaderProgram._bind()}catch{throw new ce("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function LTt(e,t){if(e._decodingState===RS.READY)return!1;if(e._decodingState===RS.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=xb.decodePointCloud(i,t);l(o)&&(e._decodingState=RS.DECODING,o.then(function(r){e._decodingState=RS.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,d=l(r.NORMAL)?r.NORMAL.array:void 0,u=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=l(s)&&l(r.POSITION.data.quantization),p=l(d)&&l(r.NORMAL.data.quantization);if(h){let x=r.POSITION.data.quantization,S=x.range;e._quantizedVolumeScale=m.fromElements(S,S,S),e._quantizedVolumeOffset=m.unpack(x.minValues),e._quantizedRange=(1<<x.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,f=i.batchTableProperties;for(let x in f)if(f.hasOwnProperty(x)){let S=r[x];l(g)||(g={}),g[x]={typedArray:S.array,componentCount:S.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=g}).catch(function(r){e._decodingState=RS.FAILED,e._error=r}))}return!0}var RTt=new re,ZTt=new m;L9.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(LTt(this,t))return;let i=!1,o=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(TTt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){F.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,d),l(this._rtcCenter)&&F.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&F.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==oe.SCENE3D){let h=e.mapProjection,p=F.getColumn(d,3,RTt);re.equals(p,re.UNIT_W)||Ft.basisTo2D(h,d,d)}let u=this._drawCommand.boundingVolume;if(de.clone(this._boundingSphere,u),this._cull){let h=u.center;F.multiplyByPoint(d,h,h);let p=F.getScale(d,ZTt);u.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==Br.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&VTt(this,e,this._style),this._drawCommand.castShadows=Cn.castShadows(this.shadows),this._drawCommand.receiveShadows=Cn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ge.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};L9.prototype.isDestroyed=function(){return!1};L9.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),me(this)};var R9=L9;function GS(e){e=e??Y.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.shadows=e.shadows??Cn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Ef(e.shading),this.style=e.style,this.frameFailed=new be,this.frameChanged=new be,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Rb,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(GS.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ys.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function GTt(e){return`uniform vec4 czm_pickColor;
|
|
|
${e}`}function ETt(e){return function(t){return Rt(t,{czm_pickColor:function(){return e._pickId.color}})}}function ITt(){return"czm_pickColor"}GS.prototype.makeStyleDirty=function(){this._styleDirty=!0};GS.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var XTt=new q;function z7(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function ZS(e,t){return e._intervals.indexOf(t.start)}function WTt(e,t){let n=e._intervals,i=e._clock,o=z7(e);if(o===0)return;let r=e._getAverageLoadTime(),s=q.addSeconds(i.currentTime,r*o,XTt),a=n.indexOf(s),c=ZS(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function PTt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function vTt(e,t,n){let i=z7(e),o=ZS(e,t),r=ZS(e,n);return i>=0?o>=r:o<=r}function FSe(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 wTt(e,t,n){let i=ZS(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?F.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:xi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Re.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new R9({arrayBuffer:d,cull:!0,fragmentShaderLoaded:GTt,uniformMapLoaded:ETt(e),pickIdLoaded:ITt})}).catch(FSe(e,c))}return r}function FTt(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 ATt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(ASe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(xi()-t.timestamp)/1e3;FTt(e,a)}}t.touchedFrameNumber=i.frameNumber}var MTt=new F;function NTt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?X.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function kTt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var UTt=new Ef;function ASe(e,t,n,i){let o=e.shading??UTt,r=t.pointCloud,s=t.transform??F.IDENTITY;r.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,MTt),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=NTt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=kTt(e);try{r.update(i)}catch(a){FSe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Y7(e,t,n,i){let o=wTt(e,t,i);ATt(e,o,n,i)}function DTt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function MSe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function OTt(e,t){let n=ZS(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function wSe(e,t,n,i,o){return l(n)?n.ready?!0:(Y7(e,t,i,o),n.ready):!1}function BTt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=ZS(e,n),h=ZS(e,t);if(u>=h){for(r=u;r>=h;--r)if(s=c.get(r),a=d[r],wSe(e,s,a,i,o))return s}else for(r=u;r<=h;++r)if(s=c.get(r),a=d[r],wSe(e,s,a,i,o))return s;return t}function YTt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var FL={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};GS.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=q.clone(e.time));let t=Math.max(q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&YTt(this,o,s),FL.timeSinceLoad=t,FL.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,h=this._previousInterval,p=this._nextInterval,g=PTt(this);if(!l(g))return;let f=!1,y=z7(this),x=y===0;y!==this._clockMultiplier&&(f=!0,this._clockMultiplier=y),(!l(h)||x)&&(h=g),(!l(p)||f||vTt(this,g,p))&&(p=WTt(this,g)),h=BTt(this,h,g,FL,e);let S=OTt(this,h);l(S)||(Y7(this,h,FL,e),S=this._lastRenderedFrame),l(S)&&ASe(this,S,FL,e),l(p)&&Y7(this,p,FL,e);let C=this;l(S)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(S)&&S!==this._lastRenderedFrame&&C.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return C.frameChanged.raiseEvent(C),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=S;let V=this._totalMemoryUsageInBytes,L=this.maximumMemoryUsage*1024*1024;V>L&&MSe(this,DTt(e));let E=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&E>0&&c.update(e,u,a,this.boundingSphere)};GS.prototype.isDestroyed=function(){return!1};GS.prototype.destroy=function(){return MSe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var AL=GS;function USe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function zTt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function DSe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function OSe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=DSe(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 BSe(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 Io(e,t){e=Pn(e),t=t??Y.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Ht.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Ht.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Pn(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?Pn(t.creditViewport):n,u=t.showRenderLoopErrors??!0,h=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=d,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=h,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new be,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new Am,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),OSe(this);try{let p=t.ellipsoid??ne.default,g=new u9({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=m.UNIT_Z,DSe(this),BSe(this);let f=t.globe;l(f)||(f=new xF(p)),f!==!1&&(g.globe=f,g.globe.shadows=t.terrainShadows??Cn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ne.WGS84.equals(p)&&(y=g9.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new C9,ne.WGS84.equals(p)&&(g.moon=new SF));let x=t.skyAtmosphere;!l(x)&&ne.WGS84.equals(p)&&(x=new f9(p),x.show=t.globe!==!1&&f.show),x!==!1&&(g.skyAtmosphere=x);let S=t.baseLayer;t.globe!==!1&&S!==!1&&(l(S)||(S=Ja.fromWorldImagery()),g.imageryLayers.add(S)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new Td(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 C=this;this._onRenderError=function(W,v){C._useDefaultRenderLoop=!1,C._renderLoopRunning=!1,C._showRenderLoopErrors&&C.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,v)},g.renderError.addEventListener(this._onRenderError);let V=t.dataSources,L=!1;l(V)||(V=new Bv,L=!0);let Z=new mw({scene:g,dataSourceCollection:V}),E=new dr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=V,this._destroyDataSourceCollection=L,this._dataSourceDisplay=Z,this._eventHelper=E,this._canAnimateUpdateCallback=this._updateCanAnimate,E.add(this._clock.onTick,Io.prototype._onTick,this),E.add(g.morphStart,Io.prototype._clearTrackedObject,this),E.add(V.dataSourceAdded,Io.prototype._onDataSourceAdded,this),E.add(V.dataSourceRemoved,Io.prototype._onDataSourceRemoved,this),E.add(g.postRender,Io.prototype._postRender,this);let P=V.length;for(let W=0;W<P;W++)this._dataSourceAdded(V,V.get(W));this._dataSourceAdded(void 0,Z.defaultDataSource),E.add(V.dataSourceAdded,Io.prototype._dataSourceAdded,this),E.add(V.dataSourceRemoved,Io.prototype._dataSourceRemoved,this)}catch(p){throw u&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Io.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&&zTt(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,H7(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(F.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,USe(this.clock,e))}}});Io.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let d=l(t),u=l(n);if(d||u){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),u){let f=hf(n);d||(typeof n=="string"&&(n=new Error(n)),t=hf({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e}
|
|
|
${t}
|
|
|
${f}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let x=document.createElement("span");x.className="cesium-widget-errorPanel-more-details",x.appendChild(document.createTextNode("See more...")),y.appendChild(x),y.onclick=function(S){y.removeChild(x),y.appendChild(document.createTextNode(f)),y.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}g.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Io.prototype.isDestroyed=function(){return!1};Io.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()),me(this)};Io.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,OSe(this),BSe(this),this._scene.requestRender())};Io.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Io.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Io.prototype._onEntityCollectionChanged,this)};Io.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Io.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Io.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var HTt=new de;Io.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??HTt)===ut.DONE&&i.update(t)}};Io.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)}};Io.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Io.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&USe(this.clock,e)};Io.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Io.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Io.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}};Io.prototype.zoomTo=function(e,t){return YSe(this,e,{offset:t},!1)};Io.prototype.flyTo=function(e,t){return YSe(this,e,t,!0)};function YSe(e,t,n,i){H7(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof Ja){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return QT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof Ts||r instanceof AL||r instanceof Yy){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function Z9(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function H7(e){let t=e._zoomPromise;l(t)&&(Z9(e),e._completeZoom(!1))}Io.prototype._postRender=function(){KTt(this),JTt(this)};var NSe=new de;function KTt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){l(o.offset)||(o.offset=new Gu(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),Z9(e)}if(t instanceof AL){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),u()});return}if(t instanceof Ts||t instanceof Yy){s(t.boundingSphere);return}if(t instanceof he){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),Z9(e);return}let a=t,c=[];for(let u=0,h=a.length;u<h;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,NSe);if(p===ut.PENDING)return;p!==ut.FAILED&&c.push(de.clone(NSe))}if(c.length===0){H7(e);return}e.trackedEntity=void 0;let d=de.fromBoundingSpheres(c);e._zoomIsFlight?(Z9(e),i.flyToBoundingSphere(d,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(d,o.offset),i.lookAtTransform(F.IDENTITY),Z9(e),e._completeZoom(!0))}var kSe=new de;function JTt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=J.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,kSe);if(r===ut.PENDING)return;let s=o.mode;(s===oe.COLUMBUS_VIEW||s===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===oe.COLUMBUS_VIEW||s===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ut.FAILED?kSe:void 0;e._entityView=new fw(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var G9=Io;var B8i=_(T(),1),E9=`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 z8i=_(T(),1),I9=`#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 K8i=_(T(),1),X9=`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 Q8i=_(T(),1),W9=`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 q8i=_(T(),1),P9=`
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
czm_materialInput materialInput;
|
|
|
|
|
|
materialInput.s = v_textureCoordinates.s;
|
|
|
materialInput.st = v_textureCoordinates;
|
|
|
materialInput.str = vec3(v_textureCoordinates, 0.0);
|
|
|
materialInput.normalEC = vec3(0.0, 0.0, -1.0);
|
|
|
|
|
|
czm_material material = czm_getMaterial(materialInput);
|
|
|
|
|
|
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
|
|
}
|
|
|
`;var n7i=_(T(),1);var QTt=new m(1,1,1);function K7(e){e=e??QTt,this._dimensions=m.clone(e)}Object.defineProperties(K7.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var jTt=new m;K7.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,jTt),i=X.randomBetween(-n.x,n.x),o=X.randomBetween(-n.y,n.y),r=X.randomBetween(-n.z,n.z);e.position=m.fromElements(i,o,r,e.position),e.velocity=m.normalize(e.position,e.velocity)};var J7=K7;var r7i=_(T(),1);function up(){this.featurePropertiesDirty=!1}Object.defineProperties(up.prototype,{featuresLength:{get:function(){fe.throwInstantiationError()}},pointsLength:{get:function(){fe.throwInstantiationError()}},trianglesLength:{get:function(){fe.throwInstantiationError()}},geometryByteLength:{get:function(){fe.throwInstantiationError()}},texturesByteLength:{get:function(){fe.throwInstantiationError()}},batchTableByteLength:{get:function(){fe.throwInstantiationError()}},innerContents:{get:function(){fe.throwInstantiationError()}},ready:{get:function(){fe.throwInstantiationError()}},tileset:{get:function(){fe.throwInstantiationError()}},tile:{get:function(){fe.throwInstantiationError()}},url:{get:function(){fe.throwInstantiationError()}},batchTable:{get:function(){fe.throwInstantiationError()}},metadata:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}},group:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}}});up.prototype.hasProperty=function(e,t){fe.throwInstantiationError()};up.prototype.getFeature=function(e){fe.throwInstantiationError()};up.prototype.applyDebugSettings=function(e,t){fe.throwInstantiationError()};up.prototype.applyStyle=function(e){fe.throwInstantiationError()};up.prototype.update=function(e,t){fe.throwInstantiationError()};up.prototype.pick=function(e,t,n){fe.throwInstantiationError()};up.prototype.isDestroyed=function(){fe.throwInstantiationError()};up.prototype.destroy=function(){fe.throwInstantiationError()};var Q7=up;var y7i=_(T(),1);var d7i=_(T(),1);function ML(e,t){this._conditionsExpression=Be(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,$Tt(this,t)}Object.defineProperties(ML.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function qTt(e,t){this.condition=e,this.expression=t}function $Tt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new qTt(new Mu(a,t),new Mu(c,t)))}e._runtimeConditions=n}ML.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)}};ML.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)}};ML.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],d=c.condition.getShaderExpression(t,n),u=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${d})
|
|
|
{
|
|
|
return ${u};
|
|
|
}
|
|
|
`}return r=`${i} ${e}
|
|
|
{
|
|
|
${r} return ${i}(1.0);
|
|
|
}
|
|
|
`,r};ML.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];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var v9=ML;function Hy(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,eSt(this,e)}function eSt(e,t){t=Be(t,!0)??e._style,e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=t.meta??Y.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Mu(o[r],i))}e._meta=n,e._ready=!0}function sr(e,t){let n=(e._style??Y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Mu(String(t));if(typeof t=="string")return new Mu(t,n);if(l(t.conditions))return new v9(t,n)}else return;return t}function ar(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Be(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Hy.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=sr(this,e),this._style.show=ar(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=sr(this,e),this._style.color=ar(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=sr(this,e),this._style.pointSize=ar(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=sr(this,e),this._style.pointOutlineColor=ar(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=sr(this,e),this._style.pointOutlineWidth=ar(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=sr(this,e),this._style.labelColor=ar(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=sr(this,e),this._style.labelOutlineColor=ar(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=sr(this,e),this._style.labelOutlineWidth=ar(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=sr(this,e),this._style.font=ar(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=sr(this,e),this._style.labelStyle=ar(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=sr(this,e),this._style.labelText=ar(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=sr(this,e),this._style.backgroundColor=ar(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=sr(this,e),this._style.backgroundPadding=ar(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=sr(this,e),this._style.backgroundEnabled=ar(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=sr(this,e),this._style.scaleByDistance=ar(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=sr(this,e),this._style.translucencyByDistance=ar(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=sr(this,e),this._style.distanceDisplayCondition=ar(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=sr(this,e),this._style.heightOffset=ar(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=sr(this,e),this._style.anchorLineEnabled=ar(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=sr(this,e),this._style.anchorLineColor=ar(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=sr(this,e),this._style.image=ar(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=sr(this,e),this._style.disableDepthTestDistance=ar(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=sr(this,e),this._style.horizontalOrigin=ar(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=sr(this,e),this._style.verticalOrigin=ar(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=sr(this,e),this._style.labelHorizontalOrigin=ar(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=sr(this,e),this._style.labelVerticalOrigin=ar(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Hy.fromUrl=function(e){return Re.createIfNeeded(e).fetchJson(e).then(function(n){return new Hy(n)})};Hy.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Hy.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Hy.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Hy.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var ES=Hy;var K7i=_(T(),1);var S7i=_(T(),1);function w9(e){e=e??Y.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new Ox({comparator:w9.comparator})}w9.prototype.addSubtree=function(e){let t=new tSt(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()};w9.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};w9.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 tSt(e,t){this.subtree=e,this.stamp=t}var F9=w9;function A9(e){e=e??Y.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=m.ZERO.clone(),paddingAfter:c=m.ZERO.clone(),globalTransform:d=F.IDENTITY.clone(),shapeTransform:u=F.IDENTITY.clone(),minBounds:h,maxBounds:p,minimumValues:g,maximumValues:f,maximumTileCount:y}=e;this._shapeTransform=u,this._globalTransform=d,this._shape=r,this._minBounds=h,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===Ni.ELLIPSOID?pm.Z_UP:pm.Y_UP,this._minimumValues=g,this._maximumValues=f,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new F9}Object.defineProperties(A9.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}}});A9.fromUrl=async function(e){let t=Re.createIfNeeded(e),n=await t.fetchJson();iSt(n);let i=cSt(n,t);await i.load();let{root:o}=n,r=ci(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new RT({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,d=lSt(s,c);Object.assign(d,oSt(o)),d.dimensions=m.unpack(a.dimensions),d.maximumTileCount=nSt(s),l(a.padding)&&(d.paddingBefore=m.unpack(a.padding.before),d.paddingAfter=m.unpack(a.padding.after));let u=new A9(d),h=new GT(t,o,i.schema);return u._implicitTileset=h,u._availableLevels=h.availableLevels,Li.unload(i),u};function nSt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(nT.TILESET_TILE_COUNT)}function iSt(e){let t=e.root;if(!l(t.content))throw new ce("Root must have content");if(!ci(t.content,"3DTILES_content_voxels"))throw new ce("Root tile content must have 3DTILES_content_voxels extension");if(!ci(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ce("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ci(e,"3DTILES_metadata"))throw new ce("Tileset must have a metadata schema")}function oSt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=F.unpack(e.transform):n=F.clone(F.IDENTITY),l(t.box))return sSt(t.box,n);if(l(t.region))return rSt(t.region);if(ci(t,"3DTILES_bounding_volume_cylinder"))return aSt(t.extensions["3DTILES_bounding_volume_cylinder"],n);throw new ce("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function rSt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=F.fromScale(ne.WGS84.radii),c=new m(t,n,r),d=new m(i,o,s);return{shape:Ni.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a,globalTransform:F.clone(F.IDENTITY)}}function sSt(e,t){let n=Xn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Ni.BOX,minBounds:m.clone(cp.DefaultMinBounds),maxBounds:m.clone(cp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function aSt(e,t){let{minRadius:n,maxRadius:i,height:o,minAngle:r=-X.PI,maxAngle:s=X.PI,translation:a=[0,0,0],rotation:c=[0,0,0,1]}=e,d=-.5*o+a[2],u=.5*o+a[2],h=F.fromTranslationQuaternionRotationScale(m.unpack(a),we.unpack(c),new m(i,i,.5*o));return{shape:Ni.CYLINDER,minBounds:m.fromElements(n,r,d),maxBounds:m.fromElements(i,s,u),shapeTransform:h,globalTransform:t}}function cSt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Li.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Li.getSchemaLoader({schema:i})}function lSt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([g,f])=>{let{type:y,componentType:x}=f,S=o?.properties[g].min,C=o?.properties[g].max,V=mt.getComponentCount(y),L=zSe(S,V),Z=zSe(C,V);return{id:g,type:y,componentType:x,minValue:L,maxValue:Z}}),a=s.map(g=>g.id),c=s.map(g=>g.type),d=s.map(g=>g.componentType),u=s.map(g=>g.minValue),h=s.map(g=>g.maxValue),p=u.some(l);return{className:t,names:a,types:c,componentTypes:d,minimumValues:p?u:void 0,maximumValues:p?h:void 0}}function zSe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function dSt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=Yb(a);return o=await tT.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}A9.prototype.requestData=async function(e){e=e??Y.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:o=0,keyframe:r=0}=e;if(r!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new ET({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),c=a.isSubtreeRoot()&&a.level>0,d=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),h=await dSt(this,d);if(!(c?h.childSubtreeIsAvailableAtCoordinates:h.tileIsAvailableAtCoordinates).call(h,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:f,baseResource:y}=s,x=f[0].getDerivedResource({templateValues:a.getTemplateValues()}),S=y.getDerivedResource({url:x.url});return TS.fromGltf(S)};var j7=A9;var q7i=_(T(),1);function q7(e){e=e??1,this._radius=e??1}Object.defineProperties(q7.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});q7.prototype.emit=function(e){let t=X.randomBetween(0,X.TWO_PI),n=X.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=m.fromElements(i,o,r,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var M9=q7;var D6i=_(T(),1);var e6i=_(T(),1),$7={CUMULUS:0};$7.validate=function(e){return e===$7.CUMULUS};var NL=Object.freeze($7);var a6i=_(T(),1);function Oh(e,t){if(e=e??Y.EMPTY_OBJECT,this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new U(this._maximumSize.x,this._maximumSize.y);else{this._scale=U.clone(e.scale??new U(20,12));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=D.clone(e.color??D.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var uSt=Oh.SHOW_INDEX=0,mSt=Oh.POSITION_INDEX=1,hSt=Oh.SCALE_INDEX=2,fSt=Oh.MAXIMUM_SIZE_INDEX=3,pSt=Oh.SLICE_INDEX=4,bSt=Oh.BRIGHTNESS_INDEX=5,gSt=Oh.COLOR_INDEX=6;Oh.NUMBER_OF_PROPERTIES=7;function IS(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Oh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,IS(this,uSt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),IS(this,mSt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),IS(this,hSt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),IS(this,fSt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;D.equals(t,e)||(D.clone(e,t),IS(this,gSt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,IS(this,pSt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,IS(this,bSt))}}});Oh.prototype._destroy=function(){this._cloudCollection=void 0};var au=Oh;var cu,s3=new m,ySt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},xSt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},_St=au.SHOW_INDEX,TSt=au.POSITION_INDEX,SSt=au.SCALE_INDEX,CSt=au.MAXIMUM_SIZE_INDEX,VSt=au.SLICE_INDEX,LSt=au.BRIGHTNESS_INDEX,RSt=au.NUMBER_OF_PROPERTIES,ZSt=au.COLOR_INDEX;function Bh(e){e=e??Y.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(RSt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=m.clone(e.noiseOffset??m.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:HSe(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 HSe(e){return function(){return s3.x=e._textureSliceWidth,s3.y=e._noiseTextureRows,s3.z=1/e._noiseTextureRows,s3}}Object.defineProperties(Bh.prototype,{length:{get:function(){return t6(this),this._clouds.length}}});function KSe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Bh.prototype.add=function(e){e=e??Y.EMPTY_OBJECT;let t=e.cloudType??NL.CUMULUS,n;return t===NL.CUMULUS&&(n=new au(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Bh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Bh.prototype.removeAll=function(){KSe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function t6(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Bh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Bh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Bh.prototype.get=function(e){return t6(this),this._clouds[e]};var GSt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),ESt=new Uint16Array([0,1,2,0,2,3]);function ISt(e){let t=Ct.createVertexBuffer({context:e,typedArray:GSt,usage:ke.STATIC_DRAW}),n=Ct.createIndexBuffer({context:e,typedArray:ESt,usage:ke.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT}];return new oi({context:e,attributes:i,indexBuffer:n})}var n6;function XSt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=Ct.createIndexBuffer({context:e,typedArray:o,usage:ke.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function WSt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=Ct.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:ke.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function PSt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=Ct.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:ke.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function vSt(e,t,n){let i=[{index:cu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:ke.STATIC_DRAW},{index:cu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:ke.STATIC_DRAW},{index:cu.packedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:ke.STATIC_DRAW},{index:cu.packedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:ke.STATIC_DRAW},{index:cu.color,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,usage:ke.STATIC_DRAW}];n&&i.push({index:cu.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:PSt(e)});let o=n?t:4*t;return new Gp(e,i,o,n)}var e6=new Yn;function JSe(e,t,n,i){let o,r=n[cu.positionHighAndScaleX],s=n[cu.positionLowAndScaleY],a=i.position;Yn.fromCartesian(a,e6);let c=i.scale,d=e6.high,u=e6.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,c.x),s(o,u.x,u.y,u.z,c.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,c.x),r(o+1,d.x,d.y,d.z,c.x),r(o+2,d.x,d.y,d.z,c.x),r(o+3,d.x,d.y,d.z,c.x),s(o+0,u.x,u.y,u.z,c.y),s(o+1,u.x,u.y,u.z,c.y),s(o+2,u.x,u.y,u.z,c.y),s(o+3,u.x,u.y,u.z,c.y))}function QSe(e,t,n,i){let o,r=n[cu.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function jSe(e,t,n,i){let o,r=n[cu.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function qSe(e,t,n,i){let o,r=n[cu.color],s=i.color,a=D.floatToByte(s.red),c=D.floatToByte(s.green),d=D.floatToByte(s.blue),u=D.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,d,u)):(o=i._index*4,r(o+0,a,c,d,u),r(o+1,a,c,d,u),r(o+2,a,c,d,u),r(o+3,a,c,d,u))}function wSt(e,t,n,i){JSe(e,t,n,i),QSe(e,t,n,i),jSe(e,t,n,i),qSe(e,t,n,i)}function FSt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=ISt(a),o._spNoise=nn.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new vt({context:a,width:r*r/s,height:r*s,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:ot.RGBA,sampler:new tn({wrapS:Ln.REPEAT,wrapT:Ln.REPEAT,minificationFilter:en.NEAREST,magnificationFilter:fi.NEAREST})});let u=new Fc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:HSe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function ASt(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=vSt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];wSt(e,t,s,c)}n._vaf.commit(n6(i))}}var MSt=[];function NSt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=MSt;d.length=0,(c[TSt]||c[SSt])&&d.push(JSe),(c[_St]||c[LSt])&&d.push(QSe),(c[CSt]||c[VSt])&&d.push(jSe),c[ZSt]&&d.push(qSe);let u=d.length,h=i._vaf.writers,p,g,f;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,h,g);i._vaf.commit(n6(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,h,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function kSt(e,t,n,i){let o=t.context,r=e,s=new De({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new De({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=nn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:cu}),r._rs=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!1,blending:fn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function USt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let d=0;d<c;d++){let u=s[d];l(u)||(u=s[d]=new $e),u.pass=Ge.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[d].indicesCount,u.vertexArray=a[d].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}Bh.prototype.update=function(e){if(t6(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&FSt(this,e,W9,X9),this._instanced=e.context.instancedArrays,cu=this._instanced?xSt:ySt,n6=this._instanced?WSt:XSt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?ASt(this,e):r>0&&NSt(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)&&kSt(this,e,I9,E9),USt(this,e))};Bh.prototype.isDestroyed=function(){return!1};Bh.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(),KSe(this._clouds),me(this)};var i6=Bh;var z6i=_(T(),1);var DSt=X.toRadians(30);function o6(e){this._angle=e??DSt}Object.defineProperties(o6.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});o6.prototype.emit=function(e){let t=Math.tan(this._angle),n=X.randomBetween(0,X.TWO_PI),i=X.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=m.fromElements(o,r,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var r6=o6;var cqi=_(T(),1);var OSt=new D,BSt=new D,YSt=new D,zSt=new D,$Se=new re,N9=new Uint8Array(4);function eCe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return D.lerp(t.color,n.color,o,i)}function a3(e,t){return{height:e,color:D.clone(t)}}function tCe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?D.equals(t.color,i[n-1].color):!1,a=r?D.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?D.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function HSt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],f=X.clamp(g.height,od._minimumHeight,od._maximumHeight),y=D.clone(g.color,OSt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(a3(f,y))}let d=!0,u=!0;for(n=0;n<a-1;n++){let g=c[n+0],f=c[n+1];d=d&&g.height<=f.height,u=u&&g.height>=f.height}u?c=c.reverse():d||Jp(c,function(g,f){return X.sign(g.height-f.height)});let h=r.extendDownwards??!1,p=r.extendUpwards??!1;c.length===1&&!h&&!p&&(h=!0,p=!0),h&&c.splice(0,0,a3(od._minimumHeight,c[0].color)),p&&c.splice(c.length,0,a3(od._maximumHeight,c[c.length-1].color)),c=tCe(c),i.push(c)}return i}function KSt(e){let t=HSt(e),n=[],i=[],o;function r(d,u){n.push(a3(d,u))}function s(d,u,h){let p=D.multiplyByScalar(h,1-u.alpha,zSt);p=D.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,h=0;i=n,n=[];let p=d.length,g=i.length;for(;u<p||h<g;){let f=u<p?d[u]:void 0,y=u>0?d[u-1]:void 0,x=u<p-1?d[u+1]:void 0,S=h<g?i[h]:void 0,C=h>0?i[h-1]:void 0,V=h<g-1?i[h+1]:void 0;if(l(f)&&l(S)&&f.height===S.height){let L=l(V)&&S.height===V.height,Z=!l(C),E=!l(V),P=l(x)&&f.height===x.height,W=!l(y),v=!l(x);L?P?(s(f.height,f.color,S.color),s(f.height,x.color,V.color)):W?(r(f.height,S.color),s(f.height,f.color,V.color)):v?(s(f.height,f.color,S.color),r(f.height,V.color)):(s(f.height,f.color,S.color),s(f.height,f.color,V.color)):Z?P?(r(f.height,f.color),s(f.height,x.color,S.color)):v?(r(f.height,f.color),r(f.height,S.color)):(W||r(f.height,f.color),s(f.height,f.color,S.color)):E?P?(s(f.height,f.color,S.color),r(f.height,x.color)):W?(r(f.height,S.color),r(f.height,f.color)):v?s(f.height,f.color,S.color):(s(f.height,f.color,S.color),r(f.height,f.color)):P?(s(f.height,f.color,S.color),s(f.height,x.color,S.color)):W?(r(f.height,S.color),s(f.height,f.color,S.color)):v?(s(f.height,f.color,S.color),r(f.height,S.color)):s(f.height,f.color,S.color),u+=P?2:1,h+=L?2:1}else if(l(f)&&l(S)&&l(C)&&f.height<S.height){let L=eCe(f.height,C,S,YSt);l(y)?l(x)?s(f.height,f.color,L):(s(f.height,f.color,L),r(f.height,L)):(r(f.height,L),s(f.height,f.color,L)),u++}else if(l(S)&&l(f)&&l(y)&&S.height<f.height){let L=eCe(S.height,y,f,BSt);l(C)?l(V)?s(S.height,L,S.color):(s(S.height,L,S.color),r(S.height,L)):(r(S.height,L),s(S.height,L,S.color)),h++}else l(f)&&(!l(S)||f.height<S.height)?(l(S)&&!l(C)&&!l(x)?(r(f.height,f.color),r(f.height,od._emptyColor),r(S.height,od._emptyColor)):(!l(S)&&l(C)&&!l(y)&&(r(C.height,od._emptyColor),r(f.height,od._emptyColor)),r(f.height,f.color)),u++):l(S)&&(!l(f)||S.height<f.height)&&(r(S.height,S.color),h++)}}return tCe(n)}function od(e){let{scene:t,layers:n}=e??Y.EMPTY_OBJECT,{context:i}=t,o=KSt(n),r=o.length,s,a,c;if(!od._useFloatTexture(i)){a=je.UNSIGNED_BYTE,c=ot.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)re.packFloat(o[g].height,$Se),re.pack($Se,s,g*4)}else{a=je.FLOAT,c=i.webgl2?ot.RED:ot.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let u=vt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new tn({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:en.NEAREST,magnificationFilter:fi.NEAREST})}),h=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(N9),h[g*4+0]=N9[0],h[g*4+1]=N9[1],h[g*4+2]=N9[2],h[g*4+3]=N9[3];let p=vt.create({context:i,pixelFormat:ot.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new tn({wrapS:Ln.CLAMP_TO_EDGE,wrapT:Ln.CLAMP_TO_EDGE,minificationFilter:en.LINEAR,magnificationFilter:fi.LINEAR})});return Ji.fromType("ElevationBand",{heights:u,colors:p})}od._useFloatTexture=function(e){return e.floatingPointTexture};od._maximumHeight=5906376425472;od._minimumHeight=-5906376425472;od._emptyColor=new D(0,0,0,0);var s6=od;var gqi=_(T(),1);async function JSt(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??Y.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||Vt("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??Kx.defaultApiKey;if(!l(n))return QSt(t);let i,o=Kx.getDefaultCredit();l(o)&&(i=[o]);let r=new Re({url:`${Kx.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return Ts.fromUrl(r,t)}var nCe={};async function QSt(e){let i=nCe[2275207];l(i)||(i=hd.fromAssetId(2275207),nCe[2275207]=i);let o=await i;return Ts.fromUrl(o,e)}var a6=JSt;var Vqi=_(T(),1);async function jSt(e){let t=await Ts.fromIonAssetId(96188,e);e=e??Y.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??D.WHITE).toCssColorString();n=new ES({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var c6=jSt;var vqi=_(T(),1);function qSt(e){e=e??Y.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=F.clone(e.modelMatrix??F.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new Xt({geometry:An.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Kt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Xt({geometry:An.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Kt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Xt({geometry:An.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Kt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Wn({asynchronous:!1,geometryInstances:t,appearance:new hn({flat:!0,translucent:!1})})}var l6=qSt;var Nqi=_(T(),1);function k9(e){e=e??Y.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); }
|
|
|
`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); }
|
|
|
`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); }
|
|
|
`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); }
|
|
|
`;break;case"vec4":r=`vec4 getColor() { return ${o}; }
|
|
|
`;break}let s=`in vec3 position3DHigh;
|
|
|
in vec3 position3DLow;
|
|
|
in float batchId;
|
|
|
${n?"":`in ${i} ${t};
|
|
|
`}out ${i} ${o};
|
|
|
void main()
|
|
|
{
|
|
|
vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
|
|
|
${n?`${o} = czm_batchTable_${t}(batchId);
|
|
|
`:`${o} = ${t};
|
|
|
`}gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
|
}`,a=`in ${i} ${o};
|
|
|
${r}
|
|
|
void main()
|
|
|
{
|
|
|
out_FragColor = getColor();
|
|
|
}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=ao.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(k9.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}}});k9.prototype.getFragmentShaderSource=ao.prototype.getFragmentShaderSource;k9.prototype.isTranslucent=ao.prototype.isTranslucent;k9.prototype.getRenderState=ao.prototype.getRenderState;var d6=k9;var qqi=_(T(),1);function c3(e){e=e??Y.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}c3.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Xt({geometry:new qp({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[D.RED,D.RED],arcType:on.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new Xt({geometry:new qp({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[D.GREEN,D.GREEN],arcType:on.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new Xt({geometry:new qp({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[D.BLUE,D.BLUE],arcType:on.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new Wn({geometryInstances:[t,n,i],appearance:new is,asynchronous:!1})}this._primitive.update(e)}};c3.prototype.isDestroyed=function(){return!1};c3.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var U9=c3;var n$i=_(T(),1);function $St(e){this.direction=m.clone(e.direction),this.color=D.clone(e.color??D.WHITE),this.intensity=e.intensity??1}var u6=$St;var p$i=_(T(),1);var o$i=_(T(),1),D9=`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 s$i=_(T(),1),O9=`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 XS(e){e=e??Y.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:Ji.fromType(Ji.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??O9,this._fragmentShaderSource=e.fragmentShaderSource??D9,this._renderState=ao.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(XS.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return XS.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});XS.VERTEX_FORMAT=Xe.POSITION_AND_ST;XS.prototype.getFragmentShaderSource=ao.prototype.getFragmentShaderSource;XS.prototype.isTranslucent=ao.prototype.isTranslucent;XS.prototype.getRenderState=ao.prototype.getRenderState;var m6=XS;var S$i=_(T(),1);function rd(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??rd.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??rd.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??rd.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??rd.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??rd.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new be,this._nominalFrameRate=new be,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){eCt(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(){tCt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}rd.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};rd.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new rd({scene:e})),e._frameRateMonitor};Object.defineProperties(rd.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}}});rd.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};rd.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};rd.prototype.isDestroyed=function(){return!1};rd.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),me(this)};function eCt(e,t){if(e._pauseCount>0)return;let n=xi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Jn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Jn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Jn.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 tCt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var B9=rd;var F$i=_(T(),1);var iCe=_(Qz(),1);function h6(){this._image=new Image}h6.prototype.isReady=function(){return!0};h6.prototype.shouldDiscardImage=function(e){return e===this._image};function WS(e){e=e??Y.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new le(-X.PI,-X.PI,X.PI,X.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Gt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new h6),this._errorEvent=new be}Object.defineProperties(WS.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}}});WS.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ce(`The server ${e.url} doesn't have imagery`);let n=new WS(t);return n._metadata=e,n};WS.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]}};WS.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=zp.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new Ho({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,d);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=nCt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){zE(r.key,d);let u=new Uint8Array(d),h,p=r.protoImagery;if((!l(p)||!p)&&(h=iCt(u)),!l(h)&&(!l(p)||p)){let g=oCt(u);h=g.imageType,u=g.imageData}return!l(h)||!l(u)?o:qx({uint8Array:u,format:h,flipY:!0})})};WS.prototype.pickFeatures=function(e,t,n,i,o){};function nCt(e,t,n,i,o,r){let s=zp.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function iCt(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 oCt(e){let t=iCe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ce("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 f6=WS;var O$i=_(T(),1);var rCt=new D(1,1,1,.4),sCt=new D(0,1,0,.05),aCt=new D(0,.5,0,.2);function PS(e){e=e??Y.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 Ki({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??rCt,this._glowColor=e.glowColor??sCt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??aCt,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(PS.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}}});PS.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()};PS.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};PS.prototype.getTileCredits=function(e,t,n){};PS.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};PS.prototype.pickFeatures=function(e,t,n,i,o){};var p6=PS;var Sto=_(T(),1);var Keo=_(T(),1);var Xeo=_(T(),1);var $$i=_(T(),1);function Yh(){}Yh._maxDecodingConcurrency=Math.max(Ht.hardwareConcurrency-1,1);Yh._decodeTaskProcessor=new yi("decodeI3S",Yh._maxDecodingConcurrency);Yh._promise=void 0;async function cCt(){if(await Yh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Yh._decodeTaskProcessor;throw new ce("I3S decoder could not be initialized.")}Yh.decode=async function(e,t,n,i,o){return l(Yh._promise)||(Yh._promise=cCt()),Yh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,d=0,u=0;l(s.obb)?(c=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let h=$.fromRotationX(-X.PI_OVER_TWO),p=new $;$.multiply(h,a,p);let g=he.fromDegrees(c,d,u),f=ne.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ne.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:f,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(y)})};var Y9=Yh;var ieo=_(T(),1);function b6(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(b6.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});b6.prototype.load=async function(){return this._data=await zh.loadJson(this._resource),this._data};var z9=b6;var aeo=_(T(),1);function Z0(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(Z0.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 l3(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 lCt(e){return e==="String"?1:l3(e)}async function dCt(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)}Z0.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=dCt(this).catch(function(e){console.error(e)}),this._loadPromise)};Z0.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}};Z0.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};Z0.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(c+=u.value),t=u.offset}this._values[o].push(c)}}}};Z0.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=l3(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=l3(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Z0.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=lCt(i.valueType)}if(e.byteLength<t)throw new ce(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Z0.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new ce(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=l3(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new ce(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new ce(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ce(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var H9=Z0;var feo=_(T(),1);function K9(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(K9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});K9.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var uCt=new m,mCt=new m,hCt=new m,fCt=new m,pCt=new m;function g6(e,t,n,i){let o=m.subtract(i,n,uCt),r=m.cross(o,m.subtract(e,n,mCt),fCt),s=m.cross(o,m.subtract(t,n,hCt),pCt);return m.dot(r,s)>=0}var bCt=new m,gCt=new m,yCt=new m,xCt=new m,_Ct=new m,TCt=new m,SCt=new m,CCt=new m,VCt=new m,LCt=new m;K9.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,d=this._customAttributes.positions,u=this._customAttributes.indices,h;l(u)?h=u.length:h=d.length/3;for(let p=0;p<h;p++){let g,f,y;l(u)?(g=u[p],f=u[p+1],y=u[p+2]):(g=p*3,f=p*3+1,y=p*3+2);let x=m.fromElements(d[g*3],d[g*3+1],d[g*3+2],bCt),S=m.fromElements(d[f*3],d[f*3+1],d[f*3+2],gCt),C=new m(d[y*3],d[y*3+1],d[y*3+2],yCt);if(!g6(i,x,S,C)||!g6(i,S,x,C)||!g6(i,C,x,S))continue;let V=m.subtract(S,x,xCt),L=m.subtract(C,x,_Ct),Z=m.cross(V,L,TCt);if(m.magnitude(Z)===0)continue;let E=m.normalize(Z,SCt),P=m.subtract(i,x,CCt),W=Math.abs(m.dot(P,E));if(W<o){o=W,r=p;let v=m.magnitudeSquared(m.subtract(i,x,P)),A=m.magnitudeSquared(m.subtract(i,S,VCt)),b=m.magnitudeSquared(m.subtract(i,C,LCt));v<A&&v<b?(a=g,c=x,s=v):A<b?(a=f,c=S,s=A):(a=y,c=C,s=b)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function oCe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(u_(e[i])):t.push(e[i]);return t}K9.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,h="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let V=this._parent._data.mesh.material.definition;if(V>=0&&V<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[V],c=u,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){d=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let L="0";if(l(this._layer._data.textureSetDefinitions))for(let Z=0;Z<this._layer._data.textureSetDefinitions.length;Z++){let E=this._layer._data.textureSetDefinitions[Z];for(let P=0;P<E.formats.length;P++){let W=E.formats[P];if(W.format==="jpg"){L=W.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/${L}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=oCe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=oCe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(d=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],f=[];d&&(p=[{sampler:0,source:0}],g=[{uri:h}],f=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],x=n.length;for(let C=0;C<x;C++){let V=n[C].primitives,L=V.length;for(let Z=0;Z<L;Z++){let E=V[Z];if(l(E.material)){for(;E.material>=y.length;){let W=Be(c,!0);y.push(W)}let P=y[E.material];l(E.extra)&&E.extra.isTransparent?l(P.alphaMode)||(P.alphaMode="BLEND"):P.alphaMode==="BLEND"&&(P.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:y,textures:p,images:g,samplers:f,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var kL=K9;function Pc(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(Pc.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}}});Pc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new ju(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await zh.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 rCe(e,t){let n=new H9(e,t);return e._fields[t.name]=n,n.load()}Pc.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(rCe(this,i))}return Promise.all(t)};Pc.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 rCe(this,o)}return Promise.resolve()};Pc.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)};Pc.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};Pc.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 Pc(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};Pc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new kL(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 kL(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Pc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new z9(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Pc.prototype._clearGeometryData=function(){this._geometryData=[]};Pc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let S=0;S<this._dataProvider._geoidDataList.length;S++){let C=this._dataProvider._geoidDataList[S],V=C.projection.project(n);if(V.x>C.nativeExtent.west&&V.x<C.nativeExtent.east&&V.y>C.nativeExtent.south&&V.y<C.nativeExtent.north){n.height+=ECt(V.x,V.y,C);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=ne.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ne.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let S=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/S}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let S=this._data.lodThreshold;s=r/S}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let S=0;S<this._data.lodSelection.length;S++)this._data.lodSelection[S].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[S].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Xa(0,0,0),d=Ft.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new we(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=$.fromQuaternion(d),h=$.inverse(u,new $),p=new F(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),g=F.inverse(p,new F),f=F.clone(p);l(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=h;let y=[];for(let S=0;S<this._children.length;S++)y.push(this._children[S]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[f[0],f[4],f[8],f[12],f[1],f[5],f[9],f[13],f[2],f[6],f[10],f[14],f[3],f[7],f[11],f[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Pc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Pc.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await Y9.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function RCt(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 ZCt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function sCe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await RCt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!ZCt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Pc.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=sCe(this,t);e.push(n)}return Promise.all(e)};ju.prototype._hookedRequestContent=ju.prototype.requestContent;ju.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 Re({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(()=>{sCe(e._i3sNode,n)})),e._isLoading=!1,t})}};function GCt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function d3(e,t,n,i){let o=e+t*n;return i[o]}function ECt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,d=a<n.height?a+1:a;a=n.height-1-a,d=n.height-1-d;let u=d3(s,a,n.width,n.buffer),h=d3(c,a,n.width,n.buffer),p=d3(s,d,n.width,n.buffer),g=d3(c,d,n.width,n.buffer),f=GCt(o,r,u,h,p,g);return f=f*n.scale+n.offset,f}Object.defineProperties(ju.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var UL=Pc;var Feo=_(T(),1);function u3(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(u3.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function y6(e,t){let n=[];for(let i=0;i<e.length;i++){let o=D.byteToFloat(e[i]);i<3?n.push(u_(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function DL(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=y6(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=y6(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=y6(a.color,a.transparency)))}break}}return n}function ICt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=DL(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let d=a[c],u=n;for(let h=0;h<d.length;h++){let p=d[h];h===d.length-1?u[p]=s:(l(u[p])||(u[p]={}),u=u[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=DL(o.symbol,t)}return n}}function XCt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=o.classMaxValue??o.classMinValue,a=r.classMaxValue??r.classMinValue;return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(DL(r.symbol,t)))}return i.symbols.push(void 0),i}}u3.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=DL(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=DL(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=ICt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=DL(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=XCt(i,n))}};function aCe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?aCe(s,t,n,i):s}}function WCt(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 PCt(e,t,n){let i=t[n],o=WCt(e.ranges,i);return e.symbols[o]}u3.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=>aCe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>PCt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var J9=u3;function sd(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 Re({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(sd.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}}});sd.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ce(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new J9(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()};sd.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let d=0;d<c.length;d++)s.push(c[d])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};sd.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};sd.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 UL(this,t,!0)}else this._rootNode=new UL(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};sd.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]})};sd._fetchJson=function(e){return e.fetchJson()};sd.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=sd._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]};sd.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=le.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=le.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};sd.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)?Be(e):{},e.outlineColor=D.fromCartesian4(re.fromArray(o))),this._tileset=await Ts.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()})};sd.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};sd.prototype.filterByAttributes=function(e){this._filters=l(e)?Be(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var vS=sd;var $eo=_(T(),1);function m3(e,t){this._dataProvider=e,this._resource=new Re({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(m3.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}}});m3.prototype.load=async function(){return this._data=await zh.loadJson(this._resource),this._data};m3.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 Q9=m3;var rto=_(T(),1);function j9(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(j9.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}}});j9._fromData=async function(e,t,n,i){let o=new j9(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let d=j9._fromData(e,t,r[c],o);s.push(d)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let d=a[c];o._sublayers.push(d),o._i3sLayers.push(...d._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Re({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await zh.loadJson(o._resource),c=new vS(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var q9=j9;var dCe=_(cCe(),1);function Ls(e){e=e??Y.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??Y.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(Ls.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}}});Ls.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return me(this)};Ls.prototype.isDestroyed=function(){return!1};Ls.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Ls.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Ls.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Ls.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 vCt(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 lCe(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=vCt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=q9._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new Q9(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=le.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 vS(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.`)}Ls.fromUrl=async function(e,t){t=t??Y.EMPTY_OBJECT;let n=Re.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Ls.loadJson(n),o=new Ls(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=lCe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await lCe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};Ls._fetchJson=function(e){return e.fetchJson()};Ls.loadJson=async function(e){let t=await Ls._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 ce(t.error)}return t};Ls.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 ce(`Failed to load binary: ${e.url}`);return t};Ls.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 wCt=new U;function FCt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let h=c.x;h<=d.x;h++)for(let p=c.y;p<=d.y;p++){let g=U.fromElements(h,p,wCt),f=g.toString();if(!o.hasOwnProperty(f)){let y={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=y,i.push(y)}}let u=[];for(let h=0;h<i.length;++h){let p=i[h],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(g)}return Promise.all(u).then(function(h){let p=[];for(let g=0;g<h.length;g++){let f={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=h[g],x="Geographic";n._projection instanceof Pi&&(x="WebMercator");let S={projectionType:x,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===Tu.LERC){let C=dCe.default.decode(y._buffer);S.buffer=C.pixels[0]}else S.buffer=y._buffer;p.push(S)}return p})}async function ACt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await FCt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Ls.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=ACt(this),this._geoidDataPromise)};Ls.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?le.union(e,n,e):e=le.clone(n)}this._extent=e};Ls.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Ls.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[]};Ls.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 zh=Ls;var Xto=_(T(),1);var $9={};$9.createTilesetFromIModelId=async function(e,t){let{exports:n}=await Xs.getExports(e);if(n.length>0&&n.every(a=>a.status===Xs.ExportStatus.Invalid))throw new ce(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===Xs.ExportStatus.Complete);if(!l(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new Re({url:r});return Ts.fromUrl(s,t)};$9.createTilesetForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await Xs.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![Xs.RealityDataType.Cesium3DTiles,Xs.RealityDataType.PNTS,Xs.RealityDataType.RealityMesh3DTiles,Xs.RealityDataType.Terrain3DTiles].includes(n))throw new ce(`Reality data type is not a mesh type: ${n}`);let r=await Xs.getRealityDataURL(e,t,i);return Ts.fromUrl(r,{maximumScreenSpaceError:4})};$9.createDataSourceForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await Xs.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![Xs.RealityDataType.KML,Xs.RealityDataType.GeoJSON].includes(n))throw new ce(`Reality data type is not a data source type: ${n}`);let r=await Xs.getRealityDataURL(e,t,i);return n===Xs.RealityDataType.GeoJSON?Gy.load(r):JT.load(r)};$9.loadGeospatialFeatures=async function(e,t,n){let i=n??1e4,o=`${Xs.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new Re({url:o,headers:{Authorization:Xs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return Gy.load(r)};var x6=$9;var vto=_(T(),1);function uCe(){}Object.defineProperties(uCe.prototype,{color:{get:fe.throwInstantiationError},intensity:{get:fe.throwInstantiationError}});var _6=uCe;var Uto=_(T(),1);var MCt=/\/$/,mCe=new Gt('© <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 OL(e){e=e??Y.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=Re.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();MCt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Gt(c))):c=mCe,this._resource=i,this._imageryProvider=new Ka({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(OL.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});OL.prototype.getTileCredits=function(e,t,n){};OL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};OL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};OL._defaultCredit=mCe;var T6=OL;var Oto=_(T(),1);function S6(e){}S6.prototype.isReady=function(){return!0};S6.prototype.shouldDiscardImage=function(e){return!1};var C6=S6;var qto=_(T(),1);var NCt=new Gt("MapQuest, Open Street Map and contributors, CC-BY-SA");function f3(e){e=e??Y.EMPTY_OBJECT;let t=Re.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new ts({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(le.southwest(a),r),d=n.positionToTileXY(le.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),h=e.credit??NCt;typeof h=="string"&&(h=new Gt(h)),Ka.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(f3.prototype=Object.create(Ka.prototype),f3.prototype.constructor=f3);var G0=f3;var rno=_(T(),1);var kCt=new U(1,1);function V6(e){e=e??Y.EMPTY_OBJECT,this.mass=e.mass??1,this.position=m.clone(e.position??m.ZERO),this.velocity=m.clone(e.velocity??m.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=D.clone(e.startColor??D.WHITE),this.endColor=D.clone(e.endColor??D.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=U.clone(e.imageSize??kCt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(V6.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var hCe=new m;V6.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,hCe),m.add(this.position,hCe,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 BL=V6;var cno=_(T(),1);function fCe(e){e=e??Y.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(fCe.prototype,{complete:{get:function(){return this._complete}}});var L6=fCe;var uno=_(T(),1);function pCe(e){}pCe.prototype.emit=function(e){fe.throwInstantiationError()};var R6=pCe;var Rno=_(T(),1);var bCe=new U(1,1);function eM(e){e=e??Y.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 M9(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._emitterModelMatrix=F.clone(e.emitterModelMatrix??F.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=D.clone(e.color??e.startColor??D.WHITE),this._endColor=D.clone(e.color??e.endColor??D.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=U.clone(e.imageSize??e.minimumImageSize??bCe),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??bCe),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 be,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(eM.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){D.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){D.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function UCt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,d=e._particlePool,u=Math.max(a-c.length-d.length,0);for(let h=0;h<u;++h){let p=new BL;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function DCt(e){let t=e._particlePool.pop();return l(t)||(t=new BL),t}function OCt(e,t){e._particlePool.push(t)}function BCt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let d=n[c];i.remove(d._billboard)}n.length=a}function YCt(e){l(e._billboard)&&(e._billboard.show=!1)}function gCe(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=X.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=X.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=X.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=X.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new D(i,o,r,s),n.scale=X.lerp(t.startScale,t.endScale,t.normalizedAge)}function zCt(e,t){t.startColor=D.clone(e._startColor,t.startColor),t.endColor=D.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=X.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=X.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=X.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=X.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=X.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function HCt(e,t){if(e._isComplete)return 0;t=X.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=X.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var p3=new m;eM.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new vd),this._updateParticlePool&&(UCt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=q.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?gCe(this,s):(YCt(s),OCt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=HCt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=DCt(this),this._emitter.emit(s),m.add(s.position,s.velocity,p3),F.multiplyByPoint(d,p3,p3),s.position=F.multiplyByPoint(d,s.position,s.position),m.subtract(p3,s.position,s.velocity),m.normalize(s.velocity,s.velocity),zCt(this,s),gCe(this,s)}if(this._billboardCollection.update(e),this._previousTime=q.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=X.mod(this._currentTime,this._lifetime),this.bursts){let d=this.bursts.length;for(r=0;r<d;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&BCt(this)};eM.prototype.isDestroyed=function(){return!1};eM.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),me(this)};var Z6=eM;var Eno=_(T(),1);function lu(){fe.throwInstantiationError()}lu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(lu.prototype,{quadtree:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError}});lu.prototype.update=fe.throwInstantiationError;lu.prototype.beginUpdate=fe.throwInstantiationError;lu.prototype.endUpdate=fe.throwInstantiationError;lu.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;lu.prototype.loadTile=fe.throwInstantiationError;lu.prototype.computeTileVisibility=fe.throwInstantiationError;lu.prototype.showTileThisFrame=fe.throwInstantiationError;lu.prototype.computeDistanceToTile=fe.throwInstantiationError;lu.prototype.isDestroyed=fe.throwInstantiationError;lu.prototype.destroy=fe.throwInstantiationError;var G6=lu;var Pno=_(T(),1);function E6(e){e=e??1,this._radius=e??1}Object.defineProperties(E6.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});E6.prototype.emit=function(e){let t=X.randomBetween(0,X.TWO_PI),n=X.randomBetween(0,X.PI),i=X.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(o,r,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var I6=E6;var Fno=_(T(),1);function tM(){}tM.prototype.evaluate=function(e,t){fe.throwInstantiationError()};tM.prototype.evaluateColor=function(e,t){fe.throwInstantiationError()};tM.prototype.getShaderFunction=function(e,t,n,i){fe.throwInstantiationError()};tM.prototype.getVariables=function(){fe.throwInstantiationError()};var X6=tM;var Uno=_(T(),1);function YL(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,JCt(this,e)}Object.defineProperties(YL.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}}});YL.fromWorldTerrain=function(e){return new YL(kx(e))};YL.fromWorldBathymetry=function(e){return new YL(OE(e))};function KCt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function JCt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){KCt(e._errorEvent,i)}}var nM=YL;var Bno=_(T(),1);function zL(){}zL.prototype.boundingVolume=void 0;zL.prototype.boundingSphere=void 0;zL.prototype.distanceToCamera=function(e){fe.throwInstantiationError()};zL.prototype.intersectPlane=function(e){fe.throwInstantiationError()};zL.prototype.createDebugVolume=function(e){fe.throwInstantiationError()};var W6=zL;var jno=_(T(),1);function iM(e){e=e??Y.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._color=e.color??D.YELLOW,this._errorEvent=new be,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(iM.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}}});iM.prototype.getTileCredits=function(e,t,n){};iM.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};iM.prototype.pickFeatures=function(e,t,n,i,o){};var oM=iM;var eio=_(T(),1);function P6(e){fe.throwInstantiationError()}P6.prototype.isReady=fe.throwInstantiationError;P6.prototype.shouldDiscardImage=fe.throwInstantiationError;var v6=P6;var nio=_(T(),1),QCt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},w6=Object.freeze(QCt);var fio=_(T(),1);function b3(e,t){this.show=!0,l(e)||(e=new ze),this.rectangle=ze.clone(e),l(t)||(t=Ji.fromType(Ji.ColorType,{color:new D(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}b3.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!ze.equals(t.viewport,this.rectangle))&&(this._rs=Ue.fromCache({blending:fn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new De({sources:[this._material.shaderSource,P9]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ge.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};b3.prototype.isDestroyed=function(){return!1};b3.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),me(this)};var F6=b3;var gio=_(T(),1);function A6(){fe.throwInstantiationError()}Object.defineProperties(A6.prototype,{globalTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shape:{get:fe.throwInstantiationError},minBounds:{get:fe.throwInstantiationError},maxBounds:{get:fe.throwInstantiationError},dimensions:{get:fe.throwInstantiationError},paddingBefore:{get:fe.throwInstantiationError},paddingAfter:{get:fe.throwInstantiationError},names:{get:fe.throwInstantiationError},types:{get:fe.throwInstantiationError},componentTypes:{get:fe.throwInstantiationError},minimumValues:{get:fe.throwInstantiationError},maximumValues:{get:fe.throwInstantiationError},maximumTileCount:{get:fe.throwInstantiationError},availableLevels:{get:fe.throwInstantiationError},keyframeCount:{get:fe.throwInstantiationError},timeIntervalCollection:{get:fe.throwInstantiationError}});A6.prototype.requestData=function(e){fe.throwInstantiationError()};var M6=A6;var _io=_(T(),1);function wS(){fe.throwInstantiationError()}Object.defineProperties(wS.prototype,{orientedBoundingBox:{get:fe.throwInstantiationError},boundingSphere:{get:fe.throwInstantiationError},boundTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shaderUniforms:{get:fe.throwInstantiationError},shaderDefines:{get:fe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:fe.throwInstantiationError}});wS.prototype.update=fe.throwInstantiationError;wS.prototype.computeOrientedBoundingBoxForTile=fe.throwInstantiationError;wS.prototype.computeOrientedBoundingBoxForSample=fe.throwInstantiationError;wS.DefaultMinBounds=fe.throwInstantiationError;wS.DefaultMaxBounds=fe.throwInstantiationError;var N6=wS;var Sio=_(T(),1),k6=`uniform sampler2D u_depthTexture;
|
|
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
|
|
void main()
|
|
|
{
|
|
|
float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));
|
|
|
z_window = czm_reverseLogDepth(z_window);
|
|
|
float n_range = czm_depthRange.near;
|
|
|
float f_range = czm_depthRange.far;
|
|
|
float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
|
|
|
float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
|
|
|
out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
|
|
|
}
|
|
|
`;var Iio=_(T(),1);function jCt(e){e=e??Y.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??ot.RGBA,this.pixelDatatype=e.pixelDatatype??je.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=Re.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?Ln.REPEAT:Ln.CLAMP_TO_EDGE;this.sampler=new tn({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var U6=jCt;var Wio=_(T(),1),qCt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},D6=Object.freeze(qCt);var vio=_(T(),1),$Ct={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},O6=Object.freeze($Ct);var Aio=_(T(),1);function e1t(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${hf(s)}
|
|
|
with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var B6=e1t;globalThis.CESIUM_VERSION="1.128";var SEo=_(T(),1);var $1o=_(T(),1);var J1o=_(T(),1);var k1o=_(T(),1),rM;typeof ko<"u"&&(rM=ko);(function(){/*!
|
|
|
* Knockout JavaScript library v3.5.1
|
|
|
* (c) The Knockout.js team - http://knockoutjs.com/
|
|
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
|
*/(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(b,R){return b===null||typeof b in y?b===R:!1}function d(b,R){var G;return function(){G||(G=f.a.setTimeout(function(){G=e,b()},R))}}function u(b,R){var G;return function(){clearTimeout(G),G=f.a.setTimeout(b,R)}}function h(b,R){R&&R!=="change"?R==="beforeChange"?this.pc(b):this.gb(b,R):this.qc(b)}function p(b,R){R!==null&&R.s&&R.s()}function g(b,R){var G=this.qd,I=G[L];I.ra||(this.Qb&&this.mb[R]?(G.uc(R,b,this.mb[R]),this.mb[R]=null,--this.Qb):I.I[R]||G.uc(R,b,I.J?{da:b}:G.$c(b)),b.Ja&&b.gd())}var f=typeof s<"u"?s:{};f.b=function(b,R){for(var G=b.split("."),I=f,w=0;w<G.length-1;w++)I=I[G[w]];I[G[G.length-1]]=R},f.L=function(b,R,G){b[R]=G},f.version="3.5.1",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=function(){function b(H,j){for(var ee in H)w.call(H,ee)&&j(ee,H[ee])}function R(H,j){if(j)for(var ee in j)w.call(j,ee)&&(H[ee]=j[ee]);return H}function G(H,j){return H.__proto__=j,H}function I(H,j,ee,pe){var _e=H[j].match(K)||[];f.a.D(ee.match(K),function(ae){f.a.Na(_e,ae,pe)}),H[j]=_e.join(" ")}var w=Object.prototype.hasOwnProperty,M={__proto__:[]}instanceof Array,O=typeof Symbol=="function",k={},B={};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(" "),b(k,function(H,j){if(j.length)for(var ee=0,pe=j.length;ee<pe;ee++)B[j[ee]]=H});var N={propertychange:!0},z=n&&function(){for(var H=3,j=n.createElement("div"),ee=j.getElementsByTagName("i");j.innerHTML="<!--[if gt IE "+ ++H+"]><i></i><![endif]-->",ee[0];);return 4<H?H:e}(),K=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(H,j,ee){for(var pe=0,_e=H.length;pe<_e;pe++)j.call(ee,H[pe],pe,H)},A:typeof Array.prototype.indexOf=="function"?function(H,j){return Array.prototype.indexOf.call(H,j)}:function(H,j){for(var ee=0,pe=H.length;ee<pe;ee++)if(H[ee]===j)return ee;return-1},Lb:function(H,j,ee){for(var pe=0,_e=H.length;pe<_e;pe++)if(j.call(ee,H[pe],pe,H))return H[pe];return e},Pa:function(H,j){var ee=f.a.A(H,j);0<ee?H.splice(ee,1):ee===0&&H.shift()},wc:function(H){var j=[];return H&&f.a.D(H,function(ee){0>f.a.A(j,ee)&&j.push(ee)}),j},Mb:function(H,j,ee){var pe=[];if(H)for(var _e=0,ae=H.length;_e<ae;_e++)pe.push(j.call(ee,H[_e],_e));return pe},jb:function(H,j,ee){var pe=[];if(H)for(var _e=0,ae=H.length;_e<ae;_e++)j.call(ee,H[_e],_e)&&pe.push(H[_e]);return pe},Nb:function(H,j){if(j instanceof Array)H.push.apply(H,j);else for(var ee=0,pe=j.length;ee<pe;ee++)H.push(j[ee]);return H},Na:function(H,j,ee){var pe=f.a.A(f.a.bc(H),j);0>pe?ee&&H.push(j):ee||H.splice(pe,1)},Ba:M,extend:R,setPrototypeOf:G,Ab:M?G:R,P:b,Ga:function(H,j,ee){if(!H)return H;var pe={},_e;for(_e in H)w.call(H,_e)&&(pe[_e]=j.call(ee,H[_e],_e,H));return pe},Tb:function(H){for(;H.firstChild;)f.removeNode(H.firstChild)},Yb:function(H){H=f.a.la(H);for(var j=(H[0]&&H[0].ownerDocument||n).createElement("div"),ee=0,pe=H.length;ee<pe;ee++)j.appendChild(f.oa(H[ee]));return j},Ca:function(H,j){for(var ee=0,pe=H.length,_e=[];ee<pe;ee++){var ae=H[ee].cloneNode(!0);_e.push(j?f.oa(ae):ae)}return _e},va:function(H,j){if(f.a.Tb(H),j)for(var ee=0,pe=j.length;ee<pe;ee++)H.appendChild(j[ee])},Xc:function(H,j){var ee=H.nodeType?[H]:H;if(0<ee.length){for(var pe=ee[0],_e=pe.parentNode,ae=0,ye=j.length;ae<ye;ae++)_e.insertBefore(j[ae],pe);for(ae=0,ye=ee.length;ae<ye;ae++)f.removeNode(ee[ae])}},Ua:function(H,j){if(H.length){for(j=j.nodeType===8&&j.parentNode||j;H.length&&H[0].parentNode!==j;)H.splice(0,1);for(;1<H.length&&H[H.length-1].parentNode!==j;)H.length--;if(1<H.length){var ee=H[0],pe=H[H.length-1];for(H.length=0;ee!==pe;)H.push(ee),ee=ee.nextSibling;H.push(pe)}}return H},Zc:function(H,j){7>z?H.setAttribute("selected",j):H.selected=j},Db:function(H){return H===null||H===e?"":H.trim?H.trim():H.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(H,j){return H=H||"",j.length>H.length?!1:H.substring(0,j.length)===j},vd:function(H,j){if(H===j)return!0;if(H.nodeType===11)return!1;if(j.contains)return j.contains(H.nodeType!==1?H.parentNode:H);if(j.compareDocumentPosition)return(j.compareDocumentPosition(H)&16)==16;for(;H&&H!=j;)H=H.parentNode;return!!H},Sb:function(H){return f.a.vd(H,H.ownerDocument.documentElement)},kd:function(H){return!!f.a.Lb(H,f.a.Sb)},R:function(H){return H&&H.tagName&&H.tagName.toLowerCase()},Ac:function(H){return f.onError?function(){try{return H.apply(this,arguments)}catch(j){throw f.onError&&f.onError(j),j}}:H},setTimeout:function(H,j){return setTimeout(f.a.Ac(H),j)},Gc:function(H){setTimeout(function(){throw f.onError&&f.onError(H),H},0)},B:function(H,j,ee){var pe=f.a.Ac(ee);if(ee=N[j],f.options.useOnlyNativeEvents||ee||!o)if(ee||typeof H.addEventListener!="function")if(typeof H.attachEvent<"u"){var _e=function(ye){pe.call(H,ye)},ae="on"+j;H.attachEvent(ae,_e),f.a.K.za(H,function(){H.detachEvent(ae,_e)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else H.addEventListener(j,pe,!1);else te||(te=typeof o(H).on=="function"?"on":"bind"),o(H)[te](j,pe)},Fb:function(H,j){if(!H||!H.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(f.a.R(H)==="input"&&H.type&&j.toLowerCase()=="click"?(ee=H.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,f.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof H.dispatchEvent=="function")ee=n.createEvent(B[j]||"HTMLEvents"),ee.initEvent(j,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,H),H.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&H.click)H.click();else if(typeof H.fireEvent<"u")H.fireEvent("on"+j);else throw Error("Browser doesn't support triggering events");else o(H).trigger(j)},f:function(H){return f.O(H)?H():H},bc:function(H){return f.O(H)?H.v():H},Eb:function(H,j,ee){var pe;j&&(typeof H.classList=="object"?(pe=H.classList[ee?"add":"remove"],f.a.D(j.match(K),function(_e){pe.call(H.classList,_e)})):typeof H.className.baseVal=="string"?I(H.className,"baseVal",j,ee):I(H,"className",j,ee))},Bb:function(H,j){var ee=f.a.f(j);(ee===null||ee===e)&&(ee="");var pe=f.h.firstChild(H);!pe||pe.nodeType!=3||f.h.nextSibling(pe)?f.h.va(H,[H.ownerDocument.createTextNode(ee)]):pe.data=ee,f.a.Ad(H)},Yc:function(H,j){if(H.name=j,7>=z)try{var ee=H.name.replace(/[&<>'"]/g,function(pe){return"&#"+pe.charCodeAt(0)+";"});H.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(H){9<=z&&(H=H.nodeType==1?H:H.parentNode,H.style&&(H.style.zoom=H.style.zoom))},wd:function(H){if(z){var j=H.style.width;H.style.width=0,H.style.width=j}},Pd:function(H,j){H=f.a.f(H),j=f.a.f(j);for(var ee=[],pe=H;pe<=j;pe++)ee.push(pe);return ee},la:function(H){for(var j=[],ee=0,pe=H.length;ee<pe;ee++)j.push(H[ee]);return j},Da:function(H){return O?Symbol(H):H},Zd:z===6,$d:z===7,W:z,Lc:function(H,j){for(var ee=f.a.la(H.getElementsByTagName("input")).concat(f.a.la(H.getElementsByTagName("textarea"))),pe=typeof j=="string"?function(ye){return ye.name===j}:function(ye){return j.test(ye.name)},_e=[],ae=ee.length-1;0<=ae;ae--)pe(ee[ae])&&_e.push(ee[ae]);return _e},Nd:function(H){return typeof H=="string"&&(H=f.a.Db(H))?r&&r.parse?r.parse(H):new Function("return "+H)():null},hc:function(H,j,ee){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(f.a.f(H),j,ee)},Od:function(H,j,ee){ee=ee||{};var pe=ee.params||{},_e=ee.includeFields||this.Jc,ae=H;if(typeof H=="object"&&f.a.R(H)==="form")for(var ae=H.action,ye=_e.length-1;0<=ye;ye--)for(var Se=f.a.Lc(H,_e[ye]),Ee=Se.length-1;0<=Ee;Ee--)pe[Se[Ee].name]=Se[Ee].value;j=f.a.f(j);var Ie=n.createElement("form");Ie.style.display="none",Ie.action=ae,Ie.method="post";for(var Fe in j)H=n.createElement("input"),H.type="hidden",H.name=Fe,H.value=f.a.hc(f.a.f(j[Fe])),Ie.appendChild(H);b(pe,function(ve,ct){var Je=n.createElement("input");Je.type="hidden",Je.name=ve,Je.value=ct,Ie.appendChild(Je)}),n.body.appendChild(Ie),ee.submitter?ee.submitter(Ie):Ie.submit(),setTimeout(function(){Ie.parentNode.removeChild(Ie)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.D),f.b("utils.arrayFirst",f.a.Lb),f.b("utils.arrayFilter",f.a.jb),f.b("utils.arrayGetDistinctValues",f.a.wc),f.b("utils.arrayIndexOf",f.a.A),f.b("utils.arrayMap",f.a.Mb),f.b("utils.arrayPushAll",f.a.Nb),f.b("utils.arrayRemoveItem",f.a.Pa),f.b("utils.cloneNodes",f.a.Ca),f.b("utils.createSymbolOrString",f.a.Da),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.Jc),f.b("utils.getFormFields",f.a.Lc),f.b("utils.objectMap",f.a.Ga),f.b("utils.peekObservable",f.a.bc),f.b("utils.postJson",f.a.Od),f.b("utils.parseJson",f.a.Nd),f.b("utils.registerEventHandler",f.a.B),f.b("utils.stringifyJson",f.a.hc),f.b("utils.range",f.a.Pd),f.b("utils.toggleDomNodeCssClass",f.a.Eb),f.b("utils.triggerEvent",f.a.Fb),f.b("utils.unwrapObservable",f.a.f),f.b("utils.objectForEach",f.a.P),f.b("utils.addOrRemoveItem",f.a.Na),f.b("utils.setTextContent",f.a.Bb),f.b("unwrap",f.a.f),Function.prototype.bind||(Function.prototype.bind=function(b){var R=this;if(arguments.length===1)return function(){return R.apply(b,arguments)};var G=Array.prototype.slice.call(arguments,1);return function(){var I=G.slice(0);return I.push.apply(I,arguments),R.apply(b,I)}}),f.a.g=new function(){var b=0,R="__ko__"+new Date().getTime(),G={},I,w;return f.a.W?(I=function(M,O){var k=M[R];if(!k||k==="null"||!G[k]){if(!O)return e;k=M[R]="ko"+b++,G[k]={}}return G[k]},w=function(M){var O=M[R];return O?(delete G[O],M[R]=null,!0):!1}):(I=function(M,O){var k=M[R];return!k&&O&&(k=M[R]={}),k},w=function(M){return M[R]?(delete M[R],!0):!1}),{get:function(M,O){var k=I(M,!1);return k&&k[O]},set:function(M,O,k){(M=I(M,k!==e))&&(M[O]=k)},Ub:function(M,O,k){return M=I(M,!0),M[O]||(M[O]=k)},clear:w,Z:function(){return b+++R}}},f.b("utils.domData",f.a.g),f.b("utils.domData.clear",f.a.g.clear),f.a.K=new function(){function b(O,k){var B=f.a.g.get(O,I);return B===e&&k&&(B=[],f.a.g.set(O,I,B)),B}function R(O){var k=b(O,!1);if(k)for(var k=k.slice(0),B=0;B<k.length;B++)k[B](O);f.a.g.clear(O),f.a.K.cleanExternalData(O),M[O.nodeType]&&G(O.childNodes,!0)}function G(O,k){for(var B=[],N,z=0;z<O.length;z++)if((!k||O[z].nodeType===8)&&(R(B[B.length]=N=O[z]),O[z]!==N))for(;z--&&f.a.A(B,O[z])==-1;);}var I=f.a.g.Z(),w={1:!0,8:!0,9:!0},M={1:!0,9:!0};return{za:function(O,k){if(typeof k!="function")throw Error("Callback must be a function");b(O,!0).push(k)},yb:function(O,k){var B=b(O,!1);B&&(f.a.Pa(B,k),B.length==0&&f.a.g.set(O,I,e))},oa:function(O){return f.u.G(function(){w[O.nodeType]&&(R(O),M[O.nodeType]&&G(O.getElementsByTagName("*")))}),O},removeNode:function(O){f.oa(O),O.parentNode&&O.parentNode.removeChild(O)},cleanExternalData:function(O){o&&typeof o.cleanData=="function"&&o.cleanData([O])}}},f.oa=f.a.K.oa,f.removeNode=f.a.K.removeNode,f.b("cleanNode",f.oa),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.K),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.K.za),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.K.yb),function(){var b=[0,"",""],R=[1,"<table>","</table>"],G=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],w={thead:R,tbody:R,tfoot:R,tr:[2,"<table><tbody>","</tbody></table>"],td:G,th:G,option:I,optgroup:I},M=8>=f.a.W;f.a.ua=function(O,k){var B;if(o){if(o.parseHTML)B=o.parseHTML(O,k)||[];else if((B=o.clean([O],k))&&B[0]){for(var N=B[0];N.parentNode&&N.parentNode.nodeType!==11;)N=N.parentNode;N.parentNode&&N.parentNode.removeChild(N)}}else{(B=k)||(B=n);var N=B.parentWindow||B.defaultView||t,z=f.a.Db(O).toLowerCase(),K=B.createElement("div"),te;for(te=(z=z.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&w[z[1]]||b,z=te[0],te="ignored<div>"+te[1]+O+te[2]+"</div>",typeof N.innerShiv=="function"?K.appendChild(N.innerShiv(te)):(M&&B.body.appendChild(K),K.innerHTML=te,M&&K.parentNode.removeChild(K));z--;)K=K.lastChild;B=f.a.la(K.lastChild.childNodes)}return B},f.a.Md=function(O,k){var B=f.a.ua(O,k);return B.length&&B[0].parentElement||f.a.Yb(B)},f.a.fc=function(O,k){if(f.a.Tb(O),k=f.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),o)o(O).html(k);else for(var B=f.a.ua(k,O.ownerDocument),N=0;N<B.length;N++)O.appendChild(B[N])}}(),f.b("utils.parseHtmlFragment",f.a.ua),f.b("utils.setHtml",f.a.fc),f.aa=function(){function b(G,I){if(G){if(G.nodeType==8){var w=f.aa.Uc(G.nodeValue);w!=null&&I.push({ud:G,Kd:w})}else if(G.nodeType==1)for(var w=0,M=G.childNodes,O=M.length;w<O;w++)b(M[w],I)}}var R={};return{Xb:function(G){if(typeof G!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return R[I]=G,"<!--[ko_memo:"+I+"]-->"},bd:function(G,I){var w=R[G];if(w===e)throw Error("Couldn't find any memo with ID "+G+". Perhaps it's already been unmemoized.");try{return w.apply(null,I||[]),!0}finally{delete R[G]}},cd:function(G,I){var w=[];b(G,w);for(var M=0,O=w.length;M<O;M++){var k=w[M].ud,B=[k];I&&f.a.Nb(B,I),f.aa.bd(w[M].Kd,B),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},Uc:function(G){return(G=G.match(/^\[ko_memo\:(.*?)\]$/))?G[1]:null}}}(),f.b("memoization",f.aa),f.b("memoization.memoize",f.aa.Xb),f.b("memoization.unmemoize",f.aa.bd),f.b("memoization.parseMemoText",f.aa.Uc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.aa.cd),f.na=function(){function b(){if(w){for(var k=w,B=0,N;O<w;)if(N=I[O++]){if(O>k){if(5e3<=++B){O=w,f.a.Gc(Error("'Too much recursion' after processing "+B+" task groups."));break}k=w}try{N()}catch(z){f.a.Gc(z)}}}}function R(){b(),O=w=I.length=0}var G,I=[],w=0,M=1,O=0;return t.MutationObserver?G=function(k){var B=n.createElement("div");return new MutationObserver(k).observe(B,{attributes:!0}),function(){B.classList.toggle("foo")}}(R):G=n&&"onreadystatechange"in n.createElement("script")?function(k){var B=n.createElement("script");B.onreadystatechange=function(){B.onreadystatechange=null,n.documentElement.removeChild(B),B=null,k()},n.documentElement.appendChild(B)}:function(k){setTimeout(k,0)},{scheduler:G,zb:function(k){return w||f.na.scheduler(R),I[w++]=k,M++},cancel:function(k){k=k-(M-w),k>=O&&k<w&&(I[k]=null)},resetForTesting:function(){var k=w-O;return O=w=I.length=0,k},Sd:b}}(),f.b("tasks",f.na),f.b("tasks.schedule",f.na.zb),f.b("tasks.runEarly",f.na.Sd),f.Ta={throttle:function(b,R){b.throttleEvaluation=R;var G=null;return f.$({read:b,write:function(I){clearTimeout(G),G=f.a.setTimeout(function(){b(I)},R)}})},rateLimit:function(b,R){var G,I,w;typeof R=="number"?G=R:(G=R.timeout,I=R.method),b.Hb=!1,w=typeof I=="function"?I:I=="notifyWhenChangesStop"?u:d,b.ub(function(M){return w(M,G,R)})},deferred:function(b,R){if(R!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.ub(function(G){var I,w=!1;return function(){if(!w){f.na.cancel(I),I=f.na.zb(G);try{w=!0,b.notifySubscribers(e,"dirty")}finally{w=!1}}}}))},notify:function(b,R){b.equalityComparer=R=="always"?null:c}};var y={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.Ta),f.ic=function(b,R,G){this.da=b,this.lc=R,this.mc=G,this.Ib=!1,this.fb=this.Jb=null,f.L(this,"dispose",this.s),f.L(this,"disposeWhenNodeIsRemoved",this.l)},f.ic.prototype.s=function(){this.Ib||(this.fb&&f.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},f.ic.prototype.l=function(b){this.Jb=b,f.a.K.za(b,this.fb=this.s.bind(this))},f.T=function(){f.a.Ab(this,x),x.qb(this)};var x={qb:function(b){b.U={change:[]},b.sc=1},subscribe:function(b,R,G){var I=this;G=G||"change";var w=new f.ic(I,R?b.bind(R):b,function(){f.a.Pa(I.U[G],w),I.hb&&I.hb(G)});return I.Qa&&I.Qa(G),I.U[G]||(I.U[G]=[]),I.U[G].push(w),w},notifySubscribers:function(b,R){if(R=R||"change",R==="change"&&this.Gb(),this.Wa(R)){var G=R==="change"&&this.ed||this.U[R].slice(0);try{f.u.xc();for(var I=0,w;w=G[I];++I)w.Ib||w.lc(b)}finally{f.u.end()}}},ob:function(){return this.sc},Dd:function(b){return this.ob()!==b},Gb:function(){++this.sc},ub:function(b){var R=this,G=f.O(R),I,w,M,O,k;R.gb||(R.gb=R.notifySubscribers,R.notifySubscribers=h);var B=b(function(){R.Ja=!1,G&&O===R&&(O=R.nc?R.nc():R());var N=w||k&&R.sb(M,O);k=w=I=!1,N&&R.gb(M=O)});R.qc=function(N,z){z&&R.Ja||(k=!z),R.ed=R.U.change.slice(0),R.Ja=I=!0,O=N,B()},R.pc=function(N){I||(M=N,R.gb(N,"beforeChange"))},R.rc=function(){k=!0},R.gd=function(){R.sb(M,R.v(!0))&&(w=!0)}},Wa:function(b){return this.U[b]&&this.U[b].length},Bd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var R=0;return f.a.P(this.U,function(G,I){G!=="dirty"&&(R+=I.length)}),R},sb:function(b,R){return!this.equalityComparer||!this.equalityComparer(b,R)},toString:function(){return"[object Object]"},extend:function(b){var R=this;return b&&f.a.P(b,function(G,I){var w=f.Ta[G];typeof w=="function"&&(R=w(R,I)||R)}),R}};f.L(x,"init",x.qb),f.L(x,"subscribe",x.subscribe),f.L(x,"extend",x.extend),f.L(x,"getSubscriptionsCount",x.Bd),f.a.Ba&&f.a.setPrototypeOf(x,Function.prototype),f.T.fn=x,f.Qc=function(b){return b!=null&&typeof b.subscribe=="function"&&typeof b.notifySubscribers=="function"},f.b("subscribable",f.T),f.b("isSubscribable",f.Qc),f.S=f.u=function(){function b(M){G.push(I),I=M}function R(){I=G.pop()}var G=[],I,w=0;return{xc:b,end:R,cc:function(M){if(I){if(!f.Qc(M))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,M,M.fd||(M.fd=++w))}},G:function(M,O,k){try{return b(),M.apply(O,k||[])}finally{R()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),f.b("computedContext",f.S),f.b("computedContext.getDependenciesCount",f.S.qa),f.b("computedContext.getDependencies",f.S.Va),f.b("computedContext.isInitial",f.S.Ya),f.b("computedContext.registerDependency",f.S.cc),f.b("ignoreDependencies",f.Yd=f.u.G);var S=f.a.Da("_latestValue");f.ta=function(b){function R(){return 0<arguments.length?(R.sb(R[S],arguments[0])&&(R.ya(),R[S]=arguments[0],R.xa()),this):(f.u.cc(R),R[S])}return R[S]=b,f.a.Ba||f.a.extend(R,f.T.fn),f.T.fn.qb(R),f.a.Ab(R,C),f.options.deferUpdates&&f.Ta.deferred(R,!0),R};var C={equalityComparer:c,v:function(){return this[S]},xa:function(){this.notifySubscribers(this[S],"spectate"),this.notifySubscribers(this[S])},ya:function(){this.notifySubscribers(this[S],"beforeChange")}};f.a.Ba&&f.a.setPrototypeOf(C,f.T.fn);var V=f.ta.Ma="__ko_proto__";C[V]=f.ta,f.O=function(b){if((b=typeof b=="function"&&b[V])&&b!==C[V]&&b!==f.o.fn[V])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b},f.Za=function(b){return typeof b=="function"&&(b[V]===C[V]||b[V]===f.o.fn[V]&&b.Nc)},f.b("observable",f.ta),f.b("isObservable",f.O),f.b("isWriteableObservable",f.Za),f.b("isWritableObservable",f.Za),f.b("observable.fn",C),f.L(C,"peek",C.v),f.L(C,"valueHasMutated",C.xa),f.L(C,"valueWillMutate",C.ya),f.Ha=function(b){if(b=b||[],typeof b!="object"||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return b=f.ta(b),f.a.Ab(b,f.Ha.fn),b.extend({trackArrayChanges:!0})},f.Ha.fn={remove:function(b){for(var R=this.v(),G=[],I=typeof b!="function"||f.O(b)?function(O){return O===b}:b,w=0;w<R.length;w++){var M=R[w];if(I(M)){if(G.length===0&&this.ya(),R[w]!==M)throw Error("Array modified during remove; cannot remove item");G.push(M),R.splice(w,1),w--}}return G.length&&this.xa(),G},removeAll:function(b){if(b===e){var R=this.v(),G=R.slice(0);return this.ya(),R.splice(0,R.length),this.xa(),G}return b?this.remove(function(I){return 0<=f.a.A(b,I)}):[]},destroy:function(b){var R=this.v(),G=typeof b!="function"||f.O(b)?function(M){return M===b}:b;this.ya();for(var I=R.length-1;0<=I;I--){var w=R[I];G(w)&&(w._destroy=!0)}this.xa()},destroyAll:function(b){return b===e?this.destroy(function(){return!0}):b?this.destroy(function(R){return 0<=f.a.A(b,R)}):[]},indexOf:function(b){var R=this();return f.a.A(R,b)},replace:function(b,R){var G=this.indexOf(b);0<=G&&(this.ya(),this.v()[G]=R,this.xa())},sorted:function(b){var R=this().slice(0);return b?R.sort(b):R.sort()},reversed:function(){return this().slice(0).reverse()}},f.a.Ba&&f.a.setPrototypeOf(f.Ha.fn,f.ta.fn),f.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){f.Ha.fn[b]=function(){var R=this.v();this.ya(),this.zc(R,b,arguments);var G=R[b].apply(R,arguments);return this.xa(),G===R?this:G}}),f.a.D(["slice"],function(b){f.Ha.fn[b]=function(){var R=this();return R[b].apply(R,arguments)}}),f.Pc=function(b){return f.O(b)&&typeof b.remove=="function"&&typeof b.push=="function"},f.b("observableArray",f.Ha),f.b("isObservableArray",f.Pc),f.Ta.trackArrayChanges=function(b,R){function G(){function K(){if(k){var te=[].concat(b.v()||[]),H;b.Wa("arrayChange")&&((!w||1<k)&&(w=f.a.Pb(B,te,b.Ob)),H=w),B=te,w=null,k=0,H&&H.length&&b.notifySubscribers(H,"arrayChange")}}I?K():(I=!0,O=b.subscribe(function(){++k},null,"spectate"),B=[].concat(b.v()||[]),w=null,M=b.subscribe(K))}if(b.Ob={},R&&typeof R=="object"&&f.a.extend(b.Ob,R),b.Ob.sparse=!0,!b.zc){var I=!1,w=null,M,O,k=0,B,N=b.Qa,z=b.hb;b.Qa=function(K){N&&N.call(b,K),K==="arrayChange"&&G()},b.hb=function(K){z&&z.call(b,K),K!=="arrayChange"||b.Wa("arrayChange")||(M&&M.s(),O&&O.s(),O=M=null,I=!1,B=e)},b.zc=function(K,te,H){function j(Ie,Fe,ve){return ee[ee.length]={status:Ie,value:Fe,index:ve}}if(I&&!k){var ee=[],pe=K.length,_e=H.length,ae=0;switch(te){case"push":ae=pe;case"unshift":for(te=0;te<_e;te++)j("added",H[te],ae+te);break;case"pop":ae=pe-1;case"shift":pe&&j("deleted",K[ae],ae);break;case"splice":te=Math.min(Math.max(0,0>H[0]?pe+H[0]:H[0]),pe);for(var pe=_e===1?pe:Math.min(te+(H[1]||0),pe),_e=te+_e-2,ae=Math.max(pe,_e),ye=[],Se=[],Ee=2;te<ae;++te,++Ee)te<pe&&Se.push(j("deleted",K[te],te)),te<_e&&ye.push(j("added",H[Ee],te));f.a.Kc(Se,ye);break;default:return}w=ee}}}};var L=f.a.Da("_state");f.o=f.$=function(b,R,G){function I(){if(0<arguments.length){if(typeof w=="function")w.apply(M.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 M.ra||f.u.cc(I),(M.ka||M.J&&I.Xa())&&I.ha(),M.X}if(typeof b=="object"?G=b:(G=G||{},b&&(G.read=b)),typeof G.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var w=G.write,M={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:G.read,nb:R||G.owner,l:G.disposeWhenNodeIsRemoved||G.l||null,Sa:G.disposeWhen||G.Sa,Rb:null,I:{},V:0,Ic:null};return I[L]=M,I.Nc=typeof w=="function",f.a.Ba||f.a.extend(I,f.T.fn),f.T.fn.qb(I),f.a.Ab(I,Z),G.pure?(M.wb=!0,M.J=!0,f.a.extend(I,E)):G.deferEvaluation&&f.a.extend(I,P),f.options.deferUpdates&&f.Ta.deferred(I,!0),M.l&&(M.jc=!0,M.l.nodeType||(M.l=null)),M.J||G.deferEvaluation||I.ha(),M.l&&I.ja()&&f.a.K.za(M.l,M.Rb=function(){I.s()}),I};var Z={equalityComparer:c,qa:function(){return this[L].V},Va:function(){var b=[];return f.a.P(this[L].I,function(R,G){b[G.Ka]=G.da}),b},Vb:function(b){if(!this[L].V)return!1;var R=this.Va();return f.a.A(R,b)!==-1?!0:!!f.a.Lb(R,function(G){return G.Vb&&G.Vb(b)})},uc:function(b,R,G){if(this[L].wb&&R===this)throw Error("A 'pure' computed must not be called recursively");this[L].I[b]=G,G.Ka=this[L].V++,G.La=R.ob()},Xa:function(){var b,R,G=this[L].I;for(b in G)if(Object.prototype.hasOwnProperty.call(G,b)&&(R=G[b],this.Ia&&R.da.Ja||R.da.Dd(R.La)))return!0},Jd:function(){this.Ia&&!this[L].rb&&this.Ia(!1)},ja:function(){var b=this[L];return b.ka||0<b.V},Rd:function(){this.Ja?this[L].ka&&(this[L].sa=!0):this.Hc()},$c:function(b){if(b.Hb){var R=b.subscribe(this.Jd,this,"dirty"),G=b.subscribe(this.Rd,this);return{da:b,s:function(){R.s(),G.s()}}}return b.subscribe(this.Hc,this)},Hc:function(){var b=this,R=b.throttleEvaluation;R&&0<=R?(clearTimeout(this[L].Ic),this[L].Ic=f.a.setTimeout(function(){b.ha(!0)},R)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var R=this[L],G=R.Sa,I=!1;if(!R.rb&&!R.ra){if(R.l&&!f.a.Sb(R.l)||G&&G()){if(!R.jc){this.s();return}}else R.jc=!1;R.rb=!0;try{I=this.zd(b)}finally{R.rb=!1}return I}},zd:function(b){var R=this[L],I=!1,G=R.wb?e:!R.V,I={qd:this,mb:R.I,Qb:R.V};f.u.xc({pd:I,od:g,o:this,Ya:G}),R.I={},R.V=0;var w=this.yd(R,I);return R.V?I=this.sb(R.X,w):(this.s(),I=!0),I&&(R.J?this.Gb():this.notifySubscribers(R.X,"beforeChange"),R.X=w,this.notifySubscribers(R.X,"spectate"),!R.J&&b&&this.notifySubscribers(R.X),this.rc&&this.rc()),G&&this.notifySubscribers(R.X,"awake"),I},yd:function(b,R){try{var G=b.Wc;return b.nb?G.call(b.nb):G()}finally{f.u.end(),R.Qb&&!b.J&&f.a.P(R.mb,p),b.sa=b.ka=!1}},v:function(b){var R=this[L];return(R.ka&&(b||!R.V)||R.J&&this.Xa())&&this.ha(),R.X},ub:function(b){f.T.fn.ub.call(this,b),this.nc=function(){return this[L].J||(this[L].sa?this.ha():this[L].ka=!1),this[L].X},this.Ia=function(R){this.pc(this[L].X),this[L].ka=!0,R&&(this[L].sa=!0),this.qc(this,!R)}},s:function(){var b=this[L];!b.J&&b.I&&f.a.P(b.I,function(R,G){G.s&&G.s()}),b.l&&b.Rb&&f.a.K.yb(b.l,b.Rb),b.I=e,b.V=0,b.ra=!0,b.sa=!1,b.ka=!1,b.J=!1,b.l=e,b.Sa=e,b.Wc=e,this.Nc||(b.nb=e)}},E={Qa:function(b){var R=this,G=R[L];if(!G.ra&&G.J&&b=="change"){if(G.J=!1,G.sa||R.Xa())G.I=null,G.V=0,R.ha()&&R.Gb();else{var I=[];f.a.P(G.I,function(w,M){I[M.Ka]=w}),f.a.D(I,function(w,M){var O=G.I[w],k=R.$c(O.da);k.Ka=M,k.La=O.La,G.I[w]=k}),R.Xa()&&R.ha()&&R.Gb()}G.ra||R.notifySubscribers(G.X,"awake")}},hb:function(b){var R=this[L];R.ra||b!="change"||this.Wa("change")||(f.a.P(R.I,function(G,I){I.s&&(R.I[G]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),R.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var b=this[L];return b.J&&(b.sa||this.Xa())&&this.ha(),f.T.fn.ob.call(this)}},P={Qa:function(b){b!="change"&&b!="beforeChange"||this.v()}};f.a.Ba&&f.a.setPrototypeOf(Z,f.T.fn);var W=f.ta.Ma;Z[W]=f.o,f.Oc=function(b){return typeof b=="function"&&b[W]===Z[W]},f.Fd=function(b){return f.Oc(b)&&b[L]&&b[L].wb},f.b("computed",f.o),f.b("dependentObservable",f.o),f.b("isComputed",f.Oc),f.b("isPureComputed",f.Fd),f.b("computed.fn",Z),f.L(Z,"peek",Z.v),f.L(Z,"dispose",Z.s),f.L(Z,"isActive",Z.ja),f.L(Z,"getDependenciesCount",Z.qa),f.L(Z,"getDependencies",Z.Va),f.xb=function(b,R){return typeof b=="function"?f.o(b,R,{pure:!0}):(b=f.a.extend({},b),b.pure=!0,f.o(b,R))},f.b("pureComputed",f.xb),function(){function b(I,w,M){if(M=M||new G,I=w(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var O=I instanceof Array?[]:{};return M.save(I,O),R(I,function(k){var B=w(I[k]);switch(typeof B){case"boolean":case"number":case"string":case"function":O[k]=B;break;case"object":case"undefined":var N=M.get(B);O[k]=N!==e?N:b(B,w,M)}}),O}function R(I,w){if(I instanceof Array){for(var M=0;M<I.length;M++)w(M);typeof I.toJSON=="function"&&w("toJSON")}else for(M in I)w(M)}function G(){this.keys=[],this.values=[]}f.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(I,function(w){for(var M=0;f.O(w)&&10>M;M++)w=w();return w})},f.toJSON=function(I,w,M){return I=f.ad(I),f.a.hc(I,w,M)},G.prototype={constructor:G,save:function(I,w){var M=f.a.A(this.keys,I);0<=M?this.values[M]=w:(this.keys.push(I),this.values.push(w))},get:function(I){return I=f.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),f.b("toJS",f.ad),f.b("toJSON",f.toJSON),f.Wd=function(b,R,G){function I(w){var M=f.xb(b,G).extend({ma:"always"}),O=M.subscribe(function(k){k&&(O.s(),w(k))});return M.notifySubscribers(M.v()),O}return typeof Promise!="function"||R?I(R.bind(G)):new Promise(I)},f.b("when",f.Wd),function(){f.w={M:function(b){switch(f.a.R(b)){case"option":return b.__ko__hasDomDataOptionValue__===!0?f.a.g.get(b,f.c.options.$b):7>=f.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case"select":return 0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex]):e;default:return b.value}},cb:function(b,R,G){switch(f.a.R(b)){case"option":typeof R=="string"?(f.a.g.set(b,f.c.options.$b,e),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=R):(f.a.g.set(b,f.c.options.$b,R),b.__ko__hasDomDataOptionValue__=!0,b.value=typeof R=="number"?R:"");break;case"select":(R===""||R===null)&&(R=e);for(var I=-1,w=0,M=b.options.length,O;w<M;++w)if(O=f.w.M(b.options[w]),O==R||O===""&&R===e){I=w;break}(G||0<=I||R===e&&1<b.size)&&(b.selectedIndex=I,f.a.W===6&&f.a.setTimeout(function(){b.selectedIndex=I},0));break;default:(R===null||R===e)&&(R=""),b.value=R}}}}(),f.b("selectExtensions",f.w),f.b("selectExtensions.readValue",f.w.M),f.b("selectExtensions.writeValue",f.w.cb),f.m=function(){function b(k){k=f.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=`
|
|
|
,`;var B=[],N=k.match(I),z,K=[],te=0;if(1<N.length){for(var H=0,j;j=N[H];++H){var ee=j.charCodeAt(0);if(ee===44){if(0>=te){B.push(z&&K.length?{key:z,value:K.join("")}:{unknown:z||K.join("")}),z=te=0,K=[];continue}}else if(ee===58){if(!te&&!z&&K.length===1){z=K.pop();continue}}else{if(ee===47&&1<j.length&&(j.charCodeAt(1)===47||j.charCodeAt(1)===42))continue;ee===47&&H&&1<j.length?(ee=N[H-1].match(w))&&!M[ee[0]]&&(k=k.substr(k.indexOf(j)+1),N=k.match(I),H=-1,j="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:z||K.length||ee!==34&&ee!==39||(j=j.slice(1,-1))}K.push(j)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return B}var R=["true","false","null","undefined"],G=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|
|
|
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),w=/[\])"'A-Za-z0-9_$]+$/,M={in:1,return:1,typeof:1},O={};return{Ra:[],wa:O,ac:b,vb:function(k,B){function N(ee,pe){var _e;if(!H){var ae=f.getBindingHandler(ee);if(ae&&ae.preprocess&&!(pe=ae.preprocess(pe,ee,N)))return;(ae=O[ee])&&(_e=pe,0<=f.a.A(R,_e)?_e=!1:(ae=_e.match(G),_e=ae===null?!1:ae[1]?"Object("+ae[1]+")"+ae[2]:_e),ae=_e),ae&&K.push("'"+(typeof O[ee]=="string"?O[ee]:ee)+"':function(_z){"+_e+"=_z}")}te&&(pe="function(){return "+pe+" }"),z.push("'"+ee+"':"+pe)}B=B||{};var z=[],K=[],te=B.valueAccessors,H=B.bindingParams,j=typeof k=="string"?b(k):k;return f.a.D(j,function(ee){N(ee.key||ee.unknown,ee.value)}),K.length&&N("_ko_property_writers","{"+K.join(",")+" }"),z.join(",")},Id:function(k,B){for(var N=0;N<k.length;N++)if(k[N].key==B)return!0;return!1},eb:function(k,B,N,z,K){k&&f.O(k)?!f.Za(k)||K&&k.v()===z||k(z):(k=B.get("_ko_property_writers"))&&k[N]&&k[N](z)}}}(),f.b("expressionRewriting",f.m),f.b("expressionRewriting.bindingRewriteValidators",f.m.Ra),f.b("expressionRewriting.parseObjectLiteral",f.m.ac),f.b("expressionRewriting.preProcessBindings",f.m.vb),f.b("expressionRewriting._twoWayBindings",f.m.wa),f.b("jsonExpressionRewriting",f.m),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.m.vb),function(){function b(N){return N.nodeType==8&&M.test(w?N.text:N.nodeValue)}function R(N){return N.nodeType==8&&O.test(w?N.text:N.nodeValue)}function G(N,z){for(var K=N,te=1,H=[];K=K.nextSibling;){if(R(K)&&(f.a.g.set(K,B,!0),te--,te===0))return H;H.push(K),b(K)&&te++}if(!z)throw Error("Cannot find closing comment tag to match: "+N.nodeValue);return null}function I(N,z){var K=G(N,z);return K?0<K.length?K[K.length-1].nextSibling:N.nextSibling:null}var w=n&&n.createComment("test").text==="<!--test-->",M=w?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,O=w?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0},B="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(N){return b(N)?G(N):N.childNodes},Ea:function(N){if(b(N)){N=f.h.childNodes(N);for(var z=0,K=N.length;z<K;z++)f.removeNode(N[z])}else f.a.Tb(N)},va:function(N,z){if(b(N)){f.h.Ea(N);for(var K=N.nextSibling,te=0,H=z.length;te<H;te++)K.parentNode.insertBefore(z[te],K)}else f.a.va(N,z)},Vc:function(N,z){var K;b(N)?(K=N.nextSibling,N=N.parentNode):K=N.firstChild,K?z!==K&&N.insertBefore(z,K):N.appendChild(z)},Wb:function(N,z,K){K?(K=K.nextSibling,b(N)&&(N=N.parentNode),K?z!==K&&N.insertBefore(z,K):N.appendChild(z)):f.h.Vc(N,z)},firstChild:function(N){if(b(N))return!N.nextSibling||R(N.nextSibling)?null:N.nextSibling;if(N.firstChild&&R(N.firstChild))throw Error("Found invalid end comment, as the first child of "+N);return N.firstChild},nextSibling:function(N){if(b(N)&&(N=I(N)),N.nextSibling&&R(N.nextSibling)){var z=N.nextSibling;if(R(z)&&!f.a.g.get(z,B))throw Error("Found end comment without a matching opening comment, as child of "+N);return null}return N.nextSibling},Cd:b,Vd:function(N){return(N=(w?N.text:N.nodeValue).match(M))?N[1]:null},Sc:function(N){if(k[f.a.R(N)]){var z=N.firstChild;if(z)do if(z.nodeType===1){var K;K=z.firstChild;var te=null;if(K)do if(te)te.push(K);else if(b(K)){var H=I(K,!0);H?K=H:te=[K]}else R(K)&&(te=[K]);while(K=K.nextSibling);if(K=te)for(te=z.nextSibling,H=0;H<K.length;H++)te?N.insertBefore(K[H],te):N.appendChild(K[H])}while(z=z.nextSibling)}}}}(),f.b("virtualElements",f.h),f.b("virtualElements.allowedBindings",f.h.ea),f.b("virtualElements.emptyNode",f.h.Ea),f.b("virtualElements.insertAfter",f.h.Wb),f.b("virtualElements.prepend",f.h.Vc),f.b("virtualElements.setDomNodeChildren",f.h.va),function(){f.ga=function(){this.nd={}},f.a.extend(f.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind")!=null||f.j.getComponentNameForNode(b);case 8:return f.h.Cd(b);default:return!1}},getBindings:function(b,R){var G=this.getBindingsString(b,R),G=G?this.parseBindingsString(G,R,b):null;return f.j.tc(G,b,R,!1)},getBindingAccessors:function(b,R){var G=this.getBindingsString(b,R),G=G?this.parseBindingsString(G,R,b,{valueAccessors:!0}):null;return f.j.tc(G,b,R,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return f.h.Vd(b);default:return null}},parseBindingsString:function(b,R,G,I){try{var w=this.nd,M=b+(I&&I.valueAccessors||""),O;if(!(O=w[M])){var k,B="with($context){with($data||{}){return{"+f.m.vb(b,I)+"}}}";k=new Function("$context","$element",B),O=w[M]=k}return O(R,G)}catch(N){throw N.message=`Unable to parse bindings.
|
|
|
Bindings value: `+b+`
|
|
|
Message: `+N.message,N}}}),f.ga.instance=new f.ga}(),f.b("bindingProvider",f.ga),function(){function b(ae){var ye=(ae=f.a.g.get(ae,_e))&&ae.N;ye&&(ae.N=null,ye.Tc())}function R(ae,ye,Se){this.node=ae,this.yc=ye,this.kb=[],this.H=!1,ye.N||f.a.K.za(ae,b),Se&&Se.N&&(Se.N.kb.push(ae),this.Kb=Se)}function G(ae){return function(){return ae}}function I(ae){return ae()}function w(ae){return f.a.Ga(f.u.G(ae),function(ye,Se){return function(){return ae()[Se]}})}function M(ae,ye,Se){return typeof ae=="function"?w(ae.bind(null,ye,Se)):f.a.Ga(ae,G)}function O(ae,ye){return w(this.getBindings.bind(this,ae,ye))}function k(ae,ye){var Se=f.h.firstChild(ye);if(Se){var Ee,Ie=f.ga.instance,Fe=Ie.preprocessNode;if(Fe){for(;Ee=Se;)Se=f.h.nextSibling(Ee),Fe.call(Ie,Ee);Se=f.h.firstChild(ye)}for(;Ee=Se;)Se=f.h.nextSibling(Ee),B(ae,Ee)}f.i.ma(ye,f.i.H)}function B(ae,ye){var Se=ae,Ee=ye.nodeType===1;Ee&&f.h.Sc(ye),(Ee||f.ga.instance.nodeHasBindings(ye))&&(Se=z(ye,null,ae).bindingContextForDescendants),Se&&!ee[f.a.R(ye)]&&k(Se,ye)}function N(ae){var ye=[],Se={},Ee=[];return f.a.P(ae,function Ie(Fe){if(!Se[Fe]){var ve=f.getBindingHandler(Fe);ve&&(ve.after&&(Ee.push(Fe),f.a.D(ve.after,function(ct){if(ae[ct]){if(f.a.A(Ee,ct)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ee.join(", "));Ie(ct)}}),Ee.length--),ye.push({key:Fe,Mc:ve})),Se[Fe]=!0}}),ye}function z(ae,ye,Se){var Ee=f.a.g.Ub(ae,_e,{}),Ie=Ee.hd;if(!ye){if(Ie)throw Error("You cannot apply bindings multiple times to the same element.");Ee.hd=!0}Ie||(Ee.context=Se),Ee.Zb||(Ee.Zb={});var Fe;if(ye&&typeof ye!="function")Fe=ye;else{var ve=f.ga.instance,ct=ve.getBindingAccessors||O,Je=f.$(function(){return(Fe=ye?ye(Se,ae):ct.call(ve,ae,Se))&&(Se[te]&&Se[te](),Se[j]&&Se[j]()),Fe},null,{l:ae});Fe&&Je.ja()||(Je=null)}var bt=Se,Qe;if(Fe){var Tt=function(){return f.a.Ga(Je?Je():Fe,I)},ft=Je?function(gt){return function(){return I(Je()[gt])}}:function(gt){return Fe[gt]};Tt.get=function(gt){return Fe[gt]&&I(ft(gt))},Tt.has=function(gt){return gt in Fe},f.i.H in Fe&&f.i.subscribe(ae,f.i.H,function(){var gt=(0,Fe[f.i.H])();if(gt){var En=f.h.childNodes(ae);En.length&>(En,f.Ec(En[0]))}}),f.i.pa in Fe&&(bt=f.i.Cb(ae,Se),f.i.subscribe(ae,f.i.pa,function(){var gt=(0,Fe[f.i.pa])();gt&&f.h.firstChild(ae)&>(ae)})),Ee=N(Fe),f.a.D(Ee,function(gt){var En=gt.Mc.init,cn=gt.Mc.update,Ce=gt.key;if(ae.nodeType===8&&!f.h.ea[Ce])throw Error("The binding '"+Ce+"' cannot be used with virtual elements");try{typeof En=="function"&&f.u.G(function(){var Le=En(ae,ft(Ce),Tt,bt.$data,bt);if(Le&&Le.controlsDescendantBindings){if(Qe!==e)throw Error("Multiple bindings ("+Qe+" and "+Ce+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Qe=Ce}}),typeof cn=="function"&&f.$(function(){cn(ae,ft(Ce),Tt,bt.$data,bt)},null,{l:ae})}catch(Le){throw Le.message='Unable to process binding "'+Ce+": "+Fe[Ce]+`"
|
|
|
Message: `+Le.message,Le}})}return Ee=Qe===e,{shouldBindDescendants:Ee,bindingContextForDescendants:Ee&&bt}}function K(ae,ye){return ae&&ae instanceof f.fa?ae:new f.fa(ae,e,e,ye)}var te=f.a.Da("_subscribable"),H=f.a.Da("_ancestorBindingInfo"),j=f.a.Da("_dataDependency");f.c={};var ee={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(ae){return f.c[ae]};var pe={};f.fa=function(ae,ye,Se,Ee,Ie){function Fe(){var ft=bt?Je():Je,gt=f.a.f(ft);return ye?(f.a.extend(ve,ye),H in ye&&(ve[H]=ye[H])):(ve.$parents=[],ve.$root=gt,ve.ko=f),ve[te]=Qe,ct?gt=ve.$data:(ve.$rawData=ft,ve.$data=gt),Se&&(ve[Se]=gt),Ee&&Ee(ve,ye,gt),ye&&ye[te]&&!f.S.o().Vb(ye[te])&&ye[te](),Tt&&(ve[j]=Tt),ve.$data}var ve=this,ct=ae===pe,Je=ct?e:ae,bt=typeof Je=="function"&&!f.O(Je),Qe,Tt=Ie&&Ie.dataDependency;Ie&&Ie.exportDependencies?Fe():(Qe=f.xb(Fe),Qe.v(),Qe.ja()?Qe.equalityComparer=null:ve[te]=e)},f.fa.prototype.createChildContext=function(ae,ye,Se,Ee){if(!Ee&&ye&&typeof ye=="object"&&(Ee=ye,ye=Ee.as,Se=Ee.extend),ye&&Ee&&Ee.noChildContext){var Ie=typeof ae=="function"&&!f.O(ae);return new f.fa(pe,this,null,function(Fe){Se&&Se(Fe),Fe[ye]=Ie?ae():ae},Ee)}return new f.fa(ae,this,ye,function(Fe,ve){Fe.$parentContext=ve,Fe.$parent=ve.$data,Fe.$parents=(ve.$parents||[]).slice(0),Fe.$parents.unshift(Fe.$parent),Se&&Se(Fe)},Ee)},f.fa.prototype.extend=function(ae,ye){return new f.fa(pe,this,null,function(Se){f.a.extend(Se,typeof ae=="function"?ae(Se):ae)},ye)};var _e=f.a.g.Z();R.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},R.prototype.sd=function(ae){f.a.Pa(this.kb,ae),!this.kb.length&&this.H&&this.Cc()},R.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,b),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ae,ye,Se,Ee,Ie){var Fe=f.a.g.Ub(ae,_e,{});return Fe.Fa||(Fe.Fa=new f.T),Ie&&Ie.notifyImmediately&&Fe.Zb[ye]&&f.u.G(Se,Ee,[ae]),Fe.Fa.subscribe(Se,Ee,ye)},ma:function(ae,ye){var Se=f.a.g.get(ae,_e);if(Se&&(Se.Zb[ye]=!0,Se.Fa&&Se.Fa.notifySubscribers(ae,ye),ye==f.i.H)){if(Se.N)Se.N.Cc();else if(Se.N===e&&Se.Fa&&Se.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ae,ye){var Se=f.a.g.Ub(ae,_e,{});return Se.N||(Se.N=new R(ae,Se,ye[H])),ye[H]==Se?ye:ye.extend(function(Ee){Ee[H]=Se})}},f.Td=function(ae){return(ae=f.a.g.get(ae,_e))&&ae.context},f.ib=function(ae,ye,Se){return ae.nodeType===1&&f.h.Sc(ae),z(ae,ye,K(Se))},f.ld=function(ae,ye,Se){return Se=K(Se),f.ib(ae,M(ye,Se,ae),Se)},f.Oa=function(ae,ye){ye.nodeType!==1&&ye.nodeType!==8||k(K(ae),ye)},f.vc=function(ae,ye,Se){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");B(K(ae,Se),ye)},f.Dc=function(ae){return!ae||ae.nodeType!==1&&ae.nodeType!==8?e:f.Td(ae)},f.Ec=function(ae){return(ae=f.Dc(ae))?ae.$data:e},f.b("bindingHandlers",f.c),f.b("bindingEvent",f.i),f.b("bindingEvent.subscribe",f.i.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.i.Cb),f.b("applyBindings",f.vc),f.b("applyBindingsToDescendants",f.Oa),f.b("applyBindingAccessorsToNode",f.ib),f.b("applyBindingsToNode",f.ld),f.b("contextFor",f.Dc),f.b("dataFor",f.Ec)}(),function(b){function R(O,k){var B=Object.prototype.hasOwnProperty.call(w,O)?w[O]:b,N;B?B.subscribe(k):(B=w[O]=new f.T,B.subscribe(k),G(O,function(z,K){var te=!(!K||!K.synchronous);M[O]={definition:z,Gd:te},delete w[O],N||te?B.notifySubscribers(z):f.na.zb(function(){B.notifySubscribers(z)})}),N=!0)}function G(O,k){I("getConfig",[O],function(B){B?I("loadComponent",[O,B],function(N){k(N,B)}):k(null,null)})}function I(O,k,B,N){N||(N=f.j.loaders.slice(0));var z=N.shift();if(z){var K=z[O];if(K){var te=!1;if(K.apply(z,k.concat(function(H){te?B(null):H!==null?B(H):I(O,k,B,N)}))!==b&&(te=!0,!z.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(O,k,B,N)}else B(null)}var w={},M={};f.j={get:function(O,k){var B=Object.prototype.hasOwnProperty.call(M,O)?M[O]:b;B?B.Gd?f.u.G(function(){k(B.definition)}):f.na.zb(function(){k(B.definition)}):R(O,k)},Bc:function(O){delete M[O]},oc:I},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)}(),function(){function b(B,N,z,K){function te(){--j===0&&K(H)}var H={},j=2,ee=z.template;z=z.viewModel,ee?w(N,ee,function(pe){f.j.oc("loadTemplate",[B,pe],function(_e){H.template=_e,te()})}):te(),z?w(N,z,function(pe){f.j.oc("loadViewModel",[B,pe],function(_e){H[k]=_e,te()})}):te()}function R(B,N,z){if(typeof N=="function")z(function(te){return new N(te)});else if(typeof N[k]=="function")z(N[k]);else if("instance"in N){var K=N.instance;z(function(){return K})}else"viewModel"in N?R(B,N.viewModel,z):B("Unknown viewModel value: "+N)}function G(B){switch(f.a.R(B)){case"script":return f.a.ua(B.text);case"textarea":return f.a.ua(B.value);case"template":if(I(B.content))return f.a.Ca(B.content.childNodes)}return f.a.Ca(B.childNodes)}function I(B){return t.DocumentFragment?B instanceof DocumentFragment:B&&B.nodeType===11}function w(B,N,z){typeof N.require=="string"?a||t.require?(a||t.require)([N.require],function(K){K&&typeof K=="object"&&K.Xd&&K.default&&(K=K.default),z(K)}):B("Uses require, but no AMD loader is present"):z(N)}function M(B){return function(N){throw Error("Component '"+B+"': "+N)}}var O={};f.j.register=function(B,N){if(!N)throw Error("Invalid configuration for "+B);if(f.j.tb(B))throw Error("Component "+B+" is already registered");O[B]=N},f.j.tb=function(B){return Object.prototype.hasOwnProperty.call(O,B)},f.j.unregister=function(B){delete O[B],f.j.Bc(B)},f.j.Fc={getConfig:function(B,N){N(f.j.tb(B)?O[B]:null)},loadComponent:function(B,N,z){var K=M(B);w(K,N,function(te){b(B,K,te,z)})},loadTemplate:function(B,N,z){if(B=M(B),typeof N=="string")z(f.a.ua(N));else if(N instanceof Array)z(N);else if(I(N))z(f.a.la(N.childNodes));else if(N.element)if(N=N.element,t.HTMLElement?N instanceof HTMLElement:N&&N.tagName&&N.nodeType===1)z(G(N));else if(typeof N=="string"){var K=n.getElementById(N);K?z(G(K)):B("Cannot find element with ID "+N)}else B("Unknown element type: "+N);else B("Unknown template value: "+N)},loadViewModel:function(B,N,z){R(M(B),N,z)}};var k="createViewModel";f.b("components.register",f.j.register),f.b("components.isRegistered",f.j.tb),f.b("components.unregister",f.j.unregister),f.b("components.defaultLoader",f.j.Fc),f.j.loaders.push(f.j.Fc),f.j.dd=O}(),function(){function b(G,I){var w=G.getAttribute("params");if(w){var w=R.parseBindingsString(w,I,G,{valueAccessors:!0,bindingParams:!0}),w=f.a.Ga(w,function(k){return f.o(k,null,{l:G})}),M=f.a.Ga(w,function(k){var B=k.v();return k.ja()?f.o({read:function(){return f.a.f(k())},write:f.Za(B)&&function(N){k()(N)},l:G}):B});return Object.prototype.hasOwnProperty.call(M,"$raw")||(M.$raw=w),M}return{$raw:{}}}f.j.getComponentNameForNode=function(G){var I=f.a.R(G);if(f.j.tb(I)&&(I.indexOf("-")!=-1||""+G=="[object HTMLUnknownElement]"||8>=f.a.W&&G.tagName===I))return I},f.j.tc=function(G,I,w,M){if(I.nodeType===1){var O=f.j.getComponentNameForNode(I);if(O){if(G=G||{},G.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:O,params:b(I,w)};G.component=M?function(){return k}:k}}return G};var R=new f.ga;9>f.a.W&&(f.j.register=function(G){return function(I){return G.apply(this,arguments)}}(f.j.register),n.createDocumentFragment=function(G){return function(){var I=G(),w=f.j.dd,M;for(M in w);return I}}(n.createDocumentFragment))}(),function(){function b(I,w,M){if(w=w.template,!w)throw Error("Component '"+I+"' has no template");I=f.a.Ca(w),f.h.va(M,I)}function R(I,w,M){var O=I.createViewModel;return O?O.call(I,w,M):w}var G=0;f.c.component={init:function(I,w,M,O,k){function B(){var H=N&&N.dispose;typeof H=="function"&&H.call(N),K&&K.s(),z=N=K=null}var N,z,K,te=f.a.la(f.h.childNodes(I));return f.h.Ea(I),f.a.K.za(I,B),f.o(function(){var H=f.a.f(w()),j,ee;if(typeof H=="string"?j=H:(j=f.a.f(H.name),ee=f.a.f(H.params)),!j)throw Error("No component name specified");var pe=f.i.Cb(I,k),_e=z=++G;f.j.get(j,function(ae){if(z===_e){if(B(),!ae)throw Error("Unknown component '"+j+"'");b(j,ae,I);var ye=R(ae,ee,{element:I,templateNodes:te});ae=pe.createChildContext(ye,{extend:function(Se){Se.$component=ye,Se.$componentTemplateNodes=te}}),ye&&ye.koDescendantsComplete&&(K=f.i.subscribe(I,f.i.pa,ye.koDescendantsComplete,ye)),N=ye,f.Oa(ae,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0}();var v={class:"className",for:"htmlFor"};f.c.attr={update:function(b,R){var G=f.a.f(R())||{};f.a.P(G,function(I,w){w=f.a.f(w);var M=I.indexOf(":"),M="lookupNamespaceURI"in b&&0<M&&b.lookupNamespaceURI(I.substr(0,M)),O=w===!1||w===null||w===e;O?M?b.removeAttributeNS(M,I):b.removeAttribute(I):w=w.toString(),8>=f.a.W&&I in v?(I=v[I],O?b.removeAttribute(I):b[I]=w):O||(M?b.setAttributeNS(M,I,w):b.setAttribute(I,w)),I==="name"&&f.a.Yc(b,O?"":w)})}},function(){f.c.checked={after:["value","attr"],init:function(b,R,G){function I(){var H=b.checked,j=M();if(!f.S.Ya()&&(H||!k&&!f.S.qa())){var ee=f.u.G(R);if(N){var pe=z?ee.v():ee,_e=te;te=j,_e!==j?H&&(f.a.Na(pe,j,!0),f.a.Na(pe,_e,!1)):f.a.Na(pe,j,H),z&&f.Za(ee)&&ee(pe)}else O&&(j===e?j=H:H||(j=e)),f.m.eb(ee,G,"checked",j,!0)}}function w(){var H=f.a.f(R()),j=M();N?(b.checked=0<=f.a.A(H,j),te=j):b.checked=O&&j===e?!!H:M()===H}var M=f.xb(function(){if(G.has("checkedValue"))return f.a.f(G.get("checkedValue"));if(K)return G.has("value")?f.a.f(G.get("value")):b.value}),O=b.type=="checkbox",k=b.type=="radio";if(O||k){var B=R(),N=O&&f.a.f(B)instanceof Array,z=!(N&&B.push&&B.splice),K=k||N,te=N?M():e;k&&!b.name&&f.c.uniqueName.init(b,function(){return!0}),f.o(I,null,{l:b}),f.a.B(b,"click",I),f.o(w,null,{l:b}),B=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(b,R){b.value=f.a.f(R())}}}(),f.c.class={update:function(b,R){var G=f.a.Db(f.a.f(R()));f.a.Eb(b,b.__ko__cssValue,!1),b.__ko__cssValue=G,f.a.Eb(b,G,!0)}},f.c.css={update:function(b,R){var G=f.a.f(R());G!==null&&typeof G=="object"?f.a.P(G,function(I,w){w=f.a.f(w),f.a.Eb(b,I,w)}):f.c.class.update(b,R)}},f.c.enable={update:function(b,R){var G=f.a.f(R());G&&b.disabled?b.removeAttribute("disabled"):G||b.disabled||(b.disabled=!0)}},f.c.disable={update:function(b,R){f.c.enable.update(b,function(){return!f.a.f(R())})}},f.c.event={init:function(b,R,G,I,w){var M=R()||{};f.a.P(M,function(O){typeof O=="string"&&f.a.B(b,O,function(k){var B,N=R()[O];if(N){try{var z=f.a.la(arguments);I=w.$data,z.unshift(I),B=N.apply(I,z)}finally{B!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}G.get(O+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.stopPropagation())}})})}},f.c.foreach={Rc:function(b){return function(){var R=b(),G=f.a.bc(R);return!G||typeof G.length=="number"?{foreach:R,templateEngine:f.ba.Ma}:(f.a.f(R),{foreach:G.data,as:G.as,noChildContext:G.noChildContext,includeDestroyed:G.includeDestroyed,afterAdd:G.afterAdd,beforeRemove:G.beforeRemove,afterRender:G.afterRender,beforeMove:G.beforeMove,afterMove:G.afterMove,templateEngine:f.ba.Ma})}},init:function(b,R){return f.c.template.init(b,f.c.foreach.Rc(R))},update:function(b,R,G,I,w){return f.c.template.update(b,f.c.foreach.Rc(R),G,I,w)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(b,R,G){function I(O){b.__ko_hasfocusUpdating=!0;var k=b.ownerDocument;if("activeElement"in k){var B;try{B=k.activeElement}catch{B=k.body}O=B===b}k=R(),f.m.eb(k,G,"hasfocus",O,!0),b.__ko_hasfocusLastValue=O,b.__ko_hasfocusUpdating=!1}var w=I.bind(null,!0),M=I.bind(null,!1);f.a.B(b,"focus",w),f.a.B(b,"focusin",w),f.a.B(b,"blur",M),f.a.B(b,"focusout",M),b.__ko_hasfocusLastValue=!1},update:function(b,R){var G=!!f.a.f(R());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===G||(G?b.focus():b.blur(),!G&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[b,G?"focusin":"focusout"]))}},f.m.wa.hasfocus=!0,f.c.hasFocus=f.c.hasfocus,f.m.wa.hasFocus="hasfocus",f.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.fc(b,R())}},function(){function b(R,G,I){f.c[R]={init:function(w,M,O,k,B){var N,z,K={},te,H,j;if(G){k=O.get("as");var ee=O.get("noChildContext");j=!(k&&ee),K={as:k,noChildContext:ee,exportDependencies:j}}return H=(te=O.get("completeOn")=="render")||O.has(f.i.pa),f.o(function(){var pe=f.a.f(M()),_e=!I!=!pe,ae=!z,ye;(j||_e!==N)&&(H&&(B=f.i.Cb(w,B)),_e&&((!G||j)&&(K.dataDependency=f.S.o()),ye=G?B.createChildContext(typeof pe=="function"?pe:M,K):f.S.qa()?B.extend(null,K):B),ae&&f.S.qa()&&(z=f.a.Ca(f.h.childNodes(w),!0)),_e?(ae||f.h.va(w,f.a.Ca(z)),f.Oa(ye,w)):(f.h.Ea(w),te||f.i.ma(w,f.i.H)),N=_e)},null,{l:w}),{controlsDescendantBindings:!0}}},f.m.Ra[R]=!1,f.h.ea[R]=!0}b("if"),b("ifnot",!1,!0),b("with",!0)}(),f.c.let={init:function(b,R,G,I,w){return R=w.extend(R),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var A={};f.c.options={init:function(b){if(f.a.R(b)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,R,G){function I(){return f.a.jb(b.options,function(ee){return ee.selected})}function w(ee,pe,_e){var ae=typeof pe;return ae=="function"?pe(ee):ae=="string"?ee[pe]:_e}function M(ee,pe){if(H&&N)f.i.ma(b,f.i.H);else if(te.length){var _e=0<=f.a.A(te,f.w.M(pe[0]));f.a.Zc(pe[0],_e),H&&!_e&&f.u.G(f.a.Fb,null,[b,"change"])}}var O=b.multiple,k=b.length!=0&&O?b.scrollTop:null,B=f.a.f(R()),N=G.get("valueAllowUnset")&&G.has("value"),z=G.get("optionsIncludeDestroyed");R={};var K,te=[];N||(O?te=f.a.Mb(I(),f.w.M):0<=b.selectedIndex&&te.push(f.w.M(b.options[b.selectedIndex]))),B&&(typeof B.length>"u"&&(B=[B]),K=f.a.jb(B,function(ee){return z||ee===e||ee===null||!f.a.f(ee._destroy)}),G.has("optionsCaption")&&(B=f.a.f(G.get("optionsCaption")),B!==null&&B!==e&&K.unshift(A)));var H=!1;if(R.beforeRemove=function(ee){b.removeChild(ee)},B=M,G.has("optionsAfterRender")&&typeof G.get("optionsAfterRender")=="function"&&(B=function(ee,pe){M(0,pe),f.u.G(G.get("optionsAfterRender"),null,[pe[0],ee!==A?ee:e])}),f.a.ec(b,K,function(ee,pe,_e){return _e.length&&(te=!N&&_e[0].selected?[f.w.M(_e[0])]:[],H=!0),pe=b.ownerDocument.createElement("option"),ee===A?(f.a.Bb(pe,G.get("optionsCaption")),f.w.cb(pe,e)):(_e=w(ee,G.get("optionsValue"),ee),f.w.cb(pe,f.a.f(_e)),ee=w(ee,G.get("optionsText"),_e),f.a.Bb(pe,ee)),[pe]},R,B),!N){var j;O?j=te.length&&I().length<te.length:j=te.length&&0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex])!==te[0]:te.length||0<=b.selectedIndex,j&&f.u.G(f.a.Fb,null,[b,"change"])}(N||f.S.Ya())&&f.i.ma(b,f.i.H),f.a.wd(b),k&&20<Math.abs(k-b.scrollTop)&&(b.scrollTop=k)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(b,R,G){function I(){var O=R(),k=[];f.a.D(b.getElementsByTagName("option"),function(B){B.selected&&k.push(f.w.M(B))}),f.m.eb(O,G,"selectedOptions",k)}function w(){var O=f.a.f(R()),k=b.scrollTop;O&&typeof O.length=="number"&&f.a.D(b.getElementsByTagName("option"),function(B){var N=0<=f.a.A(O,f.w.M(B));B.selected!=N&&f.a.Zc(B,N)}),b.scrollTop=k}if(f.a.R(b)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var M;f.i.subscribe(b,f.i.H,function(){M?I():(f.a.B(b,"change",I),M=f.o(w,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(b,R){var G=f.a.f(R()||{});f.a.P(G,function(I,w){if(w=f.a.f(w),(w===null||w===e||w===!1)&&(w=""),o)o(b).css(I,w);else if(/^--/.test(I))b.style.setProperty(I,w);else{I=I.replace(/-(\w)/g,function(O,k){return k.toUpperCase()});var M=b.style[I];b.style[I]=w,w===M||b.style[I]!=M||isNaN(w)||(b.style[I]=w+"px")}})}},f.c.submit={init:function(b,R,G,I,w){if(typeof R()!="function")throw Error("The value for a submit binding must be a function");f.a.B(b,"submit",function(M){var O,k=R();try{O=k.call(w.$data,b)}finally{O!==!0&&(M.preventDefault?M.preventDefault():M.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.Bb(b,R())}},f.h.ea.text=!0,function(){if(t&&t.navigator){var b=function(K){if(K)return parseFloat(K[1])},R=t.navigator.userAgent,G,I,w,M,O;(G=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(O=b(R.match(/Edge\/([^ ]+)$/)))||b(R.match(/Chrome\/([^ ]+)/))||(I=b(R.match(/Version\/([^ ]+) Safari/)))||(w=b(R.match(/Firefox\/([^ ]+)/)))||(M=f.a.W||b(R.match(/MSIE ([^ ]+)/)))||(M=b(R.match(/rv:([^ )]+)/)))}if(8<=M&&10>M)var k=f.a.g.Z(),B=f.a.g.Z(),N=function(K){var te=this.activeElement;(te=te&&f.a.g.get(te,B))&&te(K)},z=function(K,te){var H=K.ownerDocument;f.a.g.get(H,k)||(f.a.g.set(H,k,!0),f.a.B(H,"selectionchange",N)),f.a.g.set(K,B,te)};f.c.textInput={init:function(K,te,H){function j(Fe,ve){f.a.B(K,Fe,ve)}function ee(){var Fe=f.a.f(te());(Fe===null||Fe===e)&&(Fe=""),Se!==e&&Fe===Se?f.a.setTimeout(ee,4):K.value!==Fe&&(Ie=!0,K.value=Fe,Ie=!1,ae=K.value)}function pe(){ye||(Se=K.value,ye=f.a.setTimeout(_e,4))}function _e(){clearTimeout(ye),Se=ye=e;var Fe=K.value;ae!==Fe&&(ae=Fe,f.m.eb(te(),H,"textInput",Fe))}var ae=K.value,ye,Se,Ee=f.a.W==9?pe:_e,Ie=!1;M&&j("keypress",_e),11>M&&j("propertychange",function(Fe){Ie||Fe.propertyName!=="value"||Ee(Fe)}),M==8&&(j("keyup",_e),j("keydown",_e)),z&&(z(K,Ee),j("dragend",pe)),(!M||9<=M)&&j("input",Ee),5>I&&f.a.R(K)==="textarea"?(j("keydown",pe),j("paste",pe),j("cut",pe)):11>G?j("keydown",pe):4>w?(j("DOMAutoComplete",_e),j("dragdrop",_e),j("drop",_e)):O&&K.type==="number"&&j("keydown",pe),j("change",_e),j("blur",_e),f.o(ee,null,{l:K})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(K,te,H){H("textInput",K)}}}(),f.c.uniqueName={init:function(b,R){if(R()){var G="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(b,G)}}},f.c.uniqueName.rd=0,f.c.using={init:function(b,R,G,I,w){var M;return G.has("as")&&(M={as:G.get("as"),noChildContext:G.get("noChildContext")}),R=w.createChildContext(R,M),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(b,R,G){var I=f.a.R(b),w=I=="input";if(!w||b.type!="checkbox"&&b.type!="radio"){var M=[],O=G.get("valueUpdate"),k=!1,B=null;O&&(typeof O=="string"?M=[O]:M=f.a.wc(O),f.a.Pa(M,"change"));var N=function(){B=null,k=!1;var te=R(),H=f.w.M(b);f.m.eb(te,G,"value",H)};!f.a.W||!w||b.type!="text"||b.autocomplete=="off"||b.form&&b.form.autocomplete=="off"||f.a.A(M,"propertychange")!=-1||(f.a.B(b,"propertychange",function(){k=!0}),f.a.B(b,"focus",function(){k=!1}),f.a.B(b,"blur",function(){k&&N()})),f.a.D(M,function(te){var H=N;f.a.Ud(te,"after")&&(H=function(){B=f.w.M(b),f.a.setTimeout(N,0)},te=te.substring(5)),f.a.B(b,te,H)});var z;if(z=w&&b.type=="file"?function(){var te=f.a.f(R());te===null||te===e||te===""?b.value="":f.u.G(N)}:function(){var te=f.a.f(R()),H=f.w.M(b);B!==null&&te===B?f.a.setTimeout(z,0):(te!==H||H===e)&&(I==="select"?(H=G.get("valueAllowUnset"),f.w.cb(b,te,H),H||te===f.w.M(b)||f.u.G(N)):f.w.cb(b,te))},I==="select"){var K;f.i.subscribe(b,f.i.H,function(){K?G.get("valueAllowUnset")?z():N():(f.a.B(b,"change",N),K=f.o(z,null,{l:b}))},null,{notifyImmediately:!0})}else f.a.B(b,"change",N),f.o(z,null,{l:b})}else f.ib(b,{checkedValue:R})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(b,R){var G=f.a.f(R()),I=b.style.display!="none";G&&!I?b.style.display="":!G&&I&&(b.style.display="none")}},f.c.hidden={update:function(b,R){f.c.visible.update(b,function(){return!f.a.f(R())})}},function(b){f.c[b]={init:function(R,G,I,w,M){return f.c.event.init.call(this,R,function(){var O={};return O[b]=G(),O},I,w,M)}}}("click"),f.ca=function(){},f.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.ca.prototype.makeTemplateSource=function(b,R){if(typeof b=="string"){R=R||n;var G=R.getElementById(b);if(!G)throw Error("Cannot find template with ID "+b);return new f.C.F(G)}if(b.nodeType==1||b.nodeType==8)return new f.C.ia(b);throw Error("Unknown template type: "+b)},f.ca.prototype.renderTemplate=function(b,R,G,I){return b=this.makeTemplateSource(b,I),this.renderTemplateSource(b,R,G,I)},f.ca.prototype.isTemplateRewritten=function(b,R){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(b,R).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(b,R,G){b=this.makeTemplateSource(b,G),R=R(b.text()),b.text(R),b.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=function(){function b(I,w,M,O){I=f.m.ac(I);for(var k=f.m.Ra,B=0;B<I.length;B++){var N=I[B].key;if(Object.prototype.hasOwnProperty.call(k,N)){var z=k[N];if(typeof z=="function"){if(N=z(I[B].value))throw Error(N)}else if(!z)throw Error("This template engine does not support the '"+N+"' binding within its templates")}}return M="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(I,{valueAccessors:!0})+" } })()},'"+M.toLowerCase()+"')",O.createJavaScriptEvaluatorBlock(M)+w}var R=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,G=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,w,M){w.isTemplateRewritten(I,M)||w.rewriteTemplate(I,function(O){return f.kc.Ld(O,w)},M)},Ld:function(I,w){return I.replace(R,function(M,O,k,B,N){return b(N,O,k,w)}).replace(G,function(M,O){return b(O,"<!-- ko -->","#comment",w)})},md:function(I,w){return f.aa.Xb(function(M,O){var k=M.nextSibling;k&&k.nodeName.toLowerCase()===w&&f.ib(k,I,O)})}}}(),f.b("__tr_ambtns",f.kc.md),function(){f.C={},f.C.F=function(G){if(this.F=G){var I=f.a.R(G);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&G.content&&G.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var G=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[G];var I=arguments[0];G==="innerHTML"?f.a.fc(this.F,I):this.F[G]=I};var b=f.a.g.Z()+"_";f.C.F.prototype.data=function(G){if(arguments.length===1)return f.a.g.get(this.F,b+G);f.a.g.set(this.F,b+G,arguments[1])};var R=f.a.g.Z();f.C.F.prototype.nodes=function(){var G=this.F;if(arguments.length==0){var I=f.a.g.get(G,R)||{},w=I.lb||(this.ab===3?G.content:this.ab===4?G:e);if(!w||I.jd){var M=this.text();M&&M!==I.bb&&(w=f.a.Md(M,G.ownerDocument),f.a.g.set(G,R,{lb:w,bb:M,jd:!0}))}return w}I=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(G,R,{lb:I})},f.C.ia=function(G){this.F=G},f.C.ia.prototype=new f.C.F,f.C.ia.prototype.constructor=f.C.ia,f.C.ia.prototype.text=function(){if(arguments.length==0){var G=f.a.g.get(this.F,R)||{};return G.bb===e&&G.lb&&(G.bb=G.lb.innerHTML),G.bb}f.a.g.set(this.F,R,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)}(),function(){function b(B,N,z){var K;for(N=f.h.nextSibling(N);B&&(K=B)!==N;)B=f.h.nextSibling(K),z(K,B)}function R(B,N){if(B.length){var z=B[0],K=B[B.length-1],te=z.parentNode,H=f.ga.instance,j=H.preprocessNode;if(j){if(b(z,K,function(ee,pe){var _e=ee.previousSibling,ae=j.call(H,ee);ae&&(ee===z&&(z=ae[0]||pe),ee===K&&(K=ae[ae.length-1]||_e))}),B.length=0,!z)return;z===K?B.push(z):(B.push(z,K),f.a.Ua(B,te))}b(z,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.vc(N,ee)}),b(z,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[N])}),f.a.Ua(B,te)}}function G(B){return B.nodeType?B:0<B.length?B[0]:null}function I(B,N,z,K,te){te=te||{};var H=(B&&G(B)||z||{}).ownerDocument,j=te.templateEngine||M;if(f.kc.xd(z,j,H),z=j.renderTemplate(z,K,te,H),typeof z.length!="number"||0<z.length&&typeof z[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(H=!1,N){case"replaceChildren":f.h.va(B,z),H=!0;break;case"replaceNode":f.a.Xc(B,z),H=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+N)}return H&&(R(z,K),te.afterRender&&f.u.G(te.afterRender,null,[z,K[te.as||"$data"]]),N=="replaceChildren"&&f.i.ma(B,f.i.H)),z}function w(B,N,z){return f.O(B)?B():typeof B=="function"?B(N,z):B}var M;f.gc=function(B){if(B!=e&&!(B instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");M=B},f.dc=function(B,N,z,K,te){if(z=z||{},(z.templateEngine||M)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",K){var H=G(K);return f.$(function(){var ee=N&&N instanceof f.fa?N:new f.fa(N,null,null,null,{exportDependencies:!0}),j=w(B,ee.$data,ee),ee=I(K,te,j,ee,z);te=="replaceNode"&&(K=ee,H=G(K))},null,{Sa:function(){return!H||!f.a.Sb(H)},l:H&&te=="replaceNode"?H.parentNode:H})}return f.aa.Xb(function(j){f.dc(B,N,z,j,"replaceNode")})},f.Qd=function(B,N,z,K,te){function H(Se,Ee){f.u.G(f.a.ec,null,[K,Se,ee,z,j,Ee]),f.i.ma(K,f.i.H)}function j(Se,Ee){R(Ee,pe),z.afterRender&&z.afterRender(Ee,Se),pe=null}function ee(Se,Ee){pe=te.createChildContext(Se,{as:_e,noChildContext:z.noChildContext,extend:function(Fe){Fe.$index=Ee,_e&&(Fe[_e+"Index"]=Ee)}});var Ie=w(B,Se,pe);return I(K,"ignoreTargetNode",Ie,pe,z)}var pe,_e=z.as,ae=z.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!z.includeDestroyed;if(ae||z.beforeRemove||!f.Pc(N))return f.$(function(){var Se=f.a.f(N)||[];typeof Se.length>"u"&&(Se=[Se]),ae&&(Se=f.a.jb(Se,function(Ee){return Ee===e||Ee===null||!f.a.f(Ee._destroy)})),H(Se)},null,{l:K});H(N.v());var ye=N.subscribe(function(Se){H(N(),Se)},null,"arrayChange");return ye.l(K),ye};var O=f.a.g.Z(),k=f.a.g.Z();f.c.template={init:function(B,N){var z=f.a.f(N());if(typeof z=="string"||"name"in z)f.h.Ea(B);else if("nodes"in z){if(z=z.nodes||[],f.O(z))throw Error('The "nodes" option must be a plain, non-observable array.');var K=z[0]&&z[0].parentNode;K&&f.a.g.get(K,k)||(K=f.a.Yb(z),f.a.g.set(K,k,!0)),new f.C.ia(B).nodes(K)}else if(z=f.h.childNodes(B),0<z.length)K=f.a.Yb(z),new f.C.ia(B).nodes(K);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(B,N,z,K,te){var H=N();N=f.a.f(H),z=!0,K=null,typeof N=="string"?N={}:(H="name"in N?N.name:B,"if"in N&&(z=f.a.f(N.if)),z&&"ifnot"in N&&(z=!f.a.f(N.ifnot)),z&&!H&&(z=!1)),"foreach"in N?K=f.Qd(H,z&&N.foreach||[],N,B,te):z?(z=te,"data"in N&&(z=te.createChildContext(N.data,{as:N.as,noChildContext:N.noChildContext,exportDependencies:!0})),K=f.dc(H,z,N,B)):f.h.Ea(B),te=K,(N=f.a.g.get(B,O))&&typeof N.s=="function"&&N.s(),f.a.g.set(B,O,!te||te.ja&&!te.ja()?e:te)}},f.m.Ra.template=function(B){return B=f.m.ac(B),B.length==1&&B[0].unknown||f.m.Id(B,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0}(),f.b("setTemplateEngine",f.gc),f.b("renderTemplate",f.dc),f.a.Kc=function(b,R,G){if(b.length&&R.length){var I,w,M,O,k;for(I=w=0;(!G||I<G)&&(O=b[w]);++w){for(M=0;k=R[M];++M)if(O.value===k.value){O.moved=k.index,k.moved=O.index,R.splice(M,1),I=M=0;break}I+=M}}},f.a.Pb=function(){function b(R,G,I,w,M){var O=Math.min,k=Math.max,B=[],N,z=R.length,K,te=G.length,H=te-z||1,j=z+te+1,ee,pe,_e;for(N=0;N<=z;N++)for(pe=ee,B.push(ee=[]),_e=O(te,N+H),K=k(0,N-1);K<=_e;K++)ee[K]=K?N?R[N-1]===G[K-1]?pe[K-1]:O(pe[K]||j,ee[K-1]||j)+1:K+1:N+1;for(O=[],k=[],H=[],N=z,K=te;N||K;)te=B[N][K]-1,K&&te===B[N][K-1]?k.push(O[O.length]={status:I,value:G[--K],index:K}):N&&te===B[N-1][K]?H.push(O[O.length]={status:w,value:R[--N],index:N}):(--K,--N,M.sparse||O.push({status:"retained",value:G[K]}));return f.a.Kc(H,k,!M.dontLimitMoves&&10*z),O.reverse()}return function(R,G,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},R=R||[],G=G||[],R.length<G.length?b(R,G,"added","deleted",I):b(G,R,"deleted","added",I)}}(),f.b("utils.compareArrays",f.a.Pb),function(){function b(I,w,M,O,k){var B=[],N=f.$(function(){var z=w(M,k,f.a.Ua(B,I))||[];0<B.length&&(f.a.Xc(B,z),O&&f.u.G(O,null,[M,z,k])),B.length=0,f.a.Nb(B,z)},null,{l:I,Sa:function(){return!f.a.kd(B)}});return{Y:B,$:N.ja()?N:e}}var R=f.a.g.Z(),G=f.a.g.Z();f.a.ec=function(I,w,M,O,k,B){function N(gt){Ie={Aa:gt,pb:f.ta(pe++)},j.push(Ie),H||Ee.push(Ie)}function z(gt){Ie=te[gt],pe!==Ie.pb.v()&&Se.push(Ie),Ie.pb(pe++),f.a.Ua(Ie.Y,I),j.push(Ie)}function K(gt,En){if(gt)for(var cn=0,Ce=En.length;cn<Ce;cn++)f.a.D(En[cn].Y,function(Le){gt(Le,cn,En[cn].Aa)})}w=w||[],typeof w.length>"u"&&(w=[w]),O=O||{};var te=f.a.g.get(I,R),H=!te,j=[],ee=0,pe=0,_e=[],ae=[],ye=[],Se=[],Ee=[],Ie,Fe=0;if(H)f.a.D(w,N);else{if(!B||te&&te._countWaitingForRemove){var ve=f.a.Mb(te,function(gt){return gt.Aa});B=f.a.Pb(ve,w,{dontLimitMoves:O.dontLimitMoves,sparse:!0})}for(var ve=0,ct,Je,bt;ct=B[ve];ve++)switch(Je=ct.moved,bt=ct.index,ct.status){case"deleted":for(;ee<bt;)z(ee++);Je===e&&(Ie=te[ee],Ie.$&&(Ie.$.s(),Ie.$=e),f.a.Ua(Ie.Y,I).length&&(O.beforeRemove&&(j.push(Ie),Fe++,Ie.Aa===G?Ie=null:ye.push(Ie)),Ie&&_e.push.apply(_e,Ie.Y))),ee++;break;case"added":for(;pe<bt;)z(ee++);Je!==e?(ae.push(j.length),z(Je)):N(ct.value)}for(;pe<w.length;)z(ee++);j._countWaitingForRemove=Fe}f.a.g.set(I,R,j),K(O.beforeMove,Se),f.a.D(_e,O.beforeRemove?f.oa:f.removeNode);var Qe,Tt,ft;try{ft=I.ownerDocument.activeElement}catch{}if(ae.length)for(;(ve=ae.shift())!=e;){for(Ie=j[ve],Qe=e;ve;)if((Tt=j[--ve].Y)&&Tt.length){Qe=Tt[Tt.length-1];break}for(w=0;ee=Ie.Y[w];Qe=ee,w++)f.h.Wb(I,ee,Qe)}for(ve=0;Ie=j[ve];ve++){for(Ie.Y||f.a.extend(Ie,b(I,M,Ie.Aa,k,Ie.pb)),w=0;ee=Ie.Y[w];Qe=ee,w++)f.h.Wb(I,ee,Qe);!Ie.Ed&&k&&(k(Ie.Aa,Ie.Y,Ie.pb),Ie.Ed=!0,Qe=Ie.Y[Ie.Y.length-1])}for(ft&&I.ownerDocument.activeElement!=ft&&ft.focus(),K(O.beforeRemove,ye),ve=0;ve<ye.length;++ve)ye[ve].Aa=G;K(O.afterMove,Se),K(O.afterAdd,Ee)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.ec),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(b,R,G,I){return(R=!(9>f.a.W)&&b.nodes?b.nodes():null)?f.a.la(R.cloneNode(!0).childNodes):(b=b.text(),f.a.ua(b,I))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),function(){f.$a=function(){var R=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(G,I,w,M){if(M=M||n,w=w||{},2>R)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var O=G.data("precompiled");return O||(O=G.text()||"",O=o.template(null,"{{ko_with $item.koBindingContext}}"+O+"{{/ko_with}}"),G.data("precompiled",O)),G=[I.$data],I=o.extend({koBindingContext:I},w.templateOptions),I=o.tmpl(O,G,I),I.appendTo(M.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(G){return"{{ko_code ((function() { return "+G+" })()) }}"},this.addTemplate=function(G,I){n.write("<script type='text/html' id='"+G+"'>"+I+"<\/script>")},0<R&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.$a.prototype=new f.ca,f.$a.prototype.constructor=f.$a;var b=new f.$a;0<b.Hd&&f.gc(b),f.b("jqueryTmplTemplateEngine",f.$a)}()})})()})()})();var t1t=ko;typeof window<"u"?(ko=window.ko,typeof rM<"u"?window.ko=rM:delete window.ko):(ko=global.ko,typeof rM<"u"?global.ko=rM:delete global.ko);var FS=t1t;var D1o=_(T(),1);/**
|
|
|
* @license
|
|
|
* Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
|
|
|
* Copyright (c) Steve Sanderson
|
|
|
* MIT license
|
|
|
*/var Y6="__knockoutObservables",z6="__knockoutSubscribable";function yCe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=xCe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Y6||o===z6)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&i1t(n,a)}}),e}function xCe(e,t){var n=e[Y6];return!n&&t&&(n={},Object.defineProperty(e,Y6,{value:n})),n}function n1t(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),yCe.call(i,e,[t]),e}function i1t(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=o1t(e,t,i))})}function o1t(e,t,n){var i=r1t(e,n);return i.subscribe(t)}function r1t(e,t){var n=t[z6];if(!n){n=new e.subscribable,Object.defineProperty(t,z6,{value:n});var i={};s1t(t,n,i),a1t(e,t,n,i)}return n}function s1t(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 a1t(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 _Ce(e,t){if(!e)return null;var n=xCe(e,!1);return n&&n[t]||null}function c1t(e,t){var n=_Ce(e,t);n&&n.valueHasMutated()}function l1t(e){e.track=yCe,e.getObservable=_Ce,e.valueHasMutated=c1t,e.defineProperty=n1t}var sM={attachToKo:l1t};var B1o=_(T(),1),TCe="http://www.w3.org/2000/svg",SCe="cesium-svgPath-svg",d1t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(TCe,"svg:svg");i.setAttribute("class",SCe);let o=document.createElementNS(TCe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${SCe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},aM=d1t;sM.attachToKo(FS);aM.register(FS);var Te=FS;function cM(e){l(e)||(e=new Am),this._clock=e,this._eventHelper=new dr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Te.observable(q.now()),this.systemTime.equalityComparer=q.equals,this.startTime=Te.observable(e.startTime),this.startTime.equalityComparer=q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Te.observable(e.stopTime),this.stopTime.equalityComparer=q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Te.observable(e.currentTime),this.currentTime.equalityComparer=q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Te.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Te.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Te.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Te.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Te.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Te.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(cM.prototype,{clock:{get:function(){return this._clock}}});cM.prototype.synchronize=function(){let e=this._clock;this.systemTime=q.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};cM.prototype.isDestroyed=function(){return!1};cM.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var lM=cM;var nVo=_(T(),1);function u1t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,fe.throwInstantiationError()}var H6=u1t;var cVo=_(T(),1);function m1t(e,t){t=t??!0;let n=new be,i=new be;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Te.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Zn=m1t;var mVo=_(T(),1);var dM={};dM.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};dM.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};dM.createRangeInput=function(e,t,n,i,o,r){r=r??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(c),d};dM.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 ja=dM;var pVo=_(T(),1);function h1t(e,t,n,i,o){return n.call(i,e[t]),Te.getObservable(e,t).subscribe(n,i,o)}var Ea=h1t;var TVo=_(T(),1);function CCe(e,t){this._command=e,t=t??Y.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Te.track(this,["toggled","tooltip"])}Object.defineProperties(CCe.prototype,{command:{get:function(){return this._command}}});var Ky=CCe;var vVo=_(T(),1);var ZVo=_(T(),1);function VCe(e){e=e??Y.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??Y.EMPTY_ARRAY,i=e.terrainProviderViewModels??Y.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Te.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Te.getObservable(this,"imageryProviderViewModels"),r=Te.pureComputed(function(){let h=o(),p={},g;for(g=0;g<h.length;g++){let x=h[g],S=x.category;l(p[S])?p[S].push(x):p[S]=[x]}let f=Object.keys(p),y=[];for(g=0;g<f.length;g++){let x=f[g];y.push({name:x,providers:p[x]})}return y});this._imageryProviders=r;let s=Te.getObservable(this,"terrainProviderViewModels"),a=Te.pureComputed(function(){let h=s(),p={},g;for(g=0;g<h.length;g++){let x=h[g],S=x.category;l(p[S])?p[S].push(x):p[S]=[x]}let f=Object.keys(p),y=[];for(g=0;g<f.length;g++){let x=f[g];y.push({name:x,providers:p[x]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,Te.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,g=l(h)?h.name:void 0,f=l(p)?p.name:void 0;return l(g)&&l(f)?`${g}
|
|
|
${f}`:l(g)?g:f}),this.buttonImageUrl=void 0,Te.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(l(h))return h.iconUrl}),this.selectedImagery=void 0;let c=Te.observable();this.updateSelectedImageryViewModel=h=>{c(h),this.dropDownVisible=!1},this._currentImageryLayers=[],Te.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(h){if(c()===h){this.dropDownVisible=!1;return}let p=e.map,g,f=this._currentImageryLayers,y=f.length,x=this._globe.imageryLayers,S=!1;if(!p)for(g=0;g<y;g++){let C=x.length;for(let V=0;V<C;V++){let L=x.get(V);if(L===f[g]){x.remove(L),S=!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 C=h.creationCommand();if(Array.isArray(C)){let V=C.length;for(this._currentImageryLayers=[],g=V-1;g>=0;g--){let L=Ja.fromProviderAsync(C[g]);x.add(L,0),this._currentImageryLayers.push(L)}}else{this._currentImageryLayers=[];let V=Ja.fromProviderAsync(C);if(V.name=h.name,S)x.add(V,0);else{let L=x.get(0);l(L)&&x.remove(L),x.add(V,0)}this._currentImageryLayers.push(V)}}else p&&(p.basemap=void 0);c(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Te.observable();this.updateSelectedTerrainViewModel=h=>{d(h),this.dropDownVisible=!1},Te.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(h){if(d()===h){this.dropDownVisible=!1;return}let p;if(l(h)&&(p=h.creationCommand()),l(p)&&!l(p.then)){if(e.map&&h.marsOptions){e.map.terrainProvider=p;return}this._globe.terrainProvider=p}else if(l(p)){let g=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,f()}),x=new nM(p).readyEvent.addEventListener(S=>{if(!g){if(e.map&&h.marsOptions){e.map.terrainProvider=S;return}this._globe.terrainProvider=S,x()}})}d(h),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Zn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel,this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(VCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var uM=VCe;function g3(e,t){e=Pn(e);let n=new uM(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),c.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),c.appendChild(u);let h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),u.appendChild(h);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),h.appendChild(g);let f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",r.appendChild(f);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(y);let x=document.createElement("div");x.className="cesium-baseLayerPicker-category",y.appendChild(x);let S=document.createElement("div");S.className="cesium-baseLayerPicker-categoryTitle",S.setAttribute("data-bind","text: name"),x.appendChild(S);let C=document.createElement("div");C.className="cesium-baseLayerPicker-choices",C.setAttribute("data-bind","foreach: providers"),x.appendChild(C);let V=document.createElement("div");V.className="cesium-baseLayerPicker-item",V.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),C.appendChild(V);let L=document.createElement("img");L.className="cesium-baseLayerPicker-itemIcon",L.setAttribute("data-bind","attr: { src: iconUrl }"),L.setAttribute("draggable","false"),V.appendChild(L);let Z=document.createElement("div");Z.className="cesium-baseLayerPicker-itemLabel",Z.setAttribute("data-bind","text: name"),V.appendChild(Z),Te.applyBindings(n,i),Te.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(E){i.contains(E.target)||r.contains(E.target)||(n.dropDownVisible=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(g3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});g3.prototype.isDestroyed=function(){return!1};g3.prototype.destroy=function(){return Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._element),Te.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),me(this)};var mM=g3;var BVo=_(T(),1);var kVo=_(T(),1);function LCe(e){let t=e.creationFunction;l(t.canExecute)||(t=Zn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",this.marsOptions=e.marsOptions,Te.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(LCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ds=LCe;function f1t(){let e=[],t=devicePixelRatio>=2;return e.push(new ds({name:"Bing Maps Aerial",iconUrl:sn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return p0({style:f0.AERIAL})}})),e.push(new ds({name:"Bing Maps Aerial with Labels",iconUrl:sn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return p0({style:f0.AERIAL_WITH_LABELS})}})),e.push(new ds({name:"Bing Maps Roads",iconUrl:sn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return p0({style:f0.ROAD})}})),e.push(new ds({name:"ArcGIS World Imagery",iconUrl:sn("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 m0.fromBasemapType(Mh.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ds({name:"ArcGIS World Hillshade",iconUrl:sn("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 m0.fromBasemapType(Mh.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ds({name:"Esri World Ocean",iconUrl:sn("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 m0.fromBasemapType(Mh.OCEANS,{enablePickFeatures:!1})}})),e.push(new ds({name:"Open\xADStreet\xADMap",iconUrl:sn("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 G0({url:"https://tile.openstreetmap.org/"})}})),e.push(new ds({name:"Stadia x Stamen Watercolor",iconUrl:sn("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 G0({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 ds({name:"Stadia x Stamen Toner",iconUrl:sn("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 G0({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 ds({name:"Stadia Alidade Smooth",iconUrl:sn("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 G0({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 ds({name:"Stadia Alidade Smooth Dark",iconUrl:sn("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 G0({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 ds({name:"Sentinel-2",iconUrl:sn("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 h0.fromAssetId(3954)}})),e.push(new ds({name:"Blue Marble",iconUrl:sn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return h0.fromAssetId(3845)}})),e.push(new ds({name:"Earth at night",iconUrl:sn("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 h0.fromAssetId(3812)}})),e.push(new ds({name:"Natural Earth\xA0II",iconUrl:sn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
|
|
|
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return wy.fromUrl(sn("Assets/Textures/NaturalEarthII"))}})),e}var hM=f1t;var KVo=_(T(),1);function p1t(){let e=[];return e.push(new ds({name:"WGS84 Ellipsoid",iconUrl:sn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Bx({ellipsoid:ne.WGS84})}})),e.push(new ds({name:"Cesium World Terrain",iconUrl:sn("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 kx({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var fM=p1t;var cLo=_(T(),1);var eLo=_(T(),1);function b1t(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br> ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function K6(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var g1t=new yn,y1t=new m;function pM(e,t){let n=this,i=e.canvas,o=new Td(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="",Te.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=Zn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Zn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Zn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Zn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Te.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Te.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Te.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new g0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Zn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Te.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Zn(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new U9({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Te.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Zn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(d){return l(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?d.owner===n._primitive||d.owner===n._primitive._billboardCollection||d.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Te.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Te.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Te.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Zn(function(){let d=n.depthFrustum+1;return n.depthFrustum=K6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Zn(function(){let d=n.depthFrustum-1;return n.depthFrustum=K6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Te.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Zn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new oM({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Te.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Te.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Zn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Zn(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=Te.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(d){let u=n._scene.pick({x:d.position.x,y:d.position.y});l(u)&&(n.primitive=l(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Zn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Te.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,Tn.LEFT_CLICK):o.removeInputAction(Tn.LEFT_CLICK)});function c(d){let u,h=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,g1t),g=r.pick(p,n._scene,y1t);if(l(g)){let f=h.cartesianToCartographic(g),y=r._surface.tileProvider._tilesToRenderByTextureCount;for(let x=0;!u&&x<y.length;++x){let S=y[x];if(l(S))for(let C=0;!u&&C<S.length;++C){let V=S[C];le.contains(V.rectangle,f)&&(u=V)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Zn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Te.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,Tn.LEFT_CLICK):o.removeInputAction(Tn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(pM.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 Zn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Zn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Zn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Zn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Zn(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}}});pM.prototype._update=function(){this.frustums&&(this.frustumStatisticText=b1t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=K6(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}`};pM.prototype.isDestroyed=function(){return!1};pM.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(),me(this)};var bM=pM;function y3(e,t){e=Pn(e);let n=document.createElement("div"),i=new bM(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=ja.createSection,c=ja.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(h),d.appendChild(u),d.appendChild(c("Show Frustum Planes","frustumPlanes")),d.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(p);let g=document.createElement("div");d.appendChild(g);let f=document.createElement("span");f.setAttribute("data-bind",'html: " Frustum:"'),g.appendChild(f);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let x=document.createElement("input");x.type="button",x.value="-",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(x);let S=document.createElement("input");S.type="button",S.value="+",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(S);let C=a(s,"Primitives","primitivesVisible","togglePrimitives"),V=document.createElement("div");V.className="cesium-cesiumInspector-pickSection",C.appendChild(V);let L=document.createElement("input");L.type="button",L.value="Pick a primitive",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let Z=document.createElement("div");Z.className="cesium-cesiumInspector-center",Z.appendChild(L),V.appendChild(Z),V.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),V.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),V.appendChild(this._primitiveOnly);let E=a(s,"Terrain","terrainVisible","toggleTerrain"),P=document.createElement("div");P.className="cesium-cesiumInspector-pickSection",E.appendChild(P);let W=document.createElement("input");W.type="button",W.value="Pick a tile",W.className="cesium-cesiumInspector-pickButton",W.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),Z=document.createElement("div"),Z.appendChild(W),Z.className="cesium-cesiumInspector-center",P.appendChild(Z);let v=document.createElement("div");P.appendChild(v);let A=document.createElement("input");A.type="button",A.value="Parent",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: selectParent");let b=document.createElement("input");b.type="button",b.value="NW",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNW");let R=document.createElement("input");R.type="button",R.value="NE",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind","click: selectNE");let G=document.createElement("input");G.type="button",G.value="SW",G.className="cesium-cesiumInspector-pickButton",G.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let w=document.createElement("div");w.className="cesium-cesiumInspector-tileText",v.className="cesium-cesiumInspector-frustumStatistics",v.appendChild(w),v.setAttribute("data-bind","visible: hasPickedTile"),w.setAttribute("data-bind","html: tileText");let M=document.createElement("div");M.className="cesium-cesiumInspector-relativeText",M.textContent="Select relative:",v.appendChild(M);let O=document.createElement("table"),k=document.createElement("tr"),B=document.createElement("tr"),N=document.createElement("td");N.appendChild(A);let z=document.createElement("td");z.appendChild(b);let K=document.createElement("td");K.appendChild(R),k.appendChild(N),k.appendChild(z),k.appendChild(K);let te=document.createElement("td"),H=document.createElement("td");H.appendChild(G);let j=document.createElement("td");j.appendChild(I),B.appendChild(te),B.appendChild(H),B.appendChild(j),O.appendChild(k),O.appendChild(B),v.appendChild(O),P.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),P.appendChild(c("Show only selected","filterTile","hasPickedTile")),E.appendChild(c("Wireframe","wireframe")),E.appendChild(c("Suspend LOD update","suspendUpdates")),E.appendChild(c("Show tile coordinates","tileCoordinates")),Te.applyBindings(i,this._element)}Object.defineProperties(y3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});y3.prototype.isDestroyed=function(){return!1};y3.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var gM=y3;var hLo=_(T(),1);var AS="http://www.w3.org/2000/svg",GCe="http://www.w3.org/1999/xlink",x3,yM=D.fromCssColorString("rgba(247,250,255,0.384)"),_3=D.fromCssColorString("rgba(143,191,255,0.216)"),J6=D.fromCssColorString("rgba(153,197,255,0.098)"),T3=D.fromCssColorString("rgba(255,255,255,0.086)"),x1t=D.fromCssColorString("rgba(255,255,255,0.267)"),_1t=D.fromCssColorString("rgba(255,255,255,0)"),RCe=D.fromCssColorString("rgba(66,67,68,0.3)"),ZCe=D.fromCssColorString("rgba(0,0,0,0.5)");function Jy(e){return D.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var xM={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 Hh(e){let t=document.createElementNS(AS,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(Hh(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(GCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Q6(e,t,n){let i=document.createElementNS(AS,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(AS,"tspan");return o.textContent=n,i.appendChild(o),i}function T1t(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var S3=new D;function us(e,t){let n=t.alpha,i=1-n;return S3.red=e.red*i+t.red*n,S3.green=e.green*i+t.green*n,S3.blue=e.blue*i+t.blue*n,S3.toCssColorString()}function j6(e,t,n){let i=xM[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 Hh(o)}function S1t(e,t,n){let i=xM[n],o=xM.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 Hh(r)}function C1t(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&x3!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,d;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,d=t.touches[0].clientY):(c=t.clientX,d=t.clientY),!i&&(c>a.right||c<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),h=c-o-a.left,p=d-r-a.top,g=Math.atan2(p,h)*180/Math.PI+90;g>180&&(g-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(x3=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<f?n.slower():g>f&&n.faster(),t.preventDefault()}else e===x3&&(x3=void 0),n.shuttleRingDragging=!1}function E0(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=[Ea(t,"toggled",this.setToggled,this),Ea(t,"tooltip",this.setTooltip,this),Ea(t.command,"canExecute",this.setEnabled,this)]}E0.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();me(this)};E0.prototype.isDestroyed=function(){return!1};E0.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")}};E0.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")))};E0.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function HL(e,t){e=Pn(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(AS,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",GCe);let s=document.createElementNS(AS,"g");this._topG=s,this._realtimeSVG=new E0(S1t(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new E0(j6(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new E0(j6(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new E0(j6(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(AS,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Hh({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let d=xM.animation_pathSwooshFX,u=xM.animation_pathPointer,h=Hh({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:d.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:d.d},{tagName:d.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:d.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=Hh({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=Hh({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Hh({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,f=Hh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=Q6(0,-24,""),this._knobTime=Q6(0,-7,""),this._knobStatus=Q6(0,-41,"");let y=Hh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),x=document.createElementNS(AS,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(h),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(y),r.appendChild(s),e.appendChild(r);let S=this;function C(P){C1t(S,P)}this._mouseCallback=C,c.addEventListener("mousedown",C,!0),c.addEventListener("touchstart",C,!0),h.addEventListener("mousedown",C,!0),h.addEventListener("touchstart",C,!0),n.addEventListener("mousemove",C,!0),n.addEventListener("touchmove",C,!0),n.addEventListener("mouseup",C,!0),n.addEventListener("touchend",C,!0),n.addEventListener("touchcancel",C,!0),this._shuttleRingPointer.addEventListener("mousedown",C,!0),this._shuttleRingPointer.addEventListener("touchstart",C,!0),this._knobOuter.addEventListener("mousedown",C,!0),this._knobOuter.addEventListener("touchstart",C,!0);let V=this._knobTime.childNodes[0],L=this._knobDate.childNodes[0],Z=this._knobStatus.childNodes[0],E;this._subscriptions=[Ea(t.pauseViewModel,"toggled",function(P){E!==P&&(E=P,E?S._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):S._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Ea(t,"shuttleRingAngle",function(P){T1t(S._shuttleRingPointer,S._knobOuter,P)}),Ea(t,"dateLabel",function(P){L.textContent!==P&&(L.textContent=P)}),Ea(t,"timeLabel",function(P){V.textContent!==P&&(V.textContent=P)}),Ea(t,"multiplierLabel",function(P){Z.textContent!==P&&(Z.textContent=P)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(HL.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});HL.prototype.isDestroyed=function(){return!1};HL.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 me(this)};HL.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};HL.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=Jy(this._themeNormal),n=Jy(this._themeHover),i=Jy(this._themeSelect),o=Jy(this._themeDisabled),r=Jy(this._themeKnob),s=Jy(this._themePointer),a=Jy(this._themeSwoosh),c=Jy(this._themeSwooshHover),d=Hh({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":us(t,yM)},{tagName:"stop",offset:"12%","stop-color":us(t,_3)},{tagName:"stop",offset:"46%","stop-color":us(t,J6)},{tagName:"stop",offset:"81%","stop-color":us(t,T3)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":us(n,yM)},{tagName:"stop",offset:"12%","stop-color":us(n,_3)},{tagName:"stop",offset:"46%","stop-color":us(n,J6)},{tagName:"stop",offset:"81%","stop-color":us(n,T3)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":us(i,yM)},{tagName:"stop",offset:"12%","stop-color":us(i,_3)},{tagName:"stop",offset:"46%","stop-color":us(i,J6)},{tagName:"stop",offset:"81%","stop-color":us(i,T3)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":us(o,x1t)},{tagName:"stop",offset:"75%","stop-color":us(o,_1t)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":us(s,ZCe)},{tagName:"stop",offset:"100%","stop-color":us(s,ZCe)}]},{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":us(r,yM)},{tagName:"stop",offset:"60%","stop-color":us(r,RCe)},{tagName:"stop",offset:"85%","stop-color":us(r,_3)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":us(r,RCe)},{tagName:"stop",offset:"60%","stop-color":us(r,yM)},{tagName:"stop",offset:"85%","stop-color":us(r,T3)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var _M=HL;var TLo=_(T(),1);var V1t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Qy=15,KL=105;function ECe(e,t){return e-t}function q6(e,t){let n=Wo(t,e,ECe);return n<0?~n:n}function L1t(e,t){if(Math.abs(e)<=Qy)return e/Qy;let n=Qy,i=KL,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function R1t(e,t,n){if(n.clockStep===yo.SYSTEM_CLOCK)return Qy;if(Math.abs(e)<=1)return e*Qy;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=Qy,r=KL,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function gm(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=gm.defaultDateFormatter,this._timeFormatter=gm.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Te.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(gm.defaultTicks),this.timeLabel=void 0,Te.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Te.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Te.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===yo.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Te.defineProperty(this,"shuttleRingAngle",{get:function(){return R1t(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,KL),-KL);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===KL){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=L1t(s,a);if(t.snapToTicks)d=a[q6(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let h=u.toFixed(0).length-2,p=Math.pow(10,h);d=Math.round(d/p)*p|0}else u>Qy?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,Te.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Mr.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,h=!1;if(a===Mr.LOOP_STOP)h=q.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;h=q.greaterThan(d,u)&&q.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,Te.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Mr.UNBOUNDED)return!0;let c=s.systemTime;return q.greaterThanOrEquals(c,s.startTime)&&q.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Te.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Zn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Ky(n,{toggled:Te.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Zn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Ky(i,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Zn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Ky(o,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==yo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Zn(function(){t._clockViewModel.clockStep=yo.SYSTEM_CLOCK},Te.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Ky(r,{toggled:Te.computed(function(){return e.clockStep===yo.SYSTEM_CLOCK}),tooltip:Te.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Zn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=q6(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Zn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=q6(c,a)+1;d<a.length&&(s.multiplier=a[d])})}gm.defaultDateFormatter=function(e,t){let n=q.toGregorianDate(e);return`${V1t[n.month-1]} ${n.day} ${n.year}`};gm.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];gm.defaultTimeFormatter=function(e,t){let n=q.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`};gm.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};gm.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(ECe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(gm.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}}});gm._maxShuttleRingAngle=KL;gm._realtimeShuttleRingAngle=Qy;var TM=gm;var PLo=_(T(),1);var RLo=_(T(),1);function Z1t(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Ts&&(e.tileset=n.primitive),e.pickActive=!1}}function XCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Ts&&(e.tileset=i.primitive)},Tn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Tn.MOUSE_MOVE),e.picking=e.picking)}var G1t={maximumFractionDigits:3};function SM(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,G1t):Math.round(t).toLocaleString()}function CM(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Fo.PICK]:e._statisticsPerPass[Fo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${SM(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${SM(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${SM(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function WCe(){let e=Li.statistics;return`
|
|
|
<ul class="cesium-cesiumInspector-statistics">
|
|
|
<li><strong>Geometry Memory (MB): </strong>${SM(e.geometryByteLength)}</li>
|
|
|
<li><strong>Texture Memory (MB): </strong>${SM(e.texturesByteLength)}</li>
|
|
|
</ul>
|
|
|
`}var E1t=[{text:"Highlight",value:Al.HIGHLIGHT},{text:"Replace",value:Al.REPLACE},{text:"Mix",value:Al.MIX}],ICe=new D(1,1,0,.4),I1t=new D,C3=new D;function Ia(e,t){let n=this,i=e.canvas;this._eventHandler=new Td(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new g0({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,Te.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=Te.observable({}),this.properties=[],Te.defineProperty(this,"properties",function(){let N=[],z=n._properties();for(let K in z)z.hasOwnProperty(K)&&N.push(K);return N});let o=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(N){o(N),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=N)}}),this.dynamicScreenSpaceError=!1;let r=Te.observable();Te.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(N){r(N),l(n._tileset)&&(n._tileset.colorBlendMode=N,n._scene.requestRender())}}),this.colorBlendMode=Al.HIGHLIGHT;let s=Te.observable(),a=Te.observable();Te.defineProperty(this,"picking",{get:function(){return a()},set:function(N){a(N),N?n._eventHandler.setInputAction(function(z){let K=e.pick(z.endPosition);if(K instanceof js?(n.feature=K,n.tile=K.content.tile):l(K)&&l(K.content)?(n.feature=void 0,n.tile=K.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(K)&&l(K.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(z.endPosition),l(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=K.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Tn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Tn.MOUSE_MOVE))}}),this.picking=!0;let c=Te.observable();Te.defineProperty(this,"colorize",{get:function(){return c()},set:function(N){c(N),l(n._tileset)&&(n._tileset.debugColorizeTiles=N,n._scene.requestRender())}}),this.colorize=!1;let d=Te.observable();Te.defineProperty(this,"wireframe",{get:function(){return d()},set:function(N){d(N),l(n._tileset)&&(n._tileset.debugWireframe=N,n._scene.requestRender())}}),this.wireframe=!1;let u=Te.observable();Te.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(N){u(N),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=N,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=Te.observable();Te.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(N){h(N),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=N,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Te.observable();Te.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(N){p(N),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=N,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Te.observable();Te.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(N){g(N),l(n._tileset)&&(n._tileset.debugFreezeFrame=N,n._scene.debugShowFrustumPlanes=N,n._scene.requestRender())}}),this.freezeFrame=!1,Te.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(N){s(N),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=N,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Te.observable();Te.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(N){f(N),l(n._tileset)&&(n._tileset.debugShowGeometricError=N,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Te.observable();Te.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(N){y(N),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=N,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let x=Te.observable();Te.defineProperty(this,"showMemoryUsage",{get:function(){return x()},set:function(N){x(N),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=N,n._scene.requestRender())}}),this.showMemoryUsage=!1;let S=Te.observable();Te.defineProperty(this,"showUrl",{get:function(){return S()},set:function(N){S(N),l(n._tileset)&&(n._tileset.debugShowUrl=N,n._scene.requestRender())}}),this.showUrl=!1;let C=Te.observable();Te.defineProperty(this,"maximumScreenSpaceError",{get:function(){return C()},set:function(N){N=Number(N),isNaN(N)||(C(N),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=N))}}),this.maximumScreenSpaceError=16;let V=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return V()},set:function(N){N=Number(N),isNaN(N)||(V(N),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=N))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Te.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(V(),1/6)},set:function(N){let z=Math.pow(N,6);V(z),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=z)}});let L=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return L()},set:function(N){N=Number(N),isNaN(N)||(L(N),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=N))}}),this.dynamicScreenSpaceErrorFactor=24;let Z=Z1t(this),E=Te.observable();Te.defineProperty(this,"pickActive",{get:function(){return E()},set:function(N){E(N),N?n._eventHandler.setInputAction(Z,Tn.LEFT_CLICK):n._eventHandler.removeInputAction(Tn.LEFT_CLICK)}});let P=Te.observable();Te.defineProperty(this,"pointCloudShading",{get:function(){return P()},set:function(N){P(N),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=N)}}),this.pointCloudShading=!1;let W=Te.observable();Te.defineProperty(this,"geometricErrorScale",{get:function(){return W()},set:function(N){N=Number(N),isNaN(N)||(W(N),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=N))}}),this.geometricErrorScale=1;let v=Te.observable();Te.defineProperty(this,"maximumAttenuation",{get:function(){return v()},set:function(N){N=Number(N),isNaN(N)||(v(N),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=N===0?void 0:N))}}),this.maximumAttenuation=0;let A=Te.observable();Te.defineProperty(this,"baseResolution",{get:function(){return A()},set:function(N){N=Number(N),isNaN(N)||(A(N),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=N===0?void 0:N))}}),this.baseResolution=0;let b=Te.observable();Te.defineProperty(this,"eyeDomeLighting",{get:function(){return b()},set:function(N){b(N),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=N)}}),this.eyeDomeLighting=!1;let R=Te.observable();Te.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return R()},set:function(N){N=Number(N),isNaN(N)||(R(N),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=N))}}),this.eyeDomeLightingStrength=1;let G=Te.observable();Te.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return G()},set:function(N){N=Number(N),isNaN(N)||(G(N),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=N))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Te.observable();Te.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(N){I(N),l(n._tileset)&&(n._tileset.skipLevelOfDetail=N)}}),this.skipLevelOfDetail=!0;let w=Te.observable();Te.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return w()},set:function(N){N=Number(N),isNaN(N)||(w(N),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=N))}}),this.skipScreenSpaceErrorFactor=16;let M=Te.observable();Te.defineProperty(this,"baseScreenSpaceError",{get:function(){return M()},set:function(N){N=Number(N),isNaN(N)||(M(N),l(n._tileset)&&(n._tileset.baseScreenSpaceError=N))}}),this.baseScreenSpaceError=1024;let O=Te.observable();Te.defineProperty(this,"skipLevels",{get:function(){return O()},set:function(N){N=Number(N),isNaN(N)||(O(N),l(n._tileset)&&(n._tileset.skipLevels=N))}}),this.skipLevels=1;let k=Te.observable();Te.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(N){k(N),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=N)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let B=Te.observable();Te.defineProperty(this,"loadSiblings",{get:function(){return B()},set:function(N){B(N),l(n._tileset)&&(n._tileset.loadSiblings=N)}}),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)||XCe(this,!0)}Object.defineProperties(Ia.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 E1t}},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=CM(e,!1),this._pickStatisticsText=CM(e,!0),this._resourceCacheStatisticsText=WCe(),XCe(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,I1t):D.WHITE:t.color=C3,this._scene.requestRender()),l(e)&&(D.clone(e.color,C3),e.color=ICe,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()&&!$6(t.content)&&(t.color=C3,this._scene.requestRender()),l(e)&&!$6(e.content)&&(D.clone(e.color,C3),e.color=ICe,this._scene.requestRender()),this._tile=e}}});function $6(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(!$6(t[i]))return!1;return!0}return!1}Ia.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Ia.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Ia.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Ia.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Ia.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Ia.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Ia.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Ia.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Ia.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Ia.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Ia.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 ES(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Ia.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
|
|
|
`),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(`
|
|
|
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};Ia.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=CM(e,!1),this._pickStatisticsText=CM(e,!0),this._resourceCacheStatisticsText=WCe())};Ia.prototype.isDestroyed=function(){return!1};Ia.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),me(this)};Ia.getStatistics=CM;var VM=Ia;function V3(e,t){e=Pn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new VM(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=ja.createSection,c=ja.createCheckbox,d=ja.createRangeInput,u=ja.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),x=a(s,"Style","styleVisible","toggleStyle"),S=a(s,"Optimization","optimizationVisible","toggleOptimization"),C=document.createElement("div");C.className="field-group";let V=document.createElement("label");V.className="field-label",V.appendChild(document.createTextNode("Properties: "));let L=document.createElement("div");L.setAttribute("data-bind","text: properties"),C.appendChild(V),C.appendChild(L),h.appendChild(C),h.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(u("Trim Tiles Cache","trimTilesCache")),h.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let Z=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),E=document.createElement("p");E.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),E.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),E.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",Z.appendChild(E),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 P=document.createElement("div");P.setAttribute("data-bind","visible: pointCloudShading"),P.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),P.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),P.appendChild(d("Base Resolution","baseResolution",0,1,.01)),P.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(P);let W=document.createElement("div");W.setAttribute("data-bind","visible: eyeDomeLighting"),W.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),W.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),P.appendChild(W),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let v=document.createElement("div");v.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(v);let A=document.createElement("div");A.setAttribute("data-bind","visible: dynamicScreenSpaceError"),A.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),A.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(A),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(b),f.appendChild(c("Pick Statistics","showPickStatistics"));let R=document.createElement("div");R.className="cesium-3dTilesInspector-statistics",R.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(R),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let G=document.createElement("div");G.className="cesium-3dTilesInspector-statistics",G.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(G);let I=document.createElement("div");x.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let w=document.createElement("select");w.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(w);let M=document.createElement("textarea");M.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(M);let O=u("Compile (Ctrl+Enter)","compileStyle");I.appendChild(O);let k=document.createElement("div");k.className="cesium-cesiumInspector-error",k.setAttribute("data-bind","text: editorError"),I.appendChild(k),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),S.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let B=document.createElement("div");B.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),S.appendChild(B);let N=document.createElement("div");N.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),S.appendChild(N);let z=document.createElement("div");z.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),S.appendChild(z),S.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),S.appendChild(c("Load siblings of visible tiles","loadSiblings")),Te.applyBindings(o,n)}Object.defineProperties(V3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});V3.prototype.isDestroyed=function(){return!1};V3.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var LM=V3;var zLo=_(T(),1);var NLo=_(T(),1);function L3(e,t){l(t)||(t=document.body),t=Pn(t);let n=this,i=Te.observable(Sr.fullscreen),o=Te.observable(Sr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Te.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Te.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&Sr.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Zn(function(){Sr.fullscreen?Sr.exitFullscreen():Sr.requestFullscreen(n._fullscreenElement)},Te.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Pn(e)??r.body,this._callback=function(){i(Sr.fullscreen)},r.addEventListener(Sr.changeEventName,this._callback)}Object.defineProperties(L3.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});L3.prototype.isDestroyed=function(){return!1};L3.prototype.destroy=function(){document.removeEventListener(Sr.changeEventName,this._callback),me(this)};var RM=L3;var X1t="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",W1t="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 R3(e,t){e=Pn(e);let n=new RM(t,e);n._exitFullScreenPath=W1t,n._enterFullScreenPath=X1t;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),Te.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(R3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});R3.prototype.isDestroyed=function(){return!1};R3.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var ZM=R3;var rRo=_(T(),1);var qLo=_(T(),1);var PCe=1e3;function ym(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new Qx({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 be,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=wCe,this._handleArrowUp=vCe;let t=this;this._suggestionsVisible=Te.pureComputed(function(){let o=Te.getObservable(t,"_suggestions")().length>0,r=Te.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Zn(function(i){if(i=i??dg.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)M1t(t);else return F1t(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?vCe(t):r?wCe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;MCe(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??ym.flyToDestination,this._focusTextbox=!1,Te.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Te.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){ym._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Te.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Te.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Te.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(ym.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}}});ym.prototype.destroy=function(){this._suggestionSubscription.dispose()};function vCe(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],ym._adjustSuggestionsScroll(e,n)}function wCe(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],ym._adjustSuggestionsScroll(e,i)}function P1t(e,t){let n=l(t)?t.availability:void 0;return l(n)?c_(t,[e]).then(function(i){return e=i[0],e.height+=PCe,e}):(e.height+=PCe,Promise.resolve(e))}function v1t(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof le?X.equalsEpsilon(t.south,t.north,X.EPSILON7)&&X.equalsEpsilon(t.east,t.west,X.EPSILON7)?t=le.center(t):a=QT(t,n):t=i.cartesianToCartographic(t),l(a)||(a=P1t(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function w1t(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 F1t(e,t,n){let i=e._searchText;if(ACe(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 w1t(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,tq(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=FCe(e,NC.getCreditsFromResult(s[0]));l(a)||eq(e,t[o].credit);return}e._searchText=`${i} (not found)`}function eq(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function FCe(e,t){return l(t)&&t.forEach(n=>eq(e,n)),t}function tq(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function A1t(e,t){let n=Pn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function M1t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function ACe(e){return/^\s*$/.test(e)}function MCe(e){Te.getObservable(e,"_suggestions").removeAll()}async function N1t(e){if(!e.autoComplete)return;let t=e._searchText;if(MCe(e),tq(e),!ACe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,dg.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=NC.getCreditsFromResult(r);o=o&&!l(s),FCe(e,s)}),o&&eq(e,n.credit)}if(e._suggestions.length>=5)return}}ym.flyToDestination=v1t;ym._updateSearchSuggestions=N1t;ym._adjustSuggestionsScroll=A1t;ym.prototype.isDestroyed=function(){return!1};ym.prototype.destroy=function(){return tq(this),me(this)};var GM=ym;var k1t="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",U1t="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 Z3(e){let t=Pn(e.container),n=new GM(e);n._startSearchPath=k1t,n._stopSearchPath=U1t;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Te.applyBindings(n,i),Te.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(d){let u=d.target;typeof d.composedPath=="function"&&(u=d.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(d){n._focusTextbox=!0,n.showSuggestions()},Ht.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(Z3.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});Z3.prototype.isDestroyed=function(){return!1};Z3.prototype.destroy=function(){let e=this._container;return Ht.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(),Te.cleanNode(this._form),Te.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),me(this)};var EM=Z3;var pRo=_(T(),1);var lRo=_(T(),1);function D1t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function kCe(e,t){Te.track(e);for(let n=0;n<e.sublayers.length;n++)kCe(e.sublayers[n],t)}function G3(e){return e.modelName==="FullModel"}function UCe(e){return e.modelName==="Overview"}function DCe(e){return UCe(e)||G3(e)}function NCe(e,t){if(DCe(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:Te.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function O1t(e,t){if(DCe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");G3(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function B1t(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 Y1t(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Te.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Te.observable(!0),index:-1}],currentLayer:Te.observable(),expandClickHandler:D1t,setOptionDisable:function(i,o){Te.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){O1t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){kCe(n[i],this.viewModel);let o=NCe(n[i],this.viewModel);l(o)&&(UCe(o)||!l(this.viewModel.defaultLayer)&&G3(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=NCe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=G3(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return B1t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var IM=Y1t;function z1t(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 IM(t);Te.track(o),Te.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var nq=z1t;var RRo=_(T(),1);var xRo=_(T(),1);function OCe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Zn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Te.track(this,["tooltip"])}Object.defineProperties(OCe.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 XM=OCe;function E3(e,t,n){e=Pn(e);let i=new XM(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),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(E3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});E3.prototype.isDestroyed=function(){return!1};E3.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var WM=E3;var ARo=_(T(),1);var IRo=_(T(),1);function BCe(){this.showInstructions=!1;let e=this;this._command=Zn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Zn(function(){e._touch=!1}),this._showTouch=Zn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Te.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(BCe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var PM=BCe;function I3(e){let t=Pn(e.container),n=new PM,i=e.instructionsInitiallyVisible??!1;n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=sn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=sn("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",d.appendChild(u),d.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(d);let h=document.createElement("div");h.className="cesium-click-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),h.innerHTML=` <table> <tr> <td><img src="${sn("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="${sn("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="${sn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(h);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${sn("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="${sn("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="${sn("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="${sn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Te.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(I3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});I3.prototype.isDestroyed=function(){return!1};I3.prototype.destroy=function(){return Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var vM=I3;var jRo=_(T(),1);var BRo=_(T(),1);function iq(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,Te.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Zn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=B9.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(iq.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});iq.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),me(this)};var wM=iq;function X3(e){let t=Pn(e.container),n=new wM(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),Te.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(X3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});X3.prototype.isDestroyed=function(){return!1};X3.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var FM=X3;var uZo=_(T(),1);var oZo=_(T(),1);function W3(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new dr,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",Te.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Te.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Zn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Zn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Zn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Zn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(W3.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}}});W3.prototype.isDestroyed=function(){return!1};W3.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var AM=W3;var H1t="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",K1t="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",J1t="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 P3(e,t,n){e=Pn(e);let i=new AM(t,n);i._globePath=H1t,i._flatMapPath=K1t,i._columbusViewPath=J1t;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Te.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(P3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});P3.prototype.isDestroyed=function(){return!1};P3.prototype.destroy=function(){return this._viewModel.destroy(),Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var MM=P3;var SZo=_(T(),1);var pZo=_(T(),1);var Q1t="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",j1t="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 oq(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Te.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,Te.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?j1t:Q1t}}),Te.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}oq.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(oq.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var NM=oq;function v3(e){e=Pn(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 s=new NM;Te.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,d=c.createElement("link");d.href=sn("Widgets/InfoBox/InfoBoxDescription.css"),d.rel="stylesheet",d.type="text/css";let u=c.createElement("div");u.className="cesium-infoBox-description",c.head.appendChild(d),c.body.appendChild(u),a._descriptionSubscription=Ea(s,"description",function(h){r.style.height="5px",u.innerHTML=h;let p=null,g=u.firstElementChild;if(g!==null&&u.childNodes.length===1){let y=window.getComputedStyle(g);if(y!==null){let x=y["background-color"],S=D.fromCssColorString(x);l(S)&&S.alpha!==0&&(p=y["background-color"])}}t.style["background-color"]=p;let f=u.getBoundingClientRect().height;r.style.height=`${f}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(v3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});v3.prototype.isDestroyed=function(){return!1};v3.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),me(this)};var kM=v3;var wZo=_(T(),1);var GZo=_(T(),1);function w3(e){this._scene=e,this._orthographic=e.camera.frustum instanceof un,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Te.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Te.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Zn(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new dr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof un}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Zn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Zn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(w3.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}}});w3.prototype.isDestroyed=function(){return!1};w3.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var UM=w3;var q1t="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",$1t="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 F3(e,t){e=Pn(e);let n=new UM(t);n._perspectivePath=q1t,n._orthographicPath=$1t;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Te.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(F3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});F3.prototype.isDestroyed=function(){return!1};F3.prototype.destroy=function(){return this._viewModel.destroy(),Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var DM=F3;var HZo=_(T(),1);var kZo=_(T(),1);var eVt=new U,A3="-1000px";function OM(e,t,n){this._scene=e,this._screenPositionX=A3,this._screenPositionY=A3,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Te.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Te.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Te.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Oi.worldToWindowCoordinates(e,i,o)}}OM.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,eVt);if(!l(e))this._screenPositionX=A3,this._screenPositionY=A3;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`}}};OM.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:kr.EXPONENTIAL_OUT})};OM.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:kr.EXPONENTIAL_OUT})};Object.defineProperties(OM.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var BM=OM;function M3(e,t){e=Pn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new BM(t,this._element,this._container);this._viewModel=c,Te.applyBindings(this._viewModel,this._element)}Object.defineProperties(M3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});M3.prototype.isDestroyed=function(){return!1};M3.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),me(this)};var YM=M3;var rGo=_(T(),1);var QZo=_(T(),1);function MS(e,t,n){this._color=e,this._height=t,this._base=n??0}MS.prototype.getHeight=function(){return this._height};MS.prototype.getBase=function(){return this._base};MS.prototype.getStartTime=function(){return this._start};MS.prototype.getStopTime=function(){return this._stop};MS.prototype.setRange=function(e,t){this._start=e,this._stop=t};MS.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=q.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=q.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 zM=MS;var $Zo=_(T(),1);function YCe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new D(.5,.5,.5,1),this.backgroundColor=i||new D(0,0,0,0)}YCe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=q.addSeconds(t.startJulian,t.duration,new q);if(q.lessThan(n,o)&&q.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(q.lessThanOrEquals(n,r)&&q.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let d=q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new q);!l(a)&&q.greaterThanOrEquals(d,n)?a=s:!l(c)&&q.greaterThanOrEquals(d,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var HM=YCe;var rq=1e12,xm={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},xl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},jy=[.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],tVt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _l(e,t){e=Pn(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=xm.none,this._touchMode=xl.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=nVt(this),this._onMouseUp=iVt(this),this._onMouseMove=oVt(this),this._onMouseWheel=rVt(this),this._onTouchStart=sVt(this),this._onTouchMove=cVt(this),this._onTouchEnd=aVt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}_l.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};_l.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};_l.prototype.isDestroyed=function(){return!1};_l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),me(this)};_l.prototype.addHighlightRange=function(e,t,n){let i=new zM(e,t,n);return this._highlightRanges.push(i),this.resize(),i};_l.prototype.addTrack=function(e,t,n,i){let o=new HM(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};_l.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Mr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=q.secondsDifference(o,i),s=q.secondsDifference(i,this._startJulian),a=q.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=q.addSeconds(this._endJulian,s,new q),this._startJulian=i,this._timeBarSecondsSpan=q.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=q.addSeconds(this._startJulian,a,new q),this._endJulian=o,this._timeBarSecondsSpan=q.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};_l.prototype.zoomFrom=function(e){let t=q.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(q.addSeconds(this._startJulian,t-t*e,new q),q.addSeconds(this._endJulian,n*e-n,new q))};function sq(e){return e<10?`0${e.toString()}`:e.toString()}_l.prototype.makeLabel=function(e){let t=q.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`${tVt[t.month-1]} ${t.day} ${t.year} ${sq(t.hour)}:${sq(t.minute)}:${sq(t.second)}${i}`};_l.prototype.smallestTicInPixels=7;_l.prototype._makeTics=function(){let e=this._timeBarEle,t=q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,d=1e-10,u=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=q.addSeconds(this._startJulian,a,new q)):h>c&&(h=c,this._timeBarSecondsSpan=c,this._endJulian=q.addSeconds(this._startJulian,c,new q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,f=Math.min(h/p*1e-5,.4),y,x=q.toGregorianDate(g);h>31536e4?y=q.fromDate(new Date(Date.UTC(Math.floor(x.year/100)*100,0))):h>31536e3?y=q.fromDate(new Date(Date.UTC(Math.floor(x.year/10)*10,0))):h>86400?y=q.fromDate(new Date(Date.UTC(x.year,0))):y=q.fromDate(new Date(Date.UTC(x.year,x.month,x.day)));let S=q.secondsDifference(this._startJulian,q.addSeconds(y,f,new q)),C=S+h;this._epochJulian=y;function V(N){return Math.floor(S/N)*N}function L(N,z){return Math.ceil(N/z+.5)*z}function Z(N){return(N-S)/h}function E(N,z){return N-z*Math.round(N/z)}this._rulerEle.innerHTML=this.makeLabel(q.addSeconds(this._endJulian,-a,new q));let P=this._rulerEle.offsetWidth+20;P<30&&(P=180);let W=u;u-=d;let v={startTime:S,startJulian:g,epochJulian:y,duration:h,timeBarWidth:p,getAlpha:Z};this._highlightRanges.forEach(function(N){s+=N.render(v)});let A=0,b=0,R=0,G=P/p;G>1&&(G=1),G*=this._timeBarSecondsSpan;let I=-1,w=-1,M=jy.length,O;for(O=0;O<M;++O){let N=jy[O];if(++I,A=N,N>G&&N>u)break;w<0&&p*(N/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(w=I)}if(I>0){for(;I>0;)if(--I,Math.abs(E(A,jy[I]))<1e-5){jy[I]>=u&&(b=jy[I]);break}if(w>=0)for(;w<I;){if(Math.abs(E(b,jy[w]))<1e-5&&jy[w]>=u){R=jy[w];break}++w}}u=W,u>d&&R<1e-5&&Math.abs(u-A)>d&&(R=u,u<=A+d&&(b=0));let k=-999999,B;if(p*(R/this._timeBarSecondsSpan)>=3)for(o=V(R);o<=C;o=L(o,R))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*Z(o)).toString()}px;"></span>`;if(p*(b/this._timeBarSecondsSpan)>=3)for(o=V(b);o<=C;o=L(o,b))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*Z(o)).toString()}px;"></span>`;if(p*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,C+=A,o=V(A);let N=q.computeTaiMinusUtc(y);for(;o<=C;){let z=q.addSeconds(g,o-S,new q);if(A>2.1){let j=q.computeTaiMinusUtc(z);Math.abs(j-N)>.1&&(o+=j-N,z=q.addSeconds(g,o-S,new q))}let K=Math.round(p*Z(o)),te=this.makeLabel(z);this._rulerEle.innerHTML=te,B=this._rulerEle.offsetWidth,B<10&&(B=P);let H=K-(B/2-1);H>k?(k=H+B+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${K.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${H.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${K.toString()}px;"></span>`,o=L(o,A)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),v.y=0,this._trackList.forEach(function(N){N.render(r._context,v),v.y+=N.height})};_l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=q.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(q.addSeconds(this._startJulian,this._timelineDrag,new q),q.addSeconds(this._endJulian,this._timelineDrag,new q)))};_l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=q.addSeconds(this._startJulian,t,new q),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 nVt(e){return function(t){e._mouseMode!==xm.touchOnly&&(t.button===0?(e._mouseMode=xm.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=xm.zoom:e._mouseMode=xm.slide)),t.preventDefault()}}function iVt(e){return function(t){e._mouseMode=xm.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function oVt(e){return function(t){let n;if(e._mouseMode===xm.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===xm.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(q.addSeconds(e._startJulian,i,new q),q.addSeconds(e._endJulian,i,new q))}}else e._mouseMode===xm.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function rVt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;rq=Math.max(Math.min(Math.abs(n),rq),1),n/=rq,e.zoomFrom(Math.pow(1.05,-n))}}function sVt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=xm.touchOnly,n===1?(i=q.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=xl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=xl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=xl.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=xl.ignore}}function aVt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===xl.singleTap?(e._touchMode=xl.scrub,e._onTouchMove(t)):e._touchMode===xl.scrub&&e._onTouchMove(t),e._mouseMode=xm.touchOnly,n!==1?e._touchMode=n>0?xl.ignore:xl.none:e._touchMode===xl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function cVt(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===xl.singleTap&&(e._touchMode=xl.slideZoom),e._mouseMode=xm.touchOnly,e._touchMode===xl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-d,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===xl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-d,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-d,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new q)):(n=e._touchState.centerX-r,a=q.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new q)),e.zoomTo(a,q.addSeconds(a,e._timeBarSecondsSpan*c,new q)),e._touchState.centerX=r,e._touchState.spanX=s))}}_l.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var KM=_l;var OGo=_(T(),1);var SGo=_(T(),1);var pGo=_(T(),1);var QCe=_(JCe(),1);function uVt(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 jCe(){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 mVt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(jCe(),e._locked=!1),e._noSleep.disable(),Sr.exitFullscreen(),n(!1)):(Sr.fullscreen||Sr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=uVt("landscape")),t.useWebVR=!0,n(!0)))}function N3(e,t){let n=this,i=Te.observable(Sr.enabled),o=Te.observable(!1);this.isVRMode=void 0,Te.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Te.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Sr.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Te.observable(!1);this._isOrthographic=void 0,Te.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new dr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof un)}),this._locked=!1,this._noSleep=new QCe.default,this._command=Zn(function(){mVt(n,e,o,r)},Te.getObservable(this,"isVREnabled")),this._vrElement=Pn(t)??document.body,this._callback=function(){!Sr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(jCe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Sr.changeEventName,this._callback)}Object.defineProperties(N3.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});N3.prototype.isDestroyed=function(){return!1};N3.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Sr.changeEventName,this._callback),me(this)};var JM=N3;var hVt="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",fVt="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 k3(e,t,n){e=Pn(e);let i=new JM(t,n);i._exitVRPath=fVt,i._enterVRPath=hVt;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),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(k3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});k3.prototype.isDestroyed=function(){return!1};k3.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var QM=k3;var qCe=new de;function t1e(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function pVt(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 bVt(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 $Ce(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof er)return i;if(n instanceof js)return new er({name:bVt(n),description:pVt(n),feature:n})}if(l(e.scene.globe))return xVt(e,t.position)}var gVt=new q;function dq(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;q.equals(i,o)&&(o=q.addSeconds(i,X.EPSILON2,gVt)),e.updateFromClock(),e.zoomTo(i,o)}}}var yVt=new m;function xVt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new er({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=e1e();return}let a=s[0],c=new er({id:a.name,description:a.description});if(l(a.position)){let d=e.scene.ellipsoid.cartographicToCartesian(a.position,yVt);c.position=new el(d)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=e1e())}),r}function e1e(){return new er({id:"None",description:"No features found."})}function _Vt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,d=e._fullscreenButton,u=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),l(u)&&(u.container.style.visibility=p),l(h)&&(h.container.style.visibility=p),e._container){let g=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function eo(e,t){e=Pn(e),t=t??Y.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=t.scene3DOnly??!1,c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new Am,d=new lM(c),u=!0);let h=new G9(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=h.scene,g=new dr;g.add(c.onTick,eo.prototype._onTick,this);let f;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let z=document.createElement("div");z.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(z),f=new YM(z,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let z=document.createElement("div");z.className="cesium-viewer-infoBoxContainer",o.appendChild(z),y=new kM(z);let K=y.viewModel;g.add(K.cameraClicked,eo.prototype._onInfoBoxCameraClicked,this),g.add(K.closeClicked,eo.prototype._onInfoBoxClockClicked,this)}let x=document.createElement("div");x.className="cesium-viewer-toolbar",o.appendChild(x);let S;if(!l(t.geocoder)||t.geocoder!==!1){let z=document.createElement("div");z.className="cesium-viewer-geocoderContainer",x.appendChild(z);let K;typeof t.geocoder=="string"?K=[new Qx({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(K=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new EM({container:z,geocoderServices:K,scene:p}),g.add(S.viewModel.search.beforeExecute,eo.prototype._clearObjects,this)}let C;(!l(t.homeButton)||t.homeButton!==!1)&&(C=new WM(x,p),l(S)&&g.add(C.viewModel.command.afterExecute,function(){let z=S.viewModel;z.searchText="",z.isSearchInProgress&&z.search()}),g.add(C.viewModel.command.beforeExecute,eo.prototype._clearTrackedObject,this));let V;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(V=new MM(x,p));let L;t.projectionPicker&&(L=new DM(x,p));let Z,E;if(n){let z=t.imageryProviderViewModels??hM(),K=t.terrainProviderViewModels??fM();Z=new mM(x,{globe:p.globe,imageryProviderViewModels:z,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:K,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),E=x.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(Z.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(Z.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let P;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let z=!0;try{if(l(window.localStorage)){let K=window.localStorage.getItem("cesium-hasSeenNavHelp");l(K)&&K?z=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}P=new vM({container:x,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??z})}let W;if(!l(t.animation)||t.animation!==!1){let z=document.createElement("div");z.className="cesium-viewer-animationContainer",o.appendChild(z),W=new _M(z,new TM(d))}let v;if(!l(t.timeline)||t.timeline!==!1){let z=document.createElement("div");z.className="cesium-viewer-timelineContainer",o.appendChild(z),v=new KM(z,c),v.addEventListener("settime",t1e,!1),v.zoomTo(c.startTime,c.stopTime)}let A,b,R;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(R=document.createElement("div"),R.className="cesium-viewer-fullscreenContainer",o.appendChild(R),A=new ZM(R,t.fullscreenElement),b=Ea(A.viewModel,"isFullscreenEnabled",function(z){R.style.display=z?"block":"none",l(v)&&(v.container.style.right=`${R.clientWidth}px`,v.resize())}));let G,I,w;if(t.vrButton){let z=document.createElement("div");z.className="cesium-viewer-vrContainer",o.appendChild(z),G=new QM(z,p,t.fullScreenElement),I=Ea(G.viewModel,"isVREnabled",function(K){z.style.display=K?"block":"none",l(A)&&(z.style.right=`${R.clientWidth}px`),l(v)&&(v.container.style.right=`${z.clientWidth}px`,v.resize())}),w=Ea(G.viewModel,"isVRMode",function(K){_Vt(i,K)})}this._baseLayerPickerDropDown=E,this._fullscreenSubscription=b,this._vrSubscription=I,this._vrModeSubscription=w,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=f,this._infoBox=y,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=x,this._homeButton=C,this._sceneModePicker=V,this._projectionPicker=L,this._baseLayerPicker=Z,this._navigationHelpButton=P,this._animation=W,this._timeline=v,this._fullscreenButton=A,this._vrButton=G,this._geocoder=S,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(f),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let M=this._cesiumWidget.dataSources,O=this._cesiumWidget.dataSourceDisplay;g.add(M.dataSourceAdded,eo.prototype._onDataSourceAdded,this),g.add(M.dataSourceRemoved,eo.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,eo.prototype.resize,this);let k=M.length;for(let z=0;z<k;z++)this._dataSourceAdded(M,M.get(z));this._dataSourceAdded(void 0,O.defaultDataSource),g.add(M.dataSourceAdded,eo.prototype._dataSourceAdded,this),g.add(M.dataSourceRemoved,eo.prototype._dataSourceRemoved,this);function B(z){let K=$Ce(i,z);l(K)?J.getValueOrUndefined(K.position,i.clock.currentTime)?i.trackedEntity=K:i.zoomTo(K):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function N(z){i.selectedEntity=$Ce(i,z)}h.screenSpaceEventHandler.setInputAction(N,Tn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(B,Tn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(eo.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,dq(this._timeline,e))}}});eo.prototype.extend=function(e,t){e(this,t)};eo.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let f=this._geocoder.searchSuggestionsContainer;f.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,d,u=0,h=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let f=this._lastWidth;d=this._animation.container,n>900?(u=169,f<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(f<600||f>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(f>600||f===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),h=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let f=this._fullscreenButton,y=this._vrButton,x=c.container,S=x.style;p=x.clientHeight+3,S.left=`${u}px`;let C=0;l(f)&&(C+=f.container.clientWidth),l(y)&&(C+=y.container.clientWidth),S.right=`${C}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};eo.prototype.forceResize=function(){this._lastWidth=0,this.resize()};eo.prototype.render=function(){this._cesiumWidget.render()};eo.prototype.isDestroyed=function(){return!1};eo.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Tn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Tn.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",t1e,!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(),me(this)};eo.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(eo.prototype._onEntityCollectionChanged,this)};eo.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(eo.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};eo.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};eo.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,qCe)!==ut.FAILED?n=qCe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=m.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=o.name??o.id,a.description=J.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};eo.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)}};eo.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)}};eo.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};eo.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};eo.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};eo.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&dq(this.timeline,e)};eo.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&dq(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,eo.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};eo.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};eo.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};eo.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var uq=eo;var zGo=_(T(),1);function TVt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new LM(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var mq=TVt;var JGo=_(T(),1);function SVt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new gM(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var hq=SVt;var $Go=_(T(),1);function CVt(e,t){t=t??Y.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new be,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=Pn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){n1e(s,d),s=u,fq(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?fq(s,d):n1e(s,d),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return c},set:function(u){c=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){NS(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=u.dataTransfer.files,p=h.length;for(let g=0;g<p;g++){let f=h[g],y=new FileReader;y.onload=VVt(e,f,c,a),y.onerror=LVt(e,f),y.readAsText(f)}}fq(s,d),e.destroy=UI(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function NS(e){e.stopPropagation(),e.preventDefault()}function n1e(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",NS,!1),n.removeEventListener("dragover",NS,!1),n.removeEventListener("dragexit",NS,!1))}function fq(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",NS,!1),e.addEventListener("dragover",NS,!1),e.addEventListener("dragexit",NS,!1)}function VVt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=Ov.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=Gy.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=JT.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=Fw.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function LVt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var pq=CVt;var rEo=_(T(),1);function RVt(e,t){t=t??Y.EMPTY_OBJECT;let n=new FM({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var bq=RVt;var _Eo=_(T(),1);var gEo=_(T(),1);var dEo=_(T(),1);function i1e(e){let t=e.split(`
|
|
|
`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c}
|
|
|
`}return i}function _m(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let d=Te.observable();return Te.defineProperty(t,r,{get:function(){return d()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),d(u),l(a)&&l(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,d}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=i1e(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===Ni.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Ni.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Ni.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.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&&mp(t)},getPrimitiveFunction:function(){t.translationX=F.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&mp(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&mp(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&mp(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&mp(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&mp(t)},getPrimitiveFunction:function(){t.scaleZ=F.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&mp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&mp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&mp(t)}})}var ZVt=new m,GVt=new m,EVt=new Xa,IVt=new $;function mp(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,ZVt),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,GVt),i=EVt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,IVt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(_m.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=i1e(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,mp(t)}}}});_m.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};_m.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};_m.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};_m.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};_m.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};_m.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};_m.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new _S({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};_m.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
|
|
|
`),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(`
|
|
|
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};_m.prototype.isDestroyed=function(){return!1};_m.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),me(this)};var jM=_m;function U3(e,t){e=Pn(e);let n=document.createElement("div"),i=new jM(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 s=ja.createSection,a=ja.createCheckbox,c=ja.createRangeInput,d=ja.createButton,u=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),g=s(r,"Clipping","clippingVisible","toggleClipping"),f=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(c("Screen Space Error","screenSpaceError",0,128)),u.appendChild(c("Step Size","stepSize",0,2));let y=10,x=10,S=X.PI;h.appendChild(c("Translation X","translationX",-y,+y)),h.appendChild(c("Translation Y","translationY",-y,+y)),h.appendChild(c("Translation Z","translationZ",-y,+y)),h.appendChild(c("Scale X","scaleX",0,+x)),h.appendChild(c("Scale Y","scaleY",0,+x)),h.appendChild(c("Scale Z","scaleZ",0,+x)),h.appendChild(c("Heading","angleX",-S,+S)),h.appendChild(c("Pitch","angleY",-S,+S)),h.appendChild(c("Roll","angleZ",-S,+S));let C=Ni.getMinBounds(Ni.BOX),V=Ni.getMaxBounds(Ni.BOX),L=m.fromElements(Ni.getMinBounds(Ni.ELLIPSOID).x,Ni.getMinBounds(Ni.ELLIPSOID).y,-ne.WGS84.maximumRadius,new m),Z=m.fromElements(Ni.getMaxBounds(Ni.ELLIPSOID).x,Ni.getMaxBounds(Ni.ELLIPSOID).y,1e7,new m),E=Ni.getMinBounds(Ni.CYLINDER),P=Ni.getMaxBounds(Ni.CYLINDER);JL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",C,V,"shapeIsBox",p),JL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",L,Z,"shapeIsEllipsoid",p),JL("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxAngle","boundsCylinderMinAngle","boundsCylinderMaxHeight","boundsCylinderMinHeight",E,P,"shapeIsCylinder",p),JL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",C,V,"shapeIsBox",g),JL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",L,Z,"shapeIsEllipsoid",g),JL("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight",E,P,"shapeIsCylinder",g);let W=document.createElement("div");f.appendChild(W);let v=document.createElement("textarea");v.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),W.className="cesium-cesiumInspector-styleEditor",W.appendChild(v);let A=d("Compile (Ctrl+Enter)","compileShader");W.appendChild(A);let b=document.createElement("label");b.style.display="block",b.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),W.appendChild(b),Te.applyBindings(i,n)}Object.defineProperties(U3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});U3.prototype.isDestroyed=function(){return!1};U3.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};function JL(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,y){let x=ja.createRangeInput,S=p,C=g,V=y.appendChild(document.createElement("div"));V.setAttribute("data-bind",`if: ${f}`),V.appendChild(x(e,s,S.x,C.x)),V.appendChild(x(t,a,S.x,C.x)),V.appendChild(x(n,c,S.y,C.y)),V.appendChild(x(i,d,S.y,C.y)),V.appendChild(x(o,u,S.z,C.z)),V.appendChild(x(r,h,S.z,C.z))}var qM=U3;function XVt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new qM(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var gq=XVt;globalThis.CESIUM_VERSION="1.128";var WVt="1.128";return d1e(PVt);})();
|